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
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