Headers,Footers and data

  • You cannot place data items in headers or footers - only global items such as report name and page number.

    a) is there any way around this?  My current report writer does this and its an often-used feature.  Eg putting the grouped item's name in the footer.

    b) are there any plans to re-vamp the product in SQL Server 2005 ?

  • I dont know about 2005 but we ended up moving the entire header section into the body part. That is the only work around IMHO.

    ******************
    Dinakar Nethi
    Life is short. Enjoy it.
    ******************

  • In the case of the grouped item's name, can you put a textbox in the footer and then have it equal to the textbox in the body?

     

    --------------------
    Colt 45 - the original point and click interface

  • Go to Report|Report Properties.  Put code similar to this into the Code tab (for each field you plan on using in the header, add a global variable and a function to return it and/or a parameter).  Sample:

    Public Shared reportTitle As String

    Public Shared reportName As String

     

    Public Shared Function StoreHeaderInfo( title As String, name As String) As String

           reportTitle = title

           reportName = name

           ' we need the assignment statement below, because method must return something

           ' otherwise, we can't use it in a table cell or textbox

           StoreHeaderInfo = ""

    End Function

     

    Then, in the body of the report, add in an invisible textbox that has an expression similar to this:

    =Code.StoreHeaderInfo( Fields!ReportTitle.Value, Fields!ReportName.Value )

     

    Finally, in the header, put in a text box that is set to Code.<Global Variable Name>, for example:

    =code.ReportTitle

  • parker if this works (& i hope it ll work however i didnt check it out yet) its very gr8 the idea u ve come up with is very good i appriciate it wish u good luck in the future

    take care bye

     

  • Didn't work.

    I had a global variable populated with code called by a text box in the data region.  It populated "Record x" in the variable  and a call to that variable was placed in a text box in the header .   The printed like this....

    grouped data region 1 - Record 1

    grouped data region 1 - Record 2

    grouped data region 1 - Record 3

    ....

    grouped data region 1 - Record 10

    I would expect that if there was a page break after record 2 then the header would display the variable text as "record 2" at the top of the next page, like so....

    grouped data region 1 - Record 1

    grouped data region 1 - Record 2

    <page break>

    Header - "Record 2"

    grouped data region 1 - Record 3

    ...etc.

    Actual result?

    grouped data region 1 - Record 1

    grouped data region 1 - Record 2

    <page break>

    Header - "Record 10"

    grouped data region 1 - Record 3

    grouped data region 1 - Record 4

    <page break>

    Header - "Record 10"

    ....

    grouped data region 1 - Record 10

     

    So apparently, headers and footers are rendered last .  This makes sense if it needs to render the body first then examine the export extension selected to see if it even supports pages and page breaks (eg pDF)  or not (eg excel ) before it goes and creates headers and footers.    I confess I am unaware yet what happens to header and footers if you select text file or excel as the export extansion.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply