Wednesday, March 7, 2012

Only show field on last page

Hallo,
i would like to show some fields only on the last page on the report. How can i achieve this?
(The field is in the body area)

King regards,
Christian NiehavesYou can exactly control the report pagination if this is what you after but if the fields are at the end of the report body (below the main report region) they will show last on the report.|||Hallo,
is there any possiblity to get the current page number and the total number of pages in the body area of a report?

King regards
Christian Niehaves|||The only way I know of is to pass the page number to a code-behind variable in the page footer and read it in the report body.|||

I have only rdl file, how to pass the page number to a code-behind variable ? I think i can't to do that via xml.

|||The idea was to create a VB.NET variable in the report properties Code tab. Since PageNumber and TotalPages are available only in the page header/footer, use one of the exression-based properties of the Page Header band to set the variable and then read it from the Textbox in the body section, e.g. =Code._PageNumber (assuming that _PageNumber is the variable).|||

I'm understood it, but i have the report server project generated by wizard, and seems to me that i don't have VB or C# codebehind, only rdl file with xml syntax. How i can place current page number into the body of report?

Sorry for my English.

Thank you.

|||

I attempted to add expressions =ReportItems!TextboxInHeader.Value for field in the body and i've got compiling error:

Error 1 [rsReportItemReference] The Value expression for the textbox ‘textboxInBody’ refers to the report item ‘TextboxInHeader’. Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope.

|||You cannot cross-reference items in different bands. Actually, I appologize for giving a wrong page number hack. Pseudo-events like these (setting a var in one band and reading it in another) were working (but were not supported) in RS 2000. In RS 2005, the expression execution order was changed. The net effect is that when reading the variable in the body section, you won't be able to "see" the changes made by the bands. This effectively means that there is no way that I know of to pass a page number to the body section.|||Thank you.

No comments:

Post a Comment