Showing posts with label header. Show all posts
Showing posts with label header. Show all posts

Friday, March 9, 2012

Possible to reference the value of a textbox in page header or footer?

Is it possible to reference the value of a textbox in a report page header
or footer? I've tried to create a textbox in my report page footer, and make
it show the PageNumber. My textbox is called txtPageNum.
In my report body, I've created another textbox. I've tried to set this
textbox's value to =ReportItems!txtPageNum.value, but that didn't work out.
This is the error message:
"The value expression for the textbox 'textbox2' refers to the report item
'txtPageNum'. Report item expressions can only refer to other report items
within the same grouping scope or a containing grouping scope."
So, is it even possible to reference it, or should I just give up on the
whole idea?
Kaisa M. LindahlSorry, meant that to be a post. Yes, in theory you can reference a
textbox field from a Header or Footer. However, for page numbers, I'd
reference the Report Services global variables. There are two of them
that apply here.
For example:
="Page " & Globals.PageNumber & " of " & Globals.TotalPages
This will show "Page 1 of 2", etc.
MikeN|||Funny, as each time I try to use Globals!PageNumber in a text box in the
body, I get this error message:
The value expression for the textbox 'textbox20' refers to the global
variable PageNumber or TotalPages. These global variables can be used only
in the page header and page footer.
I'm very interested in how you suggest I can use the globals in the report
body section.
I'm also rather interested in how to reference a textbox field in the header
or footer, even if it's in theory. I've tried referencing it with
ReportItems!myTextBox.value, but no good. Suggestions on syntax are very
welcome.
Kaisa M. Lindahl
"MikeN" <mnorman07@.yahoo.com> wrote in message
news:1113574896.932765.202500@.o13g2000cwo.googlegroups.com...
> Sorry, meant that to be a post. Yes, in theory you can reference a
> textbox field from a Header or Footer. However, for page numbers, I'd
> reference the Report Services global variables. There are two of them
> that apply here.
> For example:
> ="Page " & Globals.PageNumber & " of " & Globals.TotalPages
> This will show "Page 1 of 2", etc.
> MikeN
>

Monday, February 20, 2012

Possible bug in RS -Using the Now function in expression in a Snap

We have created a report that creates a historical snapshot. In the header,
we use the Now vb function to return the current date/time. However, the Now
function does not evaulate at the report execution time. Rather, it seems to
evaluate upon the first opening of the report for viewing. Thus, the snapshot
might have been taken yesterday, but if I open the report in a browser (for
the first time) today, the Page Header now says today (and will always say
that).
Additionally, when you export the report to Excel, the Now evaluates
again... so you get the current date/time in the page header of the Excel
cell.
I will try using the Execution time to get around this, but thought I'd pass
this along.Currently, page headers and footers are calculated at rendering time. This
is so that we can recalculate the page numbering when the report is
repaginated. In SQL 2005, we will change this so that the HTML and GDI
renderers will do this at processing / snapshot time while page oriented
formats will do this at rendering time. In a future version, we will change
these to be static as well.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"dbconsulting" <dbconsulting@.discussions.microsoft.com> wrote in message
news:AF88D084-DE6E-4E01-B2AE-2BFB26C1B821@.microsoft.com...
> We have created a report that creates a historical snapshot. In the
> header,
> we use the Now vb function to return the current date/time. However, the
> Now
> function does not evaulate at the report execution time. Rather, it seems
> to
> evaluate upon the first opening of the report for viewing. Thus, the
> snapshot
> might have been taken yesterday, but if I open the report in a browser
> (for
> the first time) today, the Page Header now says today (and will always say
> that).
> Additionally, when you export the report to Excel, the Now evaluates
> again... so you get the current date/time in the page header of the Excel
> cell.
> I will try using the Execution time to get around this, but thought I'd
> pass
> this along.
>|||Well said by Brian. In case you really wanna show snapshot date/time in page
header do the following-
1. Make textbox named as TextBox1 in report and make it invisble. now put
=now as expression in it.
2. In page header make new text box and use expression =ReportItems!TextBox1.Value
Above code works cause reportItems collection is evaluated and rendering
time but it picks the value from TextBox1 which was processed at the time of
snapshot creation.
Problem solved! :o)
-Suneet Mohan
"dbconsulting" wrote:
> We have created a report that creates a historical snapshot. In the header,
> we use the Now vb function to return the current date/time. However, the Now
> function does not evaulate at the report execution time. Rather, it seems to
> evaluate upon the first opening of the report for viewing. Thus, the snapshot
> might have been taken yesterday, but if I open the report in a browser (for
> the first time) today, the Page Header now says today (and will always say
> that).
> Additionally, when you export the report to Excel, the Now evaluates
> again... so you get the current date/time in the page header of the Excel
> cell.
> I will try using the Execution time to get around this, but thought I'd pass
> this along.
>|||Why not use Globals.ExecutionTime ?
On Fri, 1 Apr 2005 13:17:02 -0800, dbconsulting
<dbconsulting@.discussions.microsoft.com> wrote:
>We have created a report that creates a historical snapshot. In the header,
>we use the Now vb function to return the current date/time. However, the Now
>function does not evaulate at the report execution time. Rather, it seems to
>evaluate upon the first opening of the report for viewing. Thus, the snapshot
>might have been taken yesterday, but if I open the report in a browser (for
>the first time) today, the Page Header now says today (and will always say
>that).
>Additionally, when you export the report to Excel, the Now evaluates
>again... so you get the current date/time in the page header of the Excel
>cell.
>I will try using the Execution time to get around this, but thought I'd pass
>this along.|||Yes, using =Globals.ExecutionTime instead of =Now would be the right
solution.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matthew Brown" <octavius@.gmail.com> wrote in message
news:k8e251tn28vut7uk22e16h1koe1h4h94bk@.4ax.com...
> Why not use Globals.ExecutionTime ?
>
> On Fri, 1 Apr 2005 13:17:02 -0800, dbconsulting
> <dbconsulting@.discussions.microsoft.com> wrote:
>>We have created a report that creates a historical snapshot. In the
>>header,
>>we use the Now vb function to return the current date/time. However, the
>>Now
>>function does not evaulate at the report execution time. Rather, it seems
>>to
>>evaluate upon the first opening of the report for viewing. Thus, the
>>snapshot
>>might have been taken yesterday, but if I open the report in a browser
>>(for
>>the first time) today, the Page Header now says today (and will always say
>>that).
>>Additionally, when you export the report to Excel, the Now evaluates
>>again... so you get the current date/time in the page header of the Excel
>>cell.
>>I will try using the Execution time to get around this, but thought I'd
>>pass
>>this along.
>

Positioning parameters in header

I have three parameters for a financial rpt. Division name, "From" date, and
"To" date. I want the "From" and "to" date parameters to be on the same line,
with the division name on top. How do I make this happen?
Thanks in advance!
carlYou can create two text boxes, one to show the first parameter and 1 to show
the from/to values:
The value property of each:
1) = Fields!division_name.Value
2) = "From " + Fields!from_date.Value.ToString("d") + " to " + Fields!to_date.Value.ToString("d")
Date/Time format strings:
http://msdn2.microsoft.com/en-us/library/az4se3k1.aspx
> I have three parameters for a financial rpt. Division name, "From"
> date, and "To" date. I want the "From" and "to" date parameters to be
> on the same line, with the division name on top. How do I make this
> happen?
> Thanks in advance!
> car|||I apologize, after reading my own post I realize I was not clear on what I
wanted.
I want to be able to position the actual drop down boxes in the report tool
bar so that when the user goes to enter/select data in the drop downs, the
placement of the drop downs makes more sense.
I realize that this makes no difference to the functionality of the report,
but I have a business user who doesnt like the "feel" of where they line up
now, with the division name and "from date on the top line, then the "to"
date below by itself. I want to get the from and to date parameters on the
same "line" so that its more obvious as to what the purpose of these
parameters are.
thanks!!
"Andrew Backer" wrote:
> You can create two text boxes, one to show the first parameter and 1 to show
> the from/to values:
> The value property of each:
> 1) = Fields!division_name.Value
> 2) = "From " + Fields!from_date.Value.ToString("d") + " to " + Fields!to_date.Value.ToString("d")
> Date/Time format strings:
> http://msdn2.microsoft.com/en-us/library/az4se3k1.aspx
>
>
> > I have three parameters for a financial rpt. Division name, "From"
> > date, and "To" date. I want the "From" and "to" date parameters to be
> > on the same line, with the division name on top. How do I make this
> > happen?
> >
> > Thanks in advance!
> > carl
>
>