Showing posts with label webpage. Show all posts
Showing posts with label webpage. Show all posts

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

Friday, March 23, 2012

parameter

Hi,

I am using a stored proc which takes in a parameter from a webpage. I am using freetext and have to pass in a parameter inside quotes so that freetext treats the phrase as a single word.

something similar to this.

freetext(SITE_NAME,' " '+ @.Search+' " ')

this is giving error.

Please Help

try using the char function passing it the numeric ascii code for double quotes in your sql statement: char(39)

|||

Hi bendJoe,

I am using freetext and have to pass in a parameter inside quotes so that freetext treats the phrase as a single word

Could you please give us an example what the @.Search parameter could be? Also, why do you want FreeText function treate your search words as a singe world?

Based on my understanding, we can pass in more than one words into FreeText predicate and those words will be seperated and assigend a weight value automatically. And that's how FreeText function is designed. See the defination in Books Online:

Is a predicate used to search columns containing character-based data types for values that match the meaning and not the exact wording of the words in the search condition. When FREETEXT is used, the full-text query engine internally performs the following actions on thefreetext_string, assigns each term a weight, and then finds the matches.

Separates the string into individual words based on word boundaries (word-breaking).

Generates inflectional forms of the words (stemming).

Identifies a list of expansions or replacements for the terms based on matches in the thesaurus.