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

Empty page instead of report

edited March 2004 in Subreports
I have this report (http://www.entrysoft.com/report.jpg) with the
subreport selected. The subreports doesn't print but it gives an empty
page. I checked the recordcount of the connected dataset and it has 20
records in it (so it should generate 20 pages). Instead of the 20
pages I get 1 empty page after the main report.
This however doesn't always happen, when the main report doesn't take
up much space then the subreports do print (this could be coincidence).
How should I fix this?

--
Thanks in advance,

Stijn Verrept.

Comments

  • edited March 2004
    Nard Moseley (Digital Metaphors) wrote:


    Thanks for your reply.
    Well what I need is the following:

    I have PEOPLE and every PERSON belongs to a department.
    I have INVOICES of these people.

    Now I need a report which is grouped by department and on the first
    page lists all the persons belonging to that department. After this
    all the invoices of those persons should appear. Then the next
    department...

    Now I have set it up like this: report1 which is connected to PEOPLE
    database and grouped on DEPARTMENT. In the details all the people get
    listed. In the group footer I have the subreport which has the
    INVOICES.

    How do you suggest I rearrange it so it would work?

    I'm using RB6.03. Is there any specific reason why I need to update?
    It has all the features I need for this project.

    --
    Thanks in advance,

    Stijn Verrept.
  • edited March 2004

    Try to model the report in a different manner, so that you do not have a
    Section style subreport in the group footer.

    Section subreports are designed to hook multiple reports together. They are
    best utilized when placed in the summary band of a parent report or create a
    main report with no header or footer and then place several sections in the
    detail band.

    Check the Help | About box of the report designer to determine the exact
    version that you are using. If you are not using RB 7.03, contact
    info@digital-metaphors.com and inquire about updating.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2004

    1. You should update because you want to get the hundreds of fixes and
    internal improvements that have been made. And you want to continue to
    receive support like I am providing here. It is likely that your report will
    work correctly in RB 7.03. You can download a trial version if you would
    like to give it a try.

    2. An alternative way to model this report might be as follows:

    Data
    ------
    Department
    People
    Invoices

    Main query result set that contains a list of departments. (You may have a
    department table you can use for this, otherwise perform a Select Distinct
    on the people table, but only select the department info.

    Second query result that contains a list of people - Link this query to
    Department query.

    Third query of Invoice data, linked to department.


    Layout
    -------

    Main report connected to Department.
    DetailBand
    Child Subreport1connected to People
    SummaryBand
    Section Subreport2


    In the above the main report will print one detail band for each Department.
    The childreport will print the people followed by the second child to print
    the invoices.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2004
    Nard Moseley (Digital Metaphors) wrote:


    Thanks for the reply Nard, I made the changes you suggested but am
    still having the same problems.
    Could it be that for the INVOICES i use a stored procedure and I open
    it on the ppTitleBand2BeforeGenerate (title band of the persons
    subreport)?

    The code goes like this:

    DM.GetQuarterInvoicesTotals.Close;
    DM.GetQuarterInvoicesTotals.ParamByName('BeginDate').AsDateTime :=
    EncodeDate(Year, RizivMonth, 1);
    DM.GetQuarterInvoicesTotals.ParamByName('INID').AsInteger :=
    DM.PersonsIN_ID.AsInteger;
    DM.GetQuarterInvoicesTotals.Open;

    I checked to see if it has records and it does have records in it. The
    People subreport is followed by a white page. I set a break on the
    ppDetailBandBeforeGenerate of the invoice subreport but it never gets
    triggered.


    --
    Kind regards,

    Stijn Verrept.
  • edited March 2004

    You should not open/close or otherwise manipulate any of the datasets while
    the report is generating. This will cause the report engine to get lost.

    If you need to establish a master/detail linking relationship you should do
    it as describe in the article below. If for some reason you still need to
    manually manage a master/detail relationship, you can use the master
    DataPipeline.OnRecordPositionChange event to manage the detail query.


    ------------------------------------------------------
    Tech Tip: Linking SQL Queries for Master/Detail Data
    ------------------------------------------------------

    The following example shows two options for linking SQL queries to create a
    master/detail relationship.

    In this example, we are using Delphi's DBDemos data to create a
    Customer/Order relationship. Thus we wish to link the Orders detail to the
    Customer master.

    I. Delphi Query Linking
    ------------------------

    a. Set the detail TQuery.DataSource property to point to the master
    query's TDataSource component.

    b. In the SQL "Where" clause for the detail query use a ':' followed by
    the linking field name from the master:

    example
    select *
    from orders
    where orders.CustNo = :CustNo

    Now each time the master record position changes, the detail query will
    automatically be refreshed with the correct result set.


    II. RB DataPipeline Linking
    -----------------------------

    a. Set the detail DataPipeline.MasterDataPipeline to point to the master
    DataPipeline.

    b. Use the detail DataPipeline.MasterFieldLinks property to define the
    linking relationship

    c. In the SQL for the detail, retrieve all records and sort them by the
    linking master field:

    select *
    from Orders
    order by CustNo


    Notes:

    1. Using RB DataPipeline, each query is executed only a single time - thus
    performance is much faster.

    2. RB Professional and Enterprise Editions include a visual Data environment
    for creating SQL queries, defining linking relationships, and creating
    Ask-At-Runtime parameters. Using the RB tools you could create the above
    linked queries in about 10 seconds.


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com




    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2004
    Nard Moseley (Digital Metaphors) wrote:



    Works now, thanks!

    --
    Kind regards,

    Stijn Verrept.
This discussion has been closed.