Click to See Complete Forum and Search --> : load a report with a parameter...


jasie24
May 3rd, 2006, 06:43 AM
I have a parameter on my report.

the report show someting in the load event.

the code in Load_ event is something like this:
{
m_strCode=txtCode.Text;
repDoc.SetParameterValue("stringP",m_strCode);
repDoc.SetDataSource(dsCodes1);
repViewer.ReportSource-repDoc;
repViewer.RefreshReport();
}

also i reload the Data when i push the button,so the code is the same:

Button1_click(....)
{
m_strCode=txtCode.Text;
repDoc.SetParameterValue("stringP",m_strCode);
repDoc.SetDataSource(dsCodes1);
repViewer.ReportSource=repDoc;
repViewer.RefreshReport();
}
also there is 2 lines in the repViewer_ReportRefresh(.....)
{
repDoc.SetParameterValue("stringP",m_strCode);
repViewer.ReportSource=repDoc;
}


The problem is that,if i put this code in Load_ event too as shown above, because i want to show the data with that parameter on report, from the start, it still ask me to gave to the report the parameter.WHY?

Thanks

Madhi
May 27th, 2006, 09:24 AM
You need to supply the parameter value if any. Otherwise you have to suppress the popup by setting enable popup property to false

jasie24
June 8th, 2006, 02:41 AM
I have supplied the value, if you follow closely the code, at the beginning of the message, i wrote, the LOAD event, where i give the parameter value.so even if i suply value, still ask me,for value.this was the problem! why?

Madhi
June 8th, 2006, 06:00 AM
If you supply parameter values, you wont be prompted to give them. Open the report and do verify database