2

I am creating client invoice statements. Clients sometimes have a large number of invoices. The report has two sections. The first is the header, with company and client address info, etc. The second part is a list containing the invoices.

If a client has a large number of invoices, a second page, which is a copy of the first, is created. Since it is a copy, it has all of the header information, which I don't want. Also, at the end of page 1, I want to add some text like "invoices continue next page" or similar.

How do I tell the list to break at the bottom of the page and continue on a second page?

Filburt
  • 17,626
  • 12
  • 64
  • 115
jabs
  • 1,694
  • 4
  • 19
  • 36
  • 1
    Using the running-count ([Invoice]) function, I know that page 1 fits 15 lines, so line 16 needs to start page 2. – jabs Feb 11 '15 at 16:16
  • 1
    Do you mean the list header is the part which is repeating on every page? – Andrew Feb 11 '15 at 17:32
  • Yes. I have a table with text values pulled from the data (client name, remit info, etc.). I don't want this large block on the next page, if the list is more than 15 rows. – jabs Feb 11 '15 at 17:41

2 Answers2

2

This can be done using Page Set objects. Here are the steps:

  1. Create the page with the client table (called Page1 going forward)
  2. Create another page with the invoice list (called Page2 going forward)
  3. Click on 'Report Pages' within 'Page Explorer'
  4. Drag over a 'Page Set' object (called 'Page Set1' going forward)
  5. Set the 'Query' property of 'Page Set1' to the query you are using
  6. Click on the 'Grouping & Sorting' property of 'Page Set1'
  7. Drag over the data item that identifies a unique clients (e.g. Client Key, Client Code etc.) and drop it in the 'Groups' folder and click OK
  8. Drag 'Page1' and drop it in the 'Detail Pages' folder under the page set
  9. Drag over a new 'Page Set' object and drop it in the 'Detail Pages' folder under 'Page Set1' (called 'Page Set2' going forward)
  10. Set the 'Query' property of 'Page Set2' to the query you are using
  11. Click on the ellipses button on the 'Master Detail Relationships' property of 'Page Set2'
  12. In the dialog that appears click on the 'New Link' button
  13. Select the column in both lists that represents the unique client data item and click OK
  14. Drag 'Page2' and drop it in the 'Detail Pages' folder under 'Page Set2'

Your 'Report Pages' objects should end up looking something like this:

Page Set Hierarchy

The technique creates a page hierarchy that effectively interleaves pages at the client level with the detail pages at the invoice level which match the associated preceding client. Since the higher and lower level pages are rendered independently the client details are not repeated for each invoice page.

Johnsonium
  • 2,005
  • 1
  • 13
  • 15
  • Thanks for your reply, and apologies for not getting back sooner. I tried this, but the entirety of the invoices is on page 2. I want the invoice list to start on page 1, break at the bottom, and start again on page 2 (without the client header info or with something else like "invoices con't."). – jabs Mar 10 '15 at 17:01
  • When you said that the second page "..has all of the header information.." do you mean the list header or the page header? – Johnsonium Mar 10 '15 at 19:06
  • Page Header - so the client name, address, etc., and my company name repeat when the list is on the same page as the header. When I use the method you described, the list is by itself on page 2. I want the list to break at the page break and pick up on the next page - ideally with additional page 2 wording. +1 for the help. Thanks! – jabs Mar 10 '15 at 19:56
  • Now that I understand your requirements better I added a new answer that seems to work in my testing. – Johnsonium Mar 10 '15 at 22:12
2

To have a header only show on the first page of a multi-page report you have to employ a novel technique to trick Cognos into not repeating your header.

Here are the steps:

  1. Turn off the actual page header
  2. Add a new list above your existing list
  3. Select the list object and change the 'Column Titles' list property to 'Hide'
  4. Set the Width property in Size & Overlflow to 100% for the list object
  5. Go into the new query created which is tied to the new list
  6. Drag over a Data Item object
  7. In the new data item expression enter your header text surrounded by quotes (e.g. 'Bob Smith').
  8. Repeat step 7 for all the independent pieces of data header you want to display (e.g. 'ABC Company')
  9. Go back to the report page
  10. Drag over one of your new data item and drop it on your new list
  11. Select the list object and add a header. This can be done through the Headers & Footers toolbar button or the menu item Structures>Headers & Footers>Create Header
  12. Unlock the report
  13. Delete the default text item in the page header
  14. Optional: Add a table of desired size to the page header for organization
  15. Drag over all the data items created in steps 7 & 8 and arrange and style them the way you want them displayed
  16. Select a cell in the main body of the list. Make sure that the property sheet type is 'List Column Body'
  17. Clear the Classes property in the property sheet
  18. Click on the new page header. Makes sure that the property sheet type is List Cell
  19. Clear the Classes property in the property sheet
  20. Remove the data item you added in step 10 (Cognos won't allow you to add headers to lists without columns)

After following the steps you should be able to run the report with the header only showing at the beginning of the list.

Notes:

The technique works because Cognos doesn't repeat the data containers that paginate, which are lists and crosstabs. For contrast, a singleton will be repeated on each page. By adding a new list and putting our header text in it and stripping away the normal list styling we can trick Cognos into not repeating the information on each page.

You might be able to avoid having to put your text in data items within the query. You could try adding text items to the list header instead. I didn't get a chance to test this as my system crashed taking my test report with it, but it should work.

Johnsonium
  • 2,005
  • 1
  • 13
  • 15
  • Thanks for the reply. A couple of things. I mistakingly said I was using headers. I am using a table with data item expressions from the query (like client name, address, etc.). Then, there is some text. It finishes with a list that displays the actual invoices. The list will break at the bottom, then page 2 includes repeated client info and the remaining list items. Thanks again for your time. – jabs Mar 18 '15 at 15:50
  • 1
    I think the same concept will apply. You can put your table in the list header of the new list. The main concept is to employ a data container that Cognos won't repeat on every page. That's a list or a crosstab. What you put in that container shouldn't be repeated every page. – Johnsonium Mar 18 '15 at 18:22