how to use WebReport component
serifelsen
Unknown
I need to show my report in the web. So i used webReport component
If i write
webReport.ReportFile = "test.frx";
it works fine. But i have to set parameter before preview. So i tried
Report fReport = new Report();
fReport.Load("test.frx");
fReport.SetParameterValue("UserId", "test");
webReport.Report = fReport;
In this case i see nothing in the screen.
Please help me. Thanks in advance.
If i write
webReport.ReportFile = "test.frx";
it works fine. But i have to set parameter before preview. So i tried
Report fReport = new Report();
fReport.Load("test.frx");
fReport.SetParameterValue("UserId", "test");
webReport.Report = fReport;
In this case i see nothing in the screen.
Please help me. Thanks in advance.
Comments
Re-read the documentation:
Passing a value to a report parameter
To pass a value to the report parameter, use the SetParameterValue method of the Report
object. This method was described in details in the "Working with Windows.Forms" chapter.
To use this method in ASP.NET, you need to create the event handler for the StartReport
event of the WebReport component. The report can be accessed through the WebReport.
Report property:
webReport1.Report.SetParameterValue("MyParam", 10);
You MUST use a StartReport Event to set the parameters in the web viewer.
When I did that it works fine.
HTH,
Bryan
using FastReport.Web;
using FastReport;
Thank you
You should add FastReport.dll to your references list.