WebReport loading multiple reports

edited 8:46AM in FastReport .NET
I need to load frx file and set datasource using codebehind C#

In the sample below I am loading a frx Report and registering data to view report using WebReport Viewer:

.ASPX
- <cc1:WebReport ID="WebReport1" runat="server" Width="100%" Height="900px" OnStartReport="WebReport1_StartReport" />


.CS
//Set frx report
WebReport1.Report.Load(this.Server.MapPath("~/Reports/FastReport/rptAlunosDataNascimento.frx"));

//Get Data
//IList dataSource = get data here....

//RegisterData and view report
WebReport1.Report.RegisterData(dataSource, "ObjectDataSourceReport");

I put this code in the PageLoad and then in the StartReport.
Works fine when I am viewing report for the first time.
The problem occurs when I try to view the same report again. The data is not refreshing to reflect changes in the database or if dataSource returns different data.

What am I doing wrong?

Thanks in advance!





Comments

  • edited 8:46AM
    this code from my old webform project, hope this helps
    WebReport1.report.Load(Server.MapPath("~/Reports/FastReport/rptAlunosDataNascimento.frx"))
    WebReport1.Report.Report.RegisterData(dataSource, "ObjectDataSourceReport")
    WebReport1.Report.Report.GetDataSource("ObjectDataSourceReport").Enabled = True
    WebReport1.Prepare()
    

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.