Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Monday, March 26, 2012

Parameter is missing a value

I have a report parameter with Allow null value checked (and also Allow blank value). The report works as expected when viewed in Visual Studio, i.e. if I don't supply a value for the parameter, the report still renders. However, when I try to view this report through the web ReportViewer I get the error message "The X parameter is missing a value". It works fine when a value is supplied but I want that parameter to be optional.

Any idea what's going wrong here?

Thanks.

All parameters must have a value. In your case, it sounds like you want the default value to be null (or maybe empty string). Have you specified this as the default value? Can you post a sample RDL?

|||

This is the parameter:

<ReportParameter Name="Group1">

<DataType>String</DataType>

<Nullable>true</Nullable>

<AllowBlank>true</AllowBlank>

<Prompt>Group1</Prompt>

</ReportParameter>

In VS, Null is selected as the default value.

In the code that sets up the ReportViewer, I've tried both excluding the SetQueryParameter call for that parameter and also passing an empty string and both result in that error message.

|||This all looks ok. Will you post your code that sets the report definition and any other parameters?|||

Microsoft.Samples.ReportingServices.ReportViewer rv = new Microsoft.Samples.ReportingServices.ReportViewer();

rv.ServerUrl = "http://localhost/ReportServer$SQL2005";

rv.ReportPath = "GroupedReport";

rv.Width = Unit.Percentage(100);

rv.Height = Unit.Percentage(100);

rv.Parameters = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False;

//several parameters are added via

rv.SetQueryParameter("ParamName", ParamValue);

Then for this particular parameter, I've tried just leaving out the set parameter call and also tried doing this:

rv.SetQueryParameter("Group1", "");

and

rv.SetQueryParameter("Group1", null);

Neither of which worked.

And then of course:

plhReport.Controls.Add(rv);

Thanks for your help.

|||

I didn't realize you were using the viewer sample. Since you are using SQL 2005, have you considered using the ReportViewer control that ships with Visual Studio 2005? It provides a lot more functionality than the sample and offers much better integration with your application.

You can get a lot of good information on the control from www.gotreportviewer.com.

|||

Yeah, I'm in the process of converting the code to that new control and it seems to get rid of this problem.

Thanks.

|||

Please help guys i posted in this forum yesterday and no one has replied. I cant even seem to get my report woking at all?

My form is very simple at the moment and has a drop down list that when a service is selected fires of a postback!

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<cc1:Combobox ID="Combobox1" runat="server" CSSOptionIcon="ico" AutoPostbackEnable="true"

FolderStyle="./combobox/styles/blueGray" Height="500" InnerWidth="500" Width="500">

</cc1:Combobox>

</div>

<div>

<rsweb:ReportViewer ID="SRViewer" runat="server" Visible="false" Height="600px" Width="600px" Font-Names="Verdana" Font-Size="8pt">

</rsweb:ReportViewer>

</div>

</form>

</body>

</html>

when fired the form databinds the report to a dataset / table that is returned based on drop down selection and year. for now i phisivcally put in '2007'

Protected Sub SRViewer_DataBinding(ByVal sender As Object, ByVal e As EventArgs) Handles SRViewer.DataBinding

Dim dt As DataTable = New DataTable

dt = ServiceReport(Combobox1.Text, "2007").Tables(0)

Dim DR As DataColumnCollection = dt.Columns

Dim FD As DataColumn = dt.Columns("No_of_Complaints")

Dim tD As DataColumn = dt.Columns("MonthName")

Dim bindDs_name As String = "dt"

Dim reportName As String = "Service Report"

Dim reportPath As String = "Report1.rdlc"

Dim fullReportPath As String = reportPath + reportName

Dim txtReportTitle As String = "Service Report"

If Session("fullReport") Is Nothing Then

Session.Add("fullReport", reportPath + reportName)

Else

Session.Remove("fullReport")

Session.Add("fullReport", reportPath + reportName)

End If

SRViewer.LocalReport.DisplayName = "Service Report"

SRViewer.LocalReport.ReportPath = "Report1.rdlc"

Dim No_of_Complaints As ReportParameter = New ReportParameter

Dim Month_Name As ReportParameter = New ReportParameter

No_of_Complaints.Name = "No_of_Complaints"

Month_Name.Name = "Month_Name"

For Each FD In DR

No_of_Complaints.Values.Add(FD.ToString())

Month_Name.Values.Add(tD.ToString())

Next

Dim myReportParams As ReportParameter() = New ReportParameter() {No_of_Complaints, Month_Name}

SRViewer.LocalReport.SetParameters(myReportParams)

If Not (dt Is Nothing) Then

SRViewer.LocalReport.DataSources.Clear()

SRViewer.LocalReport.DataSources.Add(New ReportDataSource(bindDs_name.Trim, dt))

dt.Dispose()

End If

End Sub

my report viewer wouldnt even compile without me addind a dataset and some parameters to it!! I dunno why i even need these parameters? i've downloaded numerous examples and cant actually ubderstand the logic behind this particuar control...

<?xml version="1.0" encoding="utf-8"?>

<xs:schema id="dt" targetNamespace="http://tempuri.org/dt.xsd" xmlns:mstns="http://tempuri.org/dt.xsd" xmlns="http://tempuri.org/dt.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">

<xs:annotation>

<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">

<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">

<Connections>

<Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="connString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="connString (Web.config)" ParameterPrefix="@." PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.connString.ConnectionString" Provider="System.Data.SqlClient">

</Connection>

</Connections>

<Tables>

<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="SelectServiceReportTableAdapter" GeneratorDataComponentClassName="SelectServiceReportTableAdapter" Name="SelectServiceReport" UserDataComponentName="SelectServiceReportTableAdapter">

<MainSource>

<DbSource ConnectionRef="connString (Web.config)" DbObjectName="TestComplaints.TestComplaint.SelectServiceReport" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetServiceData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetServiceData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetServiceData" UserSourceName="Fill">

<SelectCommand>

<DbCommand CommandType="StoredProcedure" ModifiedByUser="False">

<CommandText>TestComplaint.SelectServiceReport</CommandText>

<Parameters>

<Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="dt" DbType="Int32" Direction="ReturnValue" ParameterName="@.RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current">

</Parameter>

</Parameters>

</DbCommand>

</SelectCommand>

</DbSource>

</MainSource>

<Mappings>

<Mapping SourceColumn="Total" DataSetColumn="Total" />

<Mapping SourceColumn="MonthName" DataSetColumn="MonthName" />

</Mappings>

<Sources>

</Sources>

</TableAdapter>

</Tables>

<Sources>

</Sources>

</DataSource>

</xs:appinfo>

</xs:annotation>

<xs:element name="dt" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dt" msprop:Generator_DataSetName="_dt">

<xs:complexType>

<xs:choice minOccurs="0" maxOccurs="unbounded">

<xs:element name="dt" msprop:Generator_UserTableName="dt" msprop:Generator_RowDeletedName="dtRowDeleted" msprop:Generator_TableClassName="dtDataTable" msprop:Generator_RowChangedName="dtRowChanged" msprop:Generator_RowClassName="dtRow" msprop:Generator_RowChangingName="dtRowChanging" msprop:Generator_RowEvArgName="dtRowChangeEvent" msprop:Generator_RowEvHandlerName="dtRowChangeEventHandler" msprop:Generator_TablePropName="dt" msprop:Generator_TableVarName="tabledt" msprop:Generator_RowDeletingName="dtRowDeleting">

<xs:complexType>

<xs:sequence>

<xs:element name="Total" msprop:Generator_UserColumnName="Total" msprop:Generator_ColumnPropNameInRow="Total" msprop:Generator_ColumnVarNameInTable="columnTotal" msprop:Generator_ColumnPropNameInTable="TotalColumn" type="xs:string" minOccurs="0" />

<xs:element name="MonthName" msprop:Generator_UserColumnName="MonthName" msprop:Generator_ColumnPropNameInRow="MonthName" msprop:Generator_ColumnVarNameInTable="columnMonthName" msprop:Generator_ColumnPropNameInTable="MonthNameColumn" type="xs:string" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="SelectServiceReport" msprop:Generator_UserTableName="SelectServiceReport" msprop:Generator_RowDeletedName="SelectServiceReportRowDeleted" msprop:Generator_TableClassName="SelectServiceReportDataTable" msprop:Generator_RowChangedName="SelectServiceReportRowChanged" msprop:Generator_RowClassName="SelectServiceReportRow" msprop:Generator_RowChangingName="SelectServiceReportRowChanging" msprop:Generator_RowEvArgName="SelectServiceReportRowChangeEvent" msprop:Generator_RowEvHandlerName="SelectServiceReportRowChangeEventHandler" msprop:Generator_TablePropName="SelectServiceReport" msprop:Generator_TableVarName="tableSelectServiceReport" msprop:Generator_RowDeletingName="SelectServiceReportRowDeleting">

<xs:complexType>

<xs:sequence>

<xs:element name="Total" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Total" msprop:Generator_ColumnPropNameInRow="Total" msprop:Generator_ColumnVarNameInTable="columnTotal" msprop:Generator_ColumnPropNameInTable="TotalColumn" type="xs:int" minOccurs="0" />

<xs:element name="MonthName" msdata:ReadOnly="true" msprop:Generator_UserColumnName="MonthName" msprop:Generator_ColumnPropNameInRow="MonthName" msprop:Generator_ColumnVarNameInTable="columnMonthName" msprop:Generator_ColumnPropNameInTable="MonthNameColumn" minOccurs="0">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:maxLength value="30" />

</xs:restriction>

</xs:simpleType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

I have no clue why i should use this dataset? The data i need comes from

Public Function ServiceReport(ByVal Service As String, ByVal Year As String) As DataSet

Dim SR As New DataSet

Dim db As New Database

Try

db.CommandText = "SELECT sum([Total])as No_of_Complaints,[MonthName]" & _

"FROM [TestComplaints].[dbo].[servicereport]" & _

"where [Service] = '" + Service + "' and DatePart(yy, [ReceivedDate]) = '" + Year + "'" & _

"GROUP By [MonthName]"

SR = db.ReturnDataSet(conn)

Catch ex As Exception

Throw ex

End Try

Return SR

End Function

where i have classes like database in my project that return tables etc.

when i run this in sql all i retrieve is what i want to present in the 3D type charts..

5 April
2 August
3 December
4 February
7 January
3 July
6 June
5 March
10 May
1 November
6 October

my x-m axis showing the months and y axis the total value..

I wont probably hear from anyone but thought to post anyways.

sql

Parameter is missing a value

