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

Page number in sequence

edited March 2007 in General
HI,
I must print two reports, the first one is of 10 pages and the second one of
15.
The numbering of the second report should continue the numbering of the
first report in sequence. How should I do this task? Please give me some
suggestions.
Thank you for your help and time.
Sincerely.
Gianmario

Comments

  • edited March 2007
    Hi Gianmario,

    Try combining both reports into a single report containing two section style
    subreports.

    First create an empty report with only a detail band. Next add two
    subreports to the detail band and set their type to Section. Load the
    templates of each report into each subreport so the reports will print one
    after the other.

    Be sure the ResetPageNo property of the subreports are set to False.

    --
    Regards,

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

    "Assistenza Informatica (Opera don Guanella)"
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007
    Hello Nico,
    Thank you for your reply.
    Your solution is OK if the reports will be printed at the same time through
    only one computer.
    But the two reports need to be printed by two different people with two
    different computers. The person who will print the second report needs to
    follow the page numerical sequence of the first writer.
    Are you able top give me another solution?
    Greetings,

    Gianmario

  • edited March 2007
    Hi Gianmario,

    In this case you will want to leave the ResetPageNo of each subreport as
    True. This will keep the original page numbering from the original reports.

    --
    Regards,

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

    "Assistenza Informatica (Opera don Guanella)"
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007
    Hello Nico,
    I am sorry for not explaining correctly my problem. Your answers, though
    applicable to other situations, didn't solve my present problem.
    I spoke to you of two different reports, but unfortunately the reports to be
    printed are many more and all of them need to have a sequential page
    numbering. Also the reports will be printed at different times. All of them
    need to have the same templates.
    This is my question; am I able to manually assign the first page number
    before printing a report in the same way we do with word processing?
    Thank you very much for your help.
    Sincerely,
    Gianmario.

  • edited March 2007
    Hi Gianmario,

    I'm sorry but I still do not understand exactly what you are trying to
    accomplish. When you say "sequential page numbering" do you mean you would
    like the page numbering to continue from one report to the next?

    Report 1
    Page 1
    Page 2
    Page 3

    Report 2
    Page 4
    Page 5
    Page 6

    Report 3
    Page 7
    ... etc.

    Or would you like each report to start at Page 1?

    If these reports will be printed at different times then why is there a need
    to combine them into a single report at all?

    --
    Regards,

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

    "Assistenza Informatica (Opera don Guanella)"
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007
    HI NICO!

    I would like the page numbering to continue from the first report to the
    next as you see in your example

    Report 1
    Page 1
    Page 2
    Page 3

    Report 2
    Page 4
    Page 5
    Page 6

    Report 3
    Page 7
    ... etc.

    After printing, they must be binds in a book.

    Thanks. Regards.
    Gianmario


  • edited March 2007
    Hi Gianmario,

    In this case you will want to combine all you reports into a single report
    using Section style subreports. These reports can be created dynamically
    and report templates can be loaded into them manually in code based on which
    reports your customers would like to print. Then making sure the
    ResetPageNo property is set to False on each newly created subreport will
    ensure that the page number is not reset for each subreport. Below is an
    article on how to create subreports in code.


    -------------------------------------------------
    TECH TIP: Creating a SubReport in Code
    -------------------------------------------------

    A subreport is comprised of two objects:

    1. SubReport control
    The subreport control is added to a band of the
    'parent' report. It has properties such as
    ShiftRelativeTo, PrintBehavior, etc.
    In the Report Designer, the subreport is drawn
    as a rectangle.


    2. ChildReport
    The child report is a descendant of CustomReport and has
    most of the same properties as a standard Report.
    The child report has a separate layout workspace in the report
    designer that is accessible by selecting the tabs at the bottom
    of the designer.




    When dynamically creating a subreport in code you need to create the
    subreport and the underlying child report. The subreport.Report property can
    then be used to access the child report.

    This is demonstrated in the following example:




    var
    lSubReport: TppSubReport;
    lReport: TppChildReport;
    lLabel: TppLabel;
    lDBText: TppDBText;


    begin

    lSubReport := TppSubReport.Create(Self);

    {add to the main report's detail band}
    lSubReport.Band := ppReport1.DetailBand;

    {create the child report (parameters: main report) }
    lSubReport.CreateReport(ppReport1);

    lReport := TppChildReport(lSubReport.Report);

    {assign a datapipeline}
    lReport.DataPipeline := plCustomers;

    {create the default set of bands}
    lReport.CreateDefaultBands;

    lLabel := TppLabel.Create(Self);
    lLabel.Band := lReport.TitleBand;
    lLabel.Caption := 'Customers';

    lLabel.Font.Name := 'Times New Roman';
    lLabel.Font.Size := 24;

    lDBText := TppDBText.Create(Self);
    lDBText.Band := lReport.DetailBand;
    lDBText.DataPipeline := plCustomers;
    lDBText.DataField := 'CustNo';

    lDBText.Color := clYellow;
    lDBText.Font.Name := 'Times New Roman';
    lDBText.Font.Size := 12;



    end;


    --
    Regards,

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

    "Assistenza Informatica (Opera don Guanella)"
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007
    Thanks!
    Gianmario

This discussion has been closed.