Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

TppPage.AddDrawCommand: Cannot add more than one draw outline command per page.

edited October 2010 in General
I added a Cover Page subreport to the TitleBand and now I am getting
this message. Any ideas?

I only get the error after I do something in print preview it seems. If
I click print upon entering print preview it seems to print fine but if
I change to a different page or print another copy it happens. If I
close the error dialog and click Print again, it prints just fine.

I have not added any DrawCommand code just added the sub report for the
cover page.

Mark Greenhaw
One Domain, Inc.

Comments

  • edited October 2010
    Hi Mark,

    Which version of ReportBuilder are you using? What type of subreport did
    you add to the title? Are you doing this in code or at design time?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2010
    I created a report containing the Cover Page.

    Added a sub report to the TitleBand of one of my other reports and named
    it ppsrCoverPage.

    Added a variable to the Private variables called CoverPage and make it
    boolean

    Add the following code to the main procedure on the report form before
    the call to rbMain.Print. ...

    // Create cover page
    CoverPage := False;
    if dmCvHeaderInfo.CoverPageRTF <> '' then
    begin
    ppTitleBand1.Visible := True;
    ppsrCoverPage.Visible := True;
    frmRbCoverPage := TfrmRbCoverPage.Create (nil);
    CoverPage := True;
    end
    else
    begin
    ppTitleBand1.Visible := False;
    ppFooterBand1.PrintOnFirstPage := True;
    end;
    // end cover page creation

    Add this to rbMainBeforePrint and modify accordingly

    if CoverPage then
    begin
    ppsrCoverPage.SetReportProperty(frmRbCoverPage.rbMain);
    SetupCoverPage(rbMain.PrinterSetup.Orientation,
    rbMain.PrinterSetup.MarginTop,
    rbMainNHR.PrinterSetup.MarginBottom,
    rbMain.PrinterSetup.MarginLeft, rbMain.PrinterSetup.MarginRight);
    end;


    Add this section to the FormDestroy event for the calling form...

    if CoverPage and (frmRbCoverPage <> nil) then
    begin
    ppsrCoverPage.SetReportProperty(nil);
    FreeAndNil(frmRbCoverPage);
    end;



    Could it be because both reports called the actual report component
    "rbMain"?



  • edited October 2010
    The fact that both report components were named rbMain had nothing to do
    with it. I changed the name of the one on the CoverPage report and still
    get the same error.

  • edited October 2010
    Hi Mark,

    Which version of ReportBuilder are you using? What type of Subreport are
    you using in the title?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.