Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    4

    Exclamation Unanswered: Subreport in Page Footer

    Hi all,

    I have a report (CR 10) with structure like this:

    Page Header --- including a TextObject
    Detail --- showing main report data
    Page Footer 1a --- a subreport inserted here, set to new page before
    Page Footer 1b --- PageNumber

    I want the text object in page header to show 'Main' on every page of main report or show 'Subreport' when the page footer 1a comes out (since the subreport is inserted in this section).

    How can I do it?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    quote: I want the text object in page header to show 'Main' on every page of main report or show 'Subreport' when the page footer 1a comes out (since the subreport is inserted in this section).

    I'm not sure if you mean, 'show subreport' when the user drills down, or if your subreport prints on a new page. It sounds like you want some sort of switch where either the main is on, and the sub is off, or vice-versa.

    If you want to show or hide a text object, one way to achieve that is to use the suppress option of the object(s) in question. To do that you right-click on the object and choose Format; now you click the formula button next to the Suppress tick box and in the code window you would write something like this:

    // suppress the main report page header object if the subreport is showing.
    // note: this code is to be inserted into the text object in the main report
    // page header.

    if isnull([subreportname].[field]) // there are no values to return in the field
    // so the subreport must be blank
    then true // suppress this object
    else false // don't suppress this object

    Hopefully you can use this sort of logic to solve your problem but like I say, I'm not quite clear on your objectives.


    Regards - Andy

  3. #3
    Join Date
    Nov 2004
    Posts
    4
    Thanks Andy!! I solved the problem.

    Yeah I meant I wanted to show a message on every page of subreport and another message on every page of main report.

    Thank you for your reply.

  4. #4
    Join Date
    Nov 2004
    Posts
    4
    What I did is I placed a formula field named detailPage in detail section and another formula field named footerPage in page footer section.

    // formula field named detailPage
    shared stringvar flag;
    flag := 0;

    // formula field named footerPage
    shared stringvar flag;
    flag := 1;

    //formula field for the text object placed in page header
    if flag = 0 then
    "Summary Part"
    else
    "Detail Part"

    Suppress formula fields detailPage and footerPage.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •