how to use WebReport component

serifelsenserifelsen Unknown
edited February 2011 in FastReport .NET
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.

Comments

  • pinbotpinbot Texas
    edited February 2011
    I tried that too and it won't work.

    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
  • edited July 2012
    Hi Bryan, i tried to use this method, but it said missing assembly reference. Is it need specific import dll? currently i only using:
    using FastReport.Web;
    using FastReport;

    Thank you

    pinbot wrote: »
    I tried that too and it won't work.

    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
  • edited 9:02PM
    Hello,

    You should add FastReport.dll to your references list.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.