I have a report parameter with Allow null value checked (and also Allow blank value). The report works as expected when viewed in Visual Studio, i.e. if I don't supply a value for the parameter, the report still renders. However, when I try to view this report through the web ReportViewer I get the error message "The X parameter is missing a value". It works fine when a value is supplied but I want that parameter to be optional.

Any idea what's going wrong here?

Thanks.

All parameters must have a value. In your case, it sounds like you want the default value to be null (or maybe empty string). Have you specified this as the default value? Can you post a sample RDL?

|||

This is the parameter:

<ReportParameter Name="Group1">

<DataType>String</DataType>

<Nullable>true</Nullable>

<AllowBlank>true</AllowBlank>

<Prompt>Group1</Prompt>

</ReportParameter>

In VS, Null is selected as the default value.

In the code that sets up the ReportViewer, I've tried both excluding the SetQueryParameter call for that parameter and also passing an empty string and both result in that error message.

|||This all looks ok. Will you post your code that sets the report definition and any other parameters?|||

Microsoft.Samples.ReportingServices.ReportViewer rv = new Microsoft.Samples.ReportingServices.ReportViewer();

rv.ServerUrl = "http://localhost/ReportServer$SQL2005";

rv.ReportPath = "GroupedReport";

rv.Width = Unit.Percentage(100);

rv.Height = Unit.Percentage(100);

rv.Parameters = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False;

//several parameters are added via

rv.SetQueryParameter("ParamName", ParamValue);

Then for this particular parameter, I've tried just leaving out the set parameter call and also tried doing this:

rv.SetQueryParameter("Group1", "");

and

rv.SetQueryParameter("Group1", null);

Neither of which worked.

And then of course:

plhReport.Controls.Add(rv);

Thanks for your help.

|||

I didn't realize you were using the viewer sample. Since you are using SQL 2005, have you considered using the ReportViewer control that ships with Visual Studio 2005? It provides a lot more functionality than the sample and offers much better integration with your application.

You can get a lot of good information on the control from www.gotreportviewer.com.

|||

Yeah, I'm in the process of converting the code to that new control and it seems to get rid of this problem.

Thanks.

|||

Please help guys i posted in this forum yesterday and no one has replied. I cant even seem to get my report woking at all?

My form is very simple at the moment and has a drop down list that when a service is selected fires of a postback!

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<cc1:Combobox ID="Combobox1" runat="server" CSSOptionIcon="ico" AutoPostbackEnable="true"

FolderStyle="./combobox/styles/blueGray" Height="500" InnerWidth="500" Width="500">

</cc1:Combobox>

</div>

<div>

<rsweb:ReportViewer ID="SRViewer" runat="server" Visible="false" Height="600px" Width="600px" Font-Names="Verdana" Font-Size="8pt">

</rsweb:ReportViewer>

</div>

</form>

</body>

</html>

when fired the form databinds the report to a dataset / table that is returned based on drop down selection and year. for now i phisivcally put in '2007'

Protected Sub SRViewer_DataBinding(ByVal sender As Object, ByVal e As EventArgs) Handles SRViewer.DataBinding

Dim dt As DataTable = New DataTable

dt = ServiceReport(Combobox1.Text, "2007").Tables(0)

Dim DR As DataColumnCollection = dt.Columns

Dim FD As DataColumn = dt.Columns("No_of_Complaints")

Dim tD As DataColumn = dt.Columns("MonthName")

Dim bindDs_name As String = "dt"

Dim reportName As String = "Service Report"

Dim reportPath As String = "Report1.rdlc"

Dim fullReportPath As String = reportPath + reportName

Dim txtReportTitle As String = "Service Report"

If Session("fullReport") Is Nothing Then

Session.Add("fullReport", reportPath + reportName)

Else

Session.Remove("fullReport")

Session.Add("fullReport", reportPath + reportName)

End If

SRViewer.LocalReport.DisplayName = "Service Report"

SRViewer.LocalReport.ReportPath = "Report1.rdlc"

Dim No_of_Complaints As ReportParameter = New ReportParameter

Dim Month_Name As ReportParameter = New ReportParameter

No_of_Complaints.Name = "No_of_Complaints"

Month_Name.Name = "Month_Name"

For Each FD In DR

No_of_Complaints.Values.Add(FD.ToString())

Month_Name.Values.Add(tD.ToString())

Next

Dim myReportParams As ReportParameter() = New ReportParameter() {No_of_Complaints, Month_Name}

SRViewer.LocalReport.SetParameters(myReportParams)

If Not (dt Is Nothing) Then

SRViewer.LocalReport.DataSources.Clear()

SRViewer.LocalReport.DataSources.Add(New ReportDataSource(bindDs_name.Trim, dt))

dt.Dispose()

End If

End Sub

my report viewer wouldnt even compile without me addind a dataset and some parameters to it!! I dunno why i even need these parameters? i've downloaded numerous examples and cant actually ubderstand the logic behind this particuar control...

<?xml version="1.0" encoding="utf-8"?>

<xs:schema id="dt" targetNamespace="http://tempuri.org/dt.xsd" xmlns:mstns="http://tempuri.org/dt.xsd" xmlns="http://tempuri.org/dt.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">

<xs:annotation>

<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">

<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">

<Connections>

<Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="connString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="connString (Web.config)" ParameterPrefix="@." PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.connString.ConnectionString" Provider="System.Data.SqlClient">

