How to Show Report?

Top  Previous  Next

 

Put the StiWebViewerFx component on a web page. Then you need to use the following code to show a report:

 

C#

 

StiReport report = new StiReport();

report.Load("report.mrt");

StiWebViewerFx1.Report = report;

 

 

VB

 

Dim Report As StiReport = New StiReport()

Report.Load("report.mrt")

StiWebViewerFx1.Report = Report

 

 

If the report was not rendered before showing, then the WebViewerFx component renders it automatically.

 

 

Loading a report after loading the viewer is done using the OnGetReport event. After subscription to this event, it will occur each time when the viewer needs a report. In other words, after loading WebViewerFx requests the report from the server and, if the subscription to the OnGetReport event is done, then, in this event, the report can be assigned to the designer. Below is a code example, using the OnGetReport event:

 

 

protected void StiWebViewerFx1_GetReport(object sender, StiWebViewerFx.StiOnGetReportEventArgs e)

  {

      StiReport report = new StiReport();

      report.Load("D:\\SimpleList.mrt");

       e.Report = report;

  }

 

 

If the report has not been rendered before being displayed, the WebViewerFx component renders it automatically.

 

If it is required to show WebViewerFx to the entire browser window, you can use the following method:

 

 

StiReport report = new StiReport();

report.Load("report.mrt");

StiWebViewerFx1.View(report);

 

 

In this case, in the entire region in the current browser window a viewer will be displayed. All other items are located on the .aspx page will not be displayed.

 

 

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)