WebReport- only shows last report of a combined report

Hi Suppport,

If I use report merging/appending as demonstrated in your manual:
report1.Load("report1.frx");
report1.Prepare();
report1.Load("report2.frx");
report1.Prepare(true);

Then only the last report will be shown in the WebReport. I have double checked that the report is properly generated- I have 5 pages (5 merged reports) in the saved report.fpx, but only the last report is shown in WebReport.


Kind Regards,

Keith Blows

Comments

  • edited 4:04PM
    Hello,

    Please show the full code how do you pass this report to WebReport.
  • edited 4:04PM
    AlexTZ wrote: »
    Hello,

    Please show the full code how do you pass this report to WebReport.
    Report repMain = new Report(); 
    string reportPath = Server.MapPath("~/App_Data");
    
    bool appendReport = false;
    
    using (SqlCommand cmd = new SqlCommand("SELECT [LUUniqueID] FROM [tWebUserTAGroupItems] " +
    		"WHERE [LUUserTAGroupDefID] = @LUUserTAGroupDefID", conn))
    {
    		cmd.Parameters.AddWithValue("@LUUserTAGroupDefID", groupID);
    
    		SqlDataReader rdr = cmd.ExecuteReader();
                            
    		{
    			DataTable dataAttendance = UsefulRoutines.GetBasicAttendance(
    					0, rdr.GetInt32(0), startDate, endDate);
    
    			if (dataAttendance.Rows.Count > 0)
    			{
    					repMain.Load(reportPath + "/GroupTA.frx");
    
    					// Set report parameters
    					repMain.SetParameterValue("ParamUniqueID", rdr.GetInt32(0)); // This will load appropriate header data...
    					repMain.SetParameterValue("ParamStartDT", startDate);
    					repMain.SetParameterValue("ParamEndDT", endDate);
    
    					// Set data
    					repMain.RegisterData(dataAttendance, "Data");
    
    					// Data band must be bound to correct data source!!
    					((DataBand)repMain.FindObject("TAData")).DataSource = repMain.GetDataSource("Data"); ;
    
    					repMain.Prepare(appendReport);
    					appendReport = true;
    
    					// Limit size of report
    					if (repMain.PreparedPages.Count > 500)
    					{
    							break;
    					}
    			}
    	}
    	WebReport1.Report = repMain;
    
  • edited September 2009
    Do this in the WebReport.StartReport event, and set the WebReport.ReportDone flag just before you leave the event handler:

    WebReport1_Load(...)
    {
    ...
    WebReport1.Report = repMain;
    WebReport1.ReportDone = true;
    }

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.