</Connection>

</Connections>

<Tables>

<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="SelectServiceReportTableAdapter" GeneratorDataComponentClassName="SelectServiceReportTableAdapter" Name="SelectServiceReport" UserDataComponentName="SelectServiceReportTableAdapter">

<MainSource>

<DbSource ConnectionRef="connString (Web.config)" DbObjectName="TestComplaints.TestComplaint.SelectServiceReport" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetServiceData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetServiceData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetServiceData" UserSourceName="Fill">

<SelectCommand>

<DbCommand CommandType="StoredProcedure" ModifiedByUser="False">

<CommandText>TestComplaint.SelectServiceReport</CommandText>

<Parameters>

<Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="dt" DbType="Int32" Direction="ReturnValue" ParameterName="@.RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current">

</Parameter>

</Parameters>

</DbCommand>

</SelectCommand>

</DbSource>

</MainSource>

<Mappings>

<Mapping SourceColumn="Total" DataSetColumn="Total" />

<Mapping SourceColumn="MonthName" DataSetColumn="MonthName" />

</Mappings>

<Sources>

</Sources>

</TableAdapter>

</Tables>

<Sources>

</Sources>

</DataSource>

</xs:appinfo>

</xs:annotation>

<xs:element name="dt" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dt" msprop:Generator_DataSetName="_dt">

<xs:complexType>

<xs:choice minOccurs="0" maxOccurs="unbounded">

<xs:element name="dt" msprop:Generator_UserTableName="dt" msprop:Generator_RowDeletedName="dtRowDeleted" msprop:Generator_TableClassName="dtDataTable" msprop:Generator_RowChangedName="dtRowChanged" msprop:Generator_RowClassName="dtRow" msprop:Generator_RowChangingName="dtRowChanging" msprop:Generator_RowEvArgName="dtRowChangeEvent" msprop:Generator_RowEvHandlerName="dtRowChangeEventHandler" msprop:Generator_TablePropName="dt" msprop:Generator_TableVarName="tabledt" msprop:Generator_RowDeletingName="dtRowDeleting">

<xs:complexType>

<xs:sequence>

<xs:element name="Total" msprop:Generator_UserColumnName="Total" msprop:Generator_ColumnPropNameInRow="Total" msprop:Generator_ColumnVarNameInTable="columnTotal" msprop:Generator_ColumnPropNameInTable="TotalColumn" type="xs:string" minOccurs="0" />

<xs:element name="MonthName" msprop:Generator_UserColumnName="MonthName" msprop:Generator_ColumnPropNameInRow="MonthName" msprop:Generator_ColumnVarNameInTable="columnMonthName" msprop:Generator_ColumnPropNameInTable="MonthNameColumn" type="xs:string" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="SelectServiceReport" msprop:Generator_UserTableName="SelectServiceReport" msprop:Generator_RowDeletedName="SelectServiceReportRowDeleted" msprop:Generator_TableClassName="SelectServiceReportDataTable" msprop:Generator_RowChangedName="SelectServiceReportRowChanged" msprop:Generator_RowClassName="SelectServiceReportRow" msprop:Generator_RowChangingName="SelectServiceReportRowChanging" msprop:Generator_RowEvArgName="SelectServiceReportRowChangeEvent" msprop:Generator_RowEvHandlerName="SelectServiceReportRowChangeEventHandler" msprop:Generator_TablePropName="SelectServiceReport" msprop:Generator_TableVarName="tableSelectServiceReport" msprop:Generator_RowDeletingName="SelectServiceReportRowDeleting">

<xs:complexType>

<xs:sequence>

<xs:element name="Total" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Total" msprop:Generator_ColumnPropNameInRow="Total" msprop:Generator_ColumnVarNameInTable="columnTotal" msprop:Generator_ColumnPropNameInTable="TotalColumn" type="xs:int" minOccurs="0" />

<xs:element name="MonthName" msdata:ReadOnly="true" msprop:Generator_UserColumnName="MonthName" msprop:Generator_ColumnPropNameInRow="MonthName" msprop:Generator_ColumnVarNameInTable="columnMonthName" msprop:Generator_ColumnPropNameInTable="MonthNameColumn" minOccurs="0">

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:maxLength value="30" />

</xs:restriction>

</xs:simpleType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

I have no clue why i should use this dataset? The data i need comes from

Public Function ServiceReport(ByVal Service As String, ByVal Year As String) As DataSet

Dim SR As New DataSet

Dim db As New Database

Try

db.CommandText = "SELECT sum([Total])as No_of_Complaints,[MonthName]" & _

"FROM [TestComplaints].[dbo].[servicereport]" & _

"where [Service] = '" + Service + "' and DatePart(yy, [ReceivedDate]) = '" + Year + "'" & _

"GROUP By [MonthName]"

SR = db.ReturnDataSet(conn)

Catch ex As Exception

Throw ex

End Try

Return SR

End Function

where i have classes like database in my project that return tables etc.

when i run this in sql all i retrieve is what i want to present in the 3D type charts..

5 April
2 August
3 December
4 February
7 January
3 July
6 June
5 March
10 May
1 November
6 October

my x-m axis showing the months and y axis the total value..

I wont probably hear from anyone but thought to post anyways.

Parameter Error on Deployment

