cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport "page footer"

Former Member
0 Kudos

Hey guys, I've searched the Internet, now Im turning to you with my trouble:

CR 8.5:

- Subreport containing a table with data from dbs

- if more than 1 page - need the table header at the beginning and a some text at the end of each page

- table header is no problem - will just use a group header with a fake formula

- footer with the text is a problem

1) I cant use the generally used solution (for example http://www.tek-tips.com/viewthread.cfm?qid=1445982&page=2) suggesting a conditional section in main report page footer.

Reason: I have certain rules for page edges - 1cm from bottom. If I use that way - it all gets messed up (few mm) even if this section is suppressed.

2) Since I know there can be either 1 or 2 pages, I can try how many tablerows cause a new page and workaround it using this knowledge.

Is there any other way to achieve this other than 2 previously mentioned solutions?

Thanks a lot

Accepted Solutions (0)

Answers (1)

Answers (1)

patrick_genest
Advisor
Advisor
0 Kudos

Hi Martin,

Other than the 2 workarounds you listed, another suggestion to display what would appear like a "Page Footer" in your subreport, it's to use the subreport Page Header technique, and then resize the Group Header section to be almost as large as the paper size, and underlay the Group Header section with the rest of the sections.

To do so:

1. Create a "Fake" Page Header.

1.1 Create a formula called "Page Header" and type:

WhileReadingRecords;

""

1.2 Insert a group on the "Page Header" formula

1.3 In the "Insert Group" window, under the tab "Options"

check the option "Repeat Group Header

On Each Page", then click "OK"

1.4 Move the group to the highest level if you already

have grouped in your subreport.

You can move the order of the groups in the report

or in the "Group Expert", which is located under the

menu "Report"

2. Divide your new group: "Page Header", in two sections

2.1 Select "Section Expert" under the menu "Report"

2.2 In the "Section Expert" window, select the "Group # 1"

and click on the button "Insert"

Now, you have Group Header # 1a and Group Header # 1b.

3. Check the option "Underlay Following Sections" for "Group Header # 1b"

3.1 Still in the "Section Expert", select the "Group Header # 1 b" and check the option "Underlay Following Sections"

4. In the "Design" view of the report, resize the Group Header # 1b, so it is almost as large as the page.

NOTE: Be careful to not resize the section to be larger than the page size otherwise you will get an error message, as it is not possible to underlay something bigger than the size of the page size.

5. Enter the desired text at the bottom of the Group Header # 1 b.

Now, when previewing the report, it will look like you have a subreport "Page Footer".

Hope this help!

Patrick

Former Member
0 Kudos

Hi Patrick, thanks for your answer!

Its a very good idea I didnt know of yet. But there's a problem: 1st page contains some sections at the beginning and the 2nd doesnt. ie the text in group header #2 (our fake page footer) cant be at the same position on both pages.

Because of deadline, I decided to use alternative #2 from my first thread comment. And as it turned out, it's not that difiicult at all and it is possible to use the "section at the end of the page" option, so it looks pretty.

Thank you anyway

Martin

patrick_genest
Advisor
Advisor
0 Kudos

Hi Martin,

I am glad to hear you could acheive the desired output.

By the way, they have few more steps that needs to be done for the suggestion I provided. If you want to try this technique someday, then you will also have to add a counter that will be used to perform a new page after, so the other sections doesn't overlap the "Page Footer". The additional steps are:

6. Create formulas that count the number of sections printed.

An example of the formula will be:


    WhilePrintingRecords;
    NumberVar Counter := Counter + 1;
 

Depending on the size of the section you can add 2, 3 or a

higher values, has the number represent how much space

the section reserved on a page.

7. Insert each formula in the appropriate sections,

8. Create a Conditionnal New Page After on each section that

will create go to the next page if we have reach the number

limit of sections to print on the page. The formula will look

like:


    WhilePrintingRecords;
    NumberVar Counter;
    If Counter >= 18 Then
    (
         Counter := 0;
         True  
    )
    Else
          False
    

The formula above will create a new page if the counter is

greater or equal to 18 and reset the counter to zero for the next page.

The above workaround works well when you have a subreport that have multiple groups and sections.

Another suggestion to create something that look like a page footer when the subreport design of the subreport is very simple, it's to use the counter to count the number of section printed and based on the counter, you can conditionnaly display and print at the bottom of the page a section that contains the "Page Footer" information.

For example, if the subreport only contain one Details section, then you can create "Details - a" and "Details - b" sections

"Details - a" will be to display your data and

"Details - b" will be to display your "Page Footer"

Then in the Detail section you insert a formula like:


WhilePrintingRecords;
NumberVar Counter := Counter + 1;
 

And on the "Details - b" section you conditionnaly suppress it by using a formula like:


 WhilePrintingRecords;
 NumberVar Counter;
 BooleanVar Flag;

 If Counter >= 18 Then
 (
      Counter := 0;
      Flag := False  
 )
 Else
       Flag := True;
 

And finally create a connditional formula that prints at the section at the bottom of the page. This section option is available in the "Section Expert", when you select the "Details - b" section you will see the option "Print at Bottom of Page"

The conditionnal formula will look like:


 WhilePrintingRecords;
 BooleanVar Flag;
 Not(Flag)

The above two workarounds uses a counter to limit the number of sections to be printed on a page, then either perform a new page after or print a section at the bottom of the page.