Composite Report Not Working

Hi,

I am having trouble building a composite report. Instead of a single report with my sub reports what I see is each report flash in the preview window and I end up with only the last report visible. My code looks like:

Query->SQL->LoadFromFile(Sql1File);
Query->Prepare();
Query->Active = true;
MasterReport->LoadFromFile(Report1File, false);
MasterReport->PrepareReport(true);
Query->Active = false;

Query->SQL->LoadFromFile(Sql2File);
Query->Prepare();
Query->Active = true;
MasterReport->LoadFromFile(Report2File, false);
MasterReport->PrepareReport(false);
Query->Active = false;
MasterReport->ShowPreparedReport();


MasterReport->Preview is pointing to a TfrxPreview object.


I am using BCB 2010 and VCL 5.

Any ideas as to what I am doing wrong? Am I missing a setting? Code problems?

Thanks.
Shawn

Comments

  • edited 2:49AM
    swdevlin wrote: »
    Hi,

    I am having trouble building a composite report. Instead of a single report with my sub reports what I see is each report flash in the preview window and I end up with only the last report visible. My code looks like:

    Query->SQL->LoadFromFile(Sql1File);
    Query->Prepare();
    Query->Active = true;
    MasterReport->LoadFromFile(Report1File, false);
    MasterReport->PrepareReport(true);
    Query->Active = false;

    Query->SQL->LoadFromFile(Sql2File);
    Query->Prepare();
    Query->Active = true;
    MasterReport->LoadFromFile(Report2File, false);
    MasterReport->PrepareReport(false);
    Query->Active = false;
    MasterReport->ShowPreparedReport();


    MasterReport->Preview is pointing to a TfrxPreview object.


    I am using BCB 2010 and VCL 5.

    Any ideas as to what I am doing wrong? Am I missing a setting? Code problems?

    Thanks.
    Shawn

    I just came across what looks like the same in v4. It seems a problem with the preview not being passed the composite report properly.
    When I preview the report with the default previewer it is fine but if I attach the preview component it only shows the last report in the batch.

    Have you tried the default preview?

    Regards
  • edited 2:49AM
    Oops sorry about the overquote
  • gpigpi
    edited 2:49AM
    Try
    Query->SQL->LoadFromFile(Sql1File);
    Query->Prepare();
    Query->Active = true;
    MasterReport->Preview = nil;
    MasterReport->LoadFromFile(Report1File, false);
    MasterReport->PrepareReport(true);
    Query->Active = false;
    
    Query->SQL->LoadFromFile(Sql2File);
    Query->Prepare();
    Query->Active = true;
    MasterReport->LoadFromFile(Report2File, false);
    MasterReport->PrepareReport(false);
    MasterReport->Preview = frxPreview1;
    Query->Active = false;
    MasterReport->ShowPreparedReport();
    

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.