New to report services and trying out my first report. I have a report with a simple parameter lookup. When I preview it in Visual Studio it works fine. I can select the parameter value and it returns back the correct information.

When trying to preview the deployed version of the report I get the following error after selecting the parameter value and clicking preview. I am not sure where I need to declare the variable @.owners.

Thanks

Reporting Services Error

An error has occurred during report processing. (rsProcessingAborted) Get Online Help Query execution failed for data set 'ANDON'. (rsErrorExecutingCommand) Get Online Help ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@.Owners'.

Microsoft Reporting Services

I guess you are using @.Owner in your sql query and not defined it as a parameter for that dataset.

So in Data tab, select the dataset Edit the dataset by clicking on "..." button. and go to Paramaters tab. Type @.Owner under Name column and type "=Parameters!Owner.Value".

I'm asssuimg that Owner is already defined as one of the report parameters (Report -> Report Parameters). If not, create this parameter and then do the above.

Shyam

|||

Thanks for the response.

I have my SQL query defined as

SELECT idfld, andon, createdate, issuetype, origname, owner, notes, outcome, responded, resolution
FROM dbo.issue
WHERE (owner = @.Owner)

I went into the Data Tab/Parameters Tab and @.Owner = Parameters!Owner.value was already set

In my report parameters I have Owner defined and it is pulling information from a Select Distinct owner query.

Still works in the view mode and I still get the error when I look at the deployed report.

|||

I guess you have set Available values for your parameter from a query. Try setting a default value for your parameter.

Shyam

|||

Yes, I am getting the values for my parameter from a query. I tried setting a default value and I still get the same error.

|||

Is your parameter multi-valued?

Also check the following link:

http://msdn2.microsoft.com/en-us/library/aa337223.aspx

What is the provider type you are using on your report server and on your local machine (from visual studio)? Based on that check how you should handle as described in the link above.

Shyam

|||

"What is the provider type you are using on your report server and on your local machine (from visual studio)? "

That was the key. I had to modify the data source on the Reports Server to match what I was using on my report. Thanks!

|||make sure that the parameter is consistent throughout your code. Parameters are case sensitive - In your post, the error message referred to @.Owners - with an "s". In your posts it was referred to as @.Owner and @.owner. Reporting services sends the error when there is any difference between the report parameter in the parameter drop down and its references in the underlying code.

Parameter Error on Deployment

New to report services and trying out my first report. I have a report with a simple parameter lookup. When I preview it in Visual Studio it works fine. I can select the parameter value and it returns back the correct information.

When trying to preview the deployed version of the report I get the following error after selecting the parameter value and clicking preview. I am not sure where I need to declare the variable @.owners.

Thanks

Reporting Services Error


An error has occurred during report processing. (rsProcessingAborted) Get Online Help

Query execution failed for data set 'ANDON'. (rsErrorExecutingCommand) Get Online Help

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@.Owners'.


Microsoft Reporting Services

I guess you are using @.Owner in your sql query and not defined it as a parameter for that dataset.

So in Data tab, select the dataset Edit the dataset by clicking on "..." button. and go to Paramaters tab. Type @.Owner under Name column and type "=Parameters!Owner.Value".

I'm asssuimg that Owner is already defined as one of the report parameters (Report -> Report Parameters). If not, create this parameter and then do the above.

Shyam

|||

Thanks for the response.

I have my SQL query defined as

SELECT idfld, andon, createdate, issuetype, origname, owner, notes, outcome, responded, resolution
FROM dbo.issue
WHERE (owner = @.Owner)

I went into the Data Tab/Parameters Tab and @.Owner = Parameters!Owner.value was already set

In my report parameters I have Owner defined and it is pulling information from a Select Distinct owner query.

Still works in the view mode and I still get the error when I look at the deployed report.

|||

I guess you have set Available values for your parameter from a query. Try setting a default value for your parameter.

Shyam

|||

Yes, I am getting the values for my parameter from a query. I tried setting a default value and I still get the same error.

|||

Is your parameter multi-valued?

Also check the following link:

http://msdn2.microsoft.com/en-us/library/aa337223.aspx

What is the provider type you are using on your report server and on your local machine (from visual studio)? Based on that check how you should handle as described in the link above.

Shyam

|||

"What is the provider type you are using on your report server and on your local machine (from visual studio)? "

That was the key. I had to modify the data source on the Reports Server to match what I was using on my report. Thanks!

|||make sure that the parameter is consistent throughout your code. Parameters are case sensitive - In your post, the error message referred to @.Owners - with an "s". In your posts it was referred to as @.Owner and @.owner. Reporting services sends the error when there is any difference between the report parameter in the parameter drop down and its references in the underlying code.sql

Parameter direction of a stored procedure

I am using the MS SQL Server Management Studio Express to create a stored procedure in one of my databases. I specify one of the parameters as OUTPUT as follows:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[ProcRetDbl]

@.Threshold real, @.Result real OUTPUT
AS
BEGIN

SET NOCOUNT ON;

SELECT @.Result = Channel1 FROM DataTable WHERE Channel2 < @.Threshold
END

But then when I look at the properties of the @.Result parameter in the Object Explorer's tree, it is shown as "Input/Output". Now, this seems like no problem at all since it will work fine as output, even though I don't need it to be able to do input as well, but I'm wondering why that is happening.

