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

Cover Page Revisited

edited May 2003 in General
In a message dated January 4th, 2001, Jim Bennett described a way of
handling cover pages which only print if the device is the printer and not
the screen. I have already created a cover page "Report" which is a single
page. Is there a way I can call this report object to return the page as a
TppPage object and have it print in another report as the cover page? Does
that even make sense? :-)

Mark Greenhaw
OneDomain, Inc.
xmark@onedomain.comx
(remove the x's to reply via email)

Comments

  • edited May 2003
    One way to do this would be to save your one page report to a template file
    (rtm). Then load the template into a subreport in the titleband of both
    reports. Also, check out the dynamic subreport loading demo in the
    RBuilder\Demos\EndUser\DynamicSubreportLoading folder of the RBuilder
    installation for more examples of taking this a step further.

    Or, since you are wanting to deal with a page object, then it may make more
    sense to create a page object and its draw commands in code. This way you
    can call it for more than one report. Here is an example of adding a page
    object to a report at the beginning for a title page. Basically convert your
    title report to be created dynamically with draw commands.

    http://www.digital-metaphors.com/tips/AddPageObject.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    Jim,

    Here is my dilemma (and I am trying to simplify distribution i.e. no
    template files)....

    I need a "stock" cover page. Three labels, two memo components in the
    middle, two lines, two images, and one system variable. I need one image to
    be imbedded and one image to be dynamic. I need to pass the contents of the
    fields as seen in the procedure description below.

    procedure CreateCoverPage (var CPage: TppPage; AGraphic: string; MList:
    TStrings; BList: TStrings;
    Landscape: boolean = TRUE; TopFooter: string = ? MyCompany, Inc
    2003';
    BottomFooter: string = 'Authored by me'; ATitle: string = 'Report
    Title');

    The code to do this is housed in it's own unit so it can be used for all
    reports. All of the reports are contained in their own self-instantiating
    datamodules and are passed the "prepared" cover page (TppPage). Although
    the report is landscape, the cover page is printing as portrait and all of
    the drawn components' positions are really funky. I use inches as my
    measurement for the report but when the cover page is created I must use
    Thousands of MM. Could this be the reason for the funky positioning? Also,
    when creating the cover page I can't assign the Autosize value or load Image
    contents.

    Any ideas would be greatly appreciated.

    Mark Greenhaw
    OneDomain, Inc.
    xmark@onedomain.comx
    (remove the x's to reply via email)




  • edited May 2003
    I see. You could use the title band of every report but that duplicates the
    contents in every report. Dynamic subreport loading is the preferred way to
    do this. However, you don't want templates. Template are the way to go on
    this, but if you want to do it another way, then that is cool too.

    I think you will want an approach where you print the title page report in
    memory before you print one of the other reports. For example, create a
    TppDevice and hook it up to the title report. Then print that. Now you can
    pull the page from its cache. This will allow you to configure the title
    page for every report so you can load a different image is you want. Now all
    you have to do is stickthis page object at the beginning of the other report
    and send that to the devices as shown in part by the prvious demo which
    created the page object. Instead of creating it by hand, you let RB create
    it. Adding it at the beginning of another report is the same by sending it
    to the printer first.

    Here is the example of using a TppDevice and Report.CachePages to get the
    pages in memory and send them to the printer device manually:
    http://www.digital-metaphors.com/tips/PrintReportBackwards.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.