Monday, March 26, 2012

parameter is missing a value error

I am trying to populate a report "rdlc" file within a reportviewer control in a webpage. It works fine when is ran as a RDL file as a report services solution. Now that I created my datasource that will populate my report, I get an error "The 'beg_date' parameter is missing a value", which is a field that is specified back from the result of the procedure. Anyone know how to approach this?

Private connAs String Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load conn = System.Configuration.ConfigurationManager.ConnectionStrings("ESQLConn").ConnectionString()End Sub Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click AddReportDataset()End Sub Private Sub AddReportDataset()Dim ds1As ReportDataSource =New ReportDataSource("DataSource1", sd1())Dim ds2As ReportDataSource =New ReportDataSource("DataSource2", sd2())Dim ds3As ReportDataSource =New ReportDataSource("DataSource3", sd3())Me.rptViewer.LocalReport.DataSources.Add(ds1)Me.rptViewer.LocalReport.DataSources.Add(ds2)Me.rptViewer.LocalReport.DataSources.Add(ds3)End Sub Private Function sd1()As SqlDataSourceDim compnameAs ControlParameter =New ControlParameter compname.DefaultValue =Me.txtCompany.Text.ToStringDim begdateAs ControlParameter =New ControlParameter begdate.DefaultValue =Me.txtBegDate.Text.ToStringDim enddateAs ControlParameter =New ControlParameter enddate.DefaultValue =Me.txtEndDate.Text.ToStringDim sqldsAs New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand ="csp_rpt_ef0115_db" sqlds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure sqlds.SelectParameters.Add(compname) sqlds.SelectParameters.Add(begdate) sqlds.SelectParameters.Add(enddate)Return sqldsEnd Function Private Function sd2()As SqlDataSourceDim sqldsAs New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand ="SELECT DISTINCT RTRIM(Act_Type) + ISNULL(Act_Sub_Type,'') AS Type FROM AR_Act" sqlds.SelectCommandType = SqlDataSourceCommandType.Text Return sqlds End Function Private Function sd3() As SqlDataSource Dim sqlds As New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand = "select Item from dbo.Pick_Items with (nolock)
where fPick_Name='asxdbLocations" sqlds.SelectCommandType = SqlDataSourceCommandType.TextReturn sqldsEnd Function

hello,

you seem to be commenting some of you code out by using ' instead of "

See your original post and look at the text in green which is commented out. Could this be the problem?

Regards

Marco

|||

use those link it might help you http://www.c-sharpcorner.com/UploadFile/asif.blog/DynamicDataGrouping08042006115320AM/DynamicDataGrouping.aspx

No comments:

Post a Comment