I am using ADO.Net on the other end to execute the procedure and I need to decide what parameter type to set to the SqlParameter object: "Output" or "InputOutput". I'm sure I can sort this out but I usually like to know what I'm doing. Thanks for the help.

KamenYou are probably thinking too hard :)

You need to supply a parameter in to give you something to read when the value comes out. I can't remember what I use for sqlParameters - probably inputoutput. Try both - what have you got to lose?|||The only pure output from a stored procedure is the return code value and any result sets. Procedure parameters must be input, and can optionally be output too.

-PatP

Friday, March 23, 2012

Paramater in Case statement

When I enter the following query in the MSSQL 2005 Server Management Studio,
I get results, but when i enter the same query (Minus the top 2 lines) in RS,
i get an a error:
Title: Microsoft Visual Database Tools
Error: The Parameter is incorrect.
Any ideas what i'm doing wrong? This query is just a simplified example
using the northwind db.
DECLARE @.Region AS NVARCHAR(15)
SELECT @.Region = '1'
SELECT *
FROM Customers
WHERE Region = CASE
WHEN @.Region = '1'
THEN 'SP'
END
--
Lucas DargisHi Lucas,
> DECLARE @.Region AS NVARCHAR(15)
> SELECT @.Region = '1'
You are using a variable (@.Region) in your query and if you leave off the
top 2 lines, you are not declaring the variable and setting its value. The
statement needs this.
HTH!
Kind regards - Fred|||thanks Fred.
I left off the top two lines because in RS you specify the parameters in the
'Report > Report Parameters' window.
i found that this is just a bug in the design view of RS. when i Previewed
the report, it worked just fine.
thanks
--
Lucas Dargis
"Fred Block" wrote:
> Hi Lucas,
> > DECLARE @.Region AS NVARCHAR(15)
> > SELECT @.Region = '1'
> You are using a variable (@.Region) in your query and if you leave off the
> top 2 lines, you are not declaring the variable and setting its value. The
> statement needs this.
> HTH!
> Kind regards - Fred
>
>|||This is not true. The way it works, if you have not declared it then RS
knows that it is a query parameter and automatically creates a report
parameter for it. I used the below code against adventureworks and it works:
SELECT *
FROM sales.Customer
WHERE TerritoryID =CASE
WHEN @.Region = '2'
THEN 2
END
Use the generic query designer (the button to switch to generic mode is one
of the buttons to the right of the ...).
Execute the query, you should be prompted for a value.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Fred Block" <fblock@.no_spams.w-systems.com> wrote in message
news:utQYEFuTHHA.1636@.TK2MSFTNGP02.phx.gbl...
> Hi Lucas,
>> DECLARE @.Region AS NVARCHAR(15)
>> SELECT @.Region = '1'
> You are using a variable (@.Region) in your query and if you leave off the
> top 2 lines, you are not declaring the variable and setting its value. The
> statement needs this.
> HTH!
> Kind regards - Fred
>|||Bruce,
that is what i said... just not as well.
i just gave him the 'check' since i couldn't give it to myself.
--
Lucas Dargis
"Bruce L-C [MVP]" wrote:
> This is not true. The way it works, if you have not declared it then RS
> knows that it is a query parameter and automatically creates a report
> parameter for it. I used the below code against adventureworks and it works:
> SELECT *
> FROM sales.Customer
> WHERE TerritoryID => CASE
> WHEN @.Region = '2'
> THEN 2
> END
> Use the generic query designer (the button to switch to generic mode is one
> of the buttons to the right of the ...).
> Execute the query, you should be prompted for a value.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Fred Block" <fblock@.no_spams.w-systems.com> wrote in message
> news:utQYEFuTHHA.1636@.TK2MSFTNGP02.phx.gbl...
> > Hi Lucas,
> >
> >> DECLARE @.Region AS NVARCHAR(15)
> >> SELECT @.Region = '1'
> >
> > You are using a variable (@.Region) in your query and if you leave off the
> > top 2 lines, you are not declaring the variable and setting its value. The
> > statement needs this.
> >
> > HTH!
> >
> > Kind regards - Fred
> >
>
>

Monday, March 12, 2012

Paging issue on conditionally set second table visibility

Hi. I am having a problem with a 2005 report that has two tables and is designed thru visual studio. The second table is set to page break before printing and also to repeater headers on new pages. It works fine just like that. However, if I place a condition on the visibilty of the table based on an input report parameter it does not page break before rendering the table. In fact it does not page break at all leaving me with an extremely long last page. The visiblity parameter does properly toggle. This is all occurring when rendering the report to the screen using the windows reportviewer. When I export to PDF it looks fine.

Any help would be great.

This is currently by design - when the visibility property is expression-based, the page break is ignored. We are considering changing this behavior in the next release.|||

Thanks for the reply Fang.

I do hope you consider chaninging it. I can understand ignoring the page break when visibility is false but I am not sure why one would want to ignore it when visibility is true. Also, the way it is now the rendered report is not consistent between the screen and PDF.

|||Thanks so much for posting your problem. We are converting from crystal to reporting services and have been experiencing this same issue and were very puzzled. This "by design feature" is making a lot of our reports look very inconsistent with pagination between the viewer and printer or pdf. Reminds me of an early crystal reports viewer problem, which they fixed a long time ago...|||Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...|||

Spivey wrote:

Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...

what does next release meant , is it fixed in sp2 2005.

|||

No, its not fixed, but I figured out a solution. The next release will coincide with the next release of SQL Server - 2008 sometime.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1771550&SiteID=1

|||

What is wrong with the people at Microsoft? Just when you think they have done something right, they screw up something like this!

WHY WOULD ANYONE WANT TO IGNORE THE PAGE BREAK IF IT IS VISIBLE?!

Ugh!!!!!!!!!!!!!!!!!!!!!!!!!

Paging issue on conditionally set second table visibility

Hi. I am having a problem with a 2005 report that has two tables and is designed thru visual studio. The second table is set to page break before printing and also to repeater headers on new pages. It works fine just like that. However, if I place a condition on the visibilty of the table based on an input report parameter it does not page break before rendering the table. In fact it does not page break at all leaving me with an extremely long last page. The visiblity parameter does properly toggle. This is all occurring when rendering the report to the screen using the windows reportviewer. When I export to PDF it looks fine.

Any help would be great.

This is currently by design - when the visibility property is expression-based, the page break is ignored. We are considering changing this behavior in the next release.|||

Thanks for the reply Fang.

I do hope you consider chaninging it. I can understand ignoring the page break when visibility is false but I am not sure why one would want to ignore it when visibility is true. Also, the way it is now the rendered report is not consistent between the screen and PDF.

|||Thanks so much for posting your problem. We are converting from crystal to reporting services and have been experiencing this same issue and were very puzzled. This "by design feature" is making a lot of our reports look very inconsistent with pagination between the viewer and printer or pdf. Reminds me of an early crystal reports viewer problem, which they fixed a long time ago...|||Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...|||

Spivey wrote:

Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...

what does next release meant , is it fixed in sp2 2005.

|||

No, its not fixed, but I figured out a solution. The next release will coincide with the next release of SQL Server - 2008 sometime.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1771550&SiteID=1

|||

What is wrong with the people at Microsoft? Just when you think they have done something right, they screw up something like this!

WHY WOULD ANYONE WANT TO IGNORE THE PAGE BREAK IF IT IS VISIBLE?!

Ugh!!!!!!!!!!!!!!!!!!!!!!!!!

Paging issue on conditionally set second table visibility

Hi. I am having a problem with a 2005 report that has two tables and is designed thru visual studio. The second table is set to page break before printing and also to repeater headers on new pages. It works fine just like that. However, if I place a condition on the visibilty of the table based on an input report parameter it does not page break before rendering the table. In fact it does not page break at all leaving me with an extremely long last page. The visiblity parameter does properly toggle. This is all occurring when rendering the report to the screen using the windows reportviewer. When I export to PDF it looks fine.

Any help would be great.

This is currently by design - when the visibility property is expression-based, the page break is ignored. We are considering changing this behavior in the next release.|||

Thanks for the reply Fang.

I do hope you consider chaninging it. I can understand ignoring the page break when visibility is false but I am not sure why one would want to ignore it when visibility is true. Also, the way it is now the rendered report is not consistent between the screen and PDF.

|||Thanks so much for posting your problem. We are converting from crystal to reporting services and have been experiencing this same issue and were very puzzled. This "by design feature" is making a lot of our reports look very inconsistent with pagination between the viewer and printer or pdf. Reminds me of an early crystal reports viewer problem, which they fixed a long time ago...|||Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...|||

Spivey wrote:

Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...

what does next release meant , is it fixed in sp2 2005.

|||

No, its not fixed, but I figured out a solution. The next release will coincide with the next release of SQL Server - 2008 sometime.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1771550&SiteID=1

|||

What is wrong with the people at Microsoft? Just when you think they have done something right, they screw up something like this!

WHY WOULD ANYONE WANT TO IGNORE THE PAGE BREAK IF IT IS VISIBLE?!

Ugh!!!!!!!!!!!!!!!!!!!!!!!!!

Paging issue on conditionally set second table visibility

Hi. I am having a problem with a 2005 report that has two tables and is designed thru visual studio. The second table is set to page break before printing and also to repeater headers on new pages. It works fine just like that. However, if I place a condition on the visibilty of the table based on an input report parameter it does not page break before rendering the table. In fact it does not page break at all leaving me with an extremely long last page. The visiblity parameter does properly toggle. This is all occurring when rendering the report to the screen using the windows reportviewer. When I export to PDF it looks fine.

Any help would be great.

This is currently by design - when the visibility property is expression-based, the page break is ignored. We are considering changing this behavior in the next release.|||

Thanks for the reply Fang.

I do hope you consider chaninging it. I can understand ignoring the page break when visibility is false but I am not sure why one would want to ignore it when visibility is true. Also, the way it is now the rendered report is not consistent between the screen and PDF.

|||Thanks so much for posting your problem. We are converting from crystal to reporting services and have been experiencing this same issue and were very puzzled. This "by design feature" is making a lot of our reports look very inconsistent with pagination between the viewer and printer or pdf. Reminds me of an early crystal reports viewer problem, which they fixed a long time ago...|||Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...|||

Spivey wrote:

Yeah, I would consider really hard changing that! The master-detail report I spent 2 days on is completely useless because it loads entirely on one page and takes forever. Now I have to rewrite it in Crystal...

what does next release meant , is it fixed in sp2 2005.

|||

No, its not fixed, but I figured out a solution. The next release will coincide with the next release of SQL Server - 2008 sometime.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1771550&SiteID=1

|||

What is wrong with the people at Microsoft? Just when you think they have done something right, they screw up something like this!

WHY WOULD ANYONE WANT TO IGNORE THE PAGE BREAK IF IT IS VISIBLE?!

Ugh!!!!!!!!!!!!!!!!!!!!!!!!!

Monday, February 20, 2012

page setup parameters

I have a report (.rdl) that I created in Visual Studio. Is there any way to
send the page setup parameters along with the report so that the user isn't
required to fiddle with the page setup? For example, I have a report that
prints in landscape on legal paper, I want them to be able to click print and
have it output with the landscape/legal setup as opposed to having to set
that up in a print dialog box. I can see the margin setup, page width and
Height in VS, but these don't affect the paper or orientation settings.
Any ideas?I have same issue on Margine setting once i put it in production, the report
layout are changed and it is not what i want.
Can you solve it'
"beeyule" wrote:
> I have a report (.rdl) that I created in Visual Studio. Is there any way to
> send the page setup parameters along with the report so that the user isn't
> required to fiddle with the page setup? For example, I have a report that
> prints in landscape on legal paper, I want them to be able to click print and
> have it output with the landscape/legal setup as opposed to having to set
> that up in a print dialog box. I can see the margin setup, page width and
> Height in VS, but these don't affect the paper or orientation settings.
> Any ideas?|||If you set the Width to be the Height and the Height to be the Width this
will get you the Landscape option.
Ie. for Letter Width=11in and Height=8.5in.
Choosing the paper is a bit different since it depends on the printer for
the local computer. However to get this to happen you can set the default
printer and paper from the windows printers/faxes option. This will then
default in to that box when they click print.
Hope this helps,
Craig
"beeyule" <beeyule@.discussions.microsoft.com> wrote in message
news:2B86CFB0-44BF-4566-B942-9AAD497BD73B@.microsoft.com...
>I have a report (.rdl) that I created in Visual Studio. Is there any way
>to
> send the page setup parameters along with the report so that the user
> isn't
> required to fiddle with the page setup? For example, I have a report that
> prints in landscape on legal paper, I want them to be able to click print
> and
> have it output with the landscape/legal setup as opposed to having to set
> that up in a print dialog box. I can see the margin setup, page width and
> Height in VS, but these don't affect the paper or orientation settings.
> Any ideas?

Page Rendering

Appologies for the Newbie question...However here we go...
I've a report that looks just great in Visual studio, but when I export it
to pdf things go south. The page breaks that are correct in the preview are
now incorrect in the pdf and there are blank pages mingled in the report.
Does anyone have any ideas of what I can do to try to fix this.
StanYea, the page is probably too big to render it to a A4 / US Letter format
(whatever you use). You have to calculate the borders and the page width to
get the estimated output. In Germany we have the A4 format which is about 21
cm in width. If you make the viewable are about 20 cm and the borders ar
each 2 cm the page will exceed to 24 cm and a new page has to be put in
while rendering. Try to narrow the borders.
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Stan" <Stan@.discussions.microsoft.com> schrieb im Newsbeitrag
news:45B85169-EC4A-4F8A-BEA5-051A81899AA0@.microsoft.com...
> Appologies for the Newbie question...However here we go...
> I've a report that looks just great in Visual studio, but when I export it
> to pdf things go south. The page breaks that are correct in the preview
> are
> now incorrect in the pdf and there are blank pages mingled in the report.
> Does anyone have any ideas of what I can do to try to fix this.
> Stan|||I have a similar problem. Report looks great in Visual studio and in a
Browser, but when I convert it to pdf for printing, I am getting extra pages
in between with just a header printed on those pages.
I tried decrease the size of the report and make sure that it fits into 8
1/2 x 11 inches, but it did not help. I still have those annoying empty pages
in the printed report.
Any other suggestions on how can I fix it?
Thank you.
"Jens Sü�meyer" wrote:
> Yea, the page is probably too big to render it to a A4 / US Letter format
> (whatever you use). You have to calculate the borders and the page width to
> get the estimated output. In Germany we have the A4 format which is about 21
> cm in width. If you make the viewable are about 20 cm and the borders ar
> each 2 cm the page will exceed to 24 cm and a new page has to be put in
> while rendering. Try to narrow the borders.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Stan" <Stan@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:45B85169-EC4A-4F8A-BEA5-051A81899AA0@.microsoft.com...
> > Appologies for the Newbie question...However here we go...
> >
> > I've a report that looks just great in Visual studio, but when I export it
> > to pdf things go south. The page breaks that are correct in the preview
> > are
> > now incorrect in the pdf and there are blank pages mingled in the report.
> > Does anyone have any ideas of what I can do to try to fix this.
> >
> > Stan
>
>|||Have you tried setting the page size to 8.46 by 10.46 instead of 8.5 X 11...
I have recently heard there is a bug which requires this ( until MS fixes
it.)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Stan" <Stan@.discussions.microsoft.com> wrote in message
news:45B85169-EC4A-4F8A-BEA5-051A81899AA0@.microsoft.com...
> Appologies for the Newbie question...However here we go...
> I've a report that looks just great in Visual studio, but when I export it
> to pdf things go south. The page breaks that are correct in the preview
> are
> now incorrect in the pdf and there are blank pages mingled in the report.
> Does anyone have any ideas of what I can do to try to fix this.
> Stan