WebReport loading multiple reports

edited 11:40PM 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 11:40PM
    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