Composite report like in QuickReport

Hi,

i try to make same thing what was easly possible in QuickReport using CompositeReport.

In QuickReport i have 3 (i have more but to simplify discussion) base reports

ReportTitle (contain company info, contact, application version ..)
ReportCustomer (contain customer name, address ....)
ReportProduct (contain product name, short description, ...)

And when i create new Report i use in CompositeReport above reports. i can use any of above reports

e.g.
QRCompositeReport1.Reports.Add(FormDrukTitle.QuickRepPortrait); //Title
QRCompositeReport1.Reports.Add(FormDrukCustomer.QuickRep1); //customer info
QRCompositeReport1.Reports.Add(QuickRep1); // current report of some kind

i can print Title report on every page.


How can i do same in FastReports?

I need to print Header on every page
I need to print Customer on every group

e.g.


Page1
ReportTitle
ReportCustomer
report data for this customer
onother customer
ReportCustomer
report data for this customer
Page2
ReportTitle
continue report data for this customer
onother customer
ReportCustomer
report data for this customer


Is it possible at all in FastReports?
I have tried
Var RequiresBlankPage: Boolean;
  PreviewPagesCount: Integer;
  ms: TMemoryStream;
begin
  FDConnection1.Connected:= true;
  SDSDyrekcja.Active:= false;
  SDSDyrekcja.SQL.Text:= 'SELECT * FROM DYREKCJA D';
  SDSDyrekcja.Open();

  ms:= TMemoryStream.Create;
  try
    frxReportComposite.PrepareReport();

    //frxReportHeader.LoadFromFile('P:\Projekty\Nosniki\FastReport\Nagł??wekCzysteNosniki.fr3', true);
    frxReportHeader.PrepareReport(true);
    ms.Clear;
    frxReportHeader.SaveToStream(ms);
    ms.Position:= 0;
    frxReportComposite.LoadFromStream(ms);
    frxReportComposite.PrepareReport(false);
    frxReportComposite.PreviewPages.CurPage:= frxReportComposite.PreviewPages.CurPage-1;

    //frxReportComposite.PreviewPages.AddFrom(frxReportHeader);

    PreviewPagesCount := frxReportComposite.PreviewPages.Count - 1;
    RequiresBlankPage := (PreviewPagesCount mod 2) <> 0;
    {if RequiresBlankPage then
      frxReport1.PreviewPages.AddEmptyPage (0); }


    frxReport1.PrepareReport();
    ms.Position:= 0;
    frxReport1.SaveToStream(ms);
    ms.Position:= 0;
    frxReportComposite.LoadFromStream(ms);
    frxReportComposite.PrepareReport(false);
    //frxReportComposite.PreviewPages.AddFrom(frxReport1);

    // Delete the Cover Sheet
    frxReportComposite.PreviewPages.DeletePage (0);
    frxReportComposite.ShowPreparedReport;
  finally
    FreeAndNil(ms);
  end;
but header is printed on First page and frxReport1 do not continue on same page only is on the new page


please help

Comments

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.