Showing posts with label visual. Show all posts
Showing posts with label visual. 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

Friday, March 23, 2012

paramater problem

is there any solution to use null values to the parameter
my sql commandtext=
"select * from info where name=@.name and surname=@.surname"
in visual basic .net
info table data=
name surname
_______ _______________
1 null
2 null
i execute my program and use this commandtext
but i cant find any solution because of the null values
what can i do at visual basic .net or at sql server to solve this
bafidi wrote:
> is there any solution to use null values to the parameter
> my sql commandtext=
> "select * from info where name=@.name and surname=@.surname"
> in visual basic .net
> info table data=
> name surname
> _______ _______________
> 1 null
> 2 null
> i execute my program and use this commandtext
> but i cant find any solution because of the null values
> what can i do at visual basic .net or at sql server to solve this
Use can use a LIKE clause instead. Always add a '%' to the end of the
parameter value and never use a NULL. You should also explicitly define
all columns you require rather than using SELECT *.
Select
Col1,
Col2
From
dbo.Info
Where
name LIKE @.Name
and
surname LIKE @.surname
I might consider using a clustered index on the surname and a
non-clustered index on name. That way, you are covered in all cases.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Use a WHERE clause, no?
SELECT * FROM tblInfo
where vchName = @.name AND vchSurName = @.surname
AND @.name IS NOT NULL
AND @.surname IS NOT NULL
Is that okay for U?
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:ekLjiO2wFHA.2880@.TK2MSFTNGP12.phx.gbl...
> bafidi wrote:
> Use can use a LIKE clause instead. Always add a '%' to the end of the
> parameter value and never use a NULL. You should also explicitly define
> all columns you require rather than using SELECT *.
> Select
> Col1,
> Col2
> From
> dbo.Info
> Where
> name LIKE @.Name
> and
> surname LIKE @.surname
> I might consider using a clustered index on the surname and a
> non-clustered index on name. That way, you are covered in all cases.
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||John Smith wrote:
> Use a WHERE clause, no?
> SELECT * FROM tblInfo
> where vchName = @.name AND vchSurName = @.surname
> AND @.name IS NOT NULL
> AND @.surname IS NOT NULL
> Is that okay for U?
Why do you need the IS NOT NULL? Nothing is equal to NULL, so you're not
going to ever get NULL values back. And what happened to the query I
posted with the LIKE clauses?
Maybe you could explain your requirements in more detail. Do you need to
be able to search for NULL values? If so, you need to use WHERE COLNAME
IS NULL syntax. If you don't need NULL values and need to search on
wildcards, then look at the example I posted.
David Gugick
Quest Software
www.imceda.com
www.quest.com

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 setup on crystal report 8.5

dear babu,
i want to ask you a question on crystal report 8.5.
i'm using crystal report viewer from visual basic 6.0 to view reports but i'm found problems to setup page margin until this time. can you help me for a while ??

how to view page setup on my crystal report viewer so end user have flexibility to customize the margin ??

thanks for your help.

emmileI think you cannot do that at run time
You need to design it in Design time

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