Wednesday, March 7, 2012
PageNumber in the body
and footer.
How can I get page number in page body?
Ola A.Try creating an object in the header or footer (this can be invisible)
and assign the Globals.PageNumber value to it.
Then create an object on the page body, and reference the value of the
object in the header to provide its value.
This is similar to other workarounds, and I think it will work - should
be easy enough to try, anyway...
Ola A. wrote:
> There is Globals.PageNumber variable that can be used only in page
header
> and footer.
> How can I get page number in page body?
> Ola A.|||I tried but i get this error:
The hidden expression for the rectangle â'rectangle4â' refers to the report
item â'rectangle2â'. Report item expressions can only refer to other report
items within the same grouping scope or a containing grouping scope.
The rectangle2 is the one who is in the head and the rectangle4 is in the
body.
Ola A.
"Parker" wrote:
> Try creating an object in the header or footer (this can be invisible)
> and assign the Globals.PageNumber value to it.
> Then create an object on the page body, and reference the value of the
> object in the header to provide its value.
> This is similar to other workarounds, and I think it will work - should
> be easy enough to try, anyway...
>
> Ola A. wrote:
> > There is Globals.PageNumber variable that can be used only in page
> header
> > and footer.
> > How can I get page number in page body?
> >
> > Ola A.
>
pagenumber in body
report execution date, page number, report spacific details like account
numbers.
It seems that I cannot put a pagenumber in the body, and I cannot have
dataset info in the header. If I wanted to do this ... could I ? I would
like a 'Power Header' with a mix of global variables like pagenumber mixed
with dataset fields... Can this be done?You this special case you could refer the dataSource on some reportItems
rather than the fields collection.
HTH; Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"d pak" <dipakb@.exchnage.ml.com> schrieb im Newsbeitrag
news:B80D6CE0-CCA3-481C-B1CA-580642863773@.microsoft.com...
> Headers are more sophistacated these days. They require client
> information,
> report execution date, page number, report spacific details like account
> numbers.
> It seems that I cannot put a pagenumber in the body, and I cannot have
> dataset info in the header. If I wanted to do this ... could I ? I would
> like a 'Power Header' with a mix of global variables like pagenumber mixed
> with dataset fields... Can this be done?
PageNumber Display in Report Body
First:
Create a table footer and add the two text boxes as follows:
In the first text box add =Globals!ExecutionTime and in the second text box add="Page " & Globals!PageNumber & " of " & Globals!TotalPages
Or just add a text box at the botton of your detail layout and withn the text box add="Page " & Globals!PageNumber & " of " & Globals!TotalPages
I have never thought of adding a text box within the detail layout for the page number - maybe there is a special need?
Hope this helps
Joe
'PAGEIOLATCH_SH
BOL and other sources make no referance to this.
Can any body help?Hi
Google does though!!
Try:
http://www.sqldev.net/misc/waittypes.htm
John
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx
.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?|||I have heard that this might also indicate contention due to a large number
of indexes on the same table...
(although I personally have not encountered it)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx
.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?|||I've encountered this.
I may be talking out of my 4th-Point-Of-Contact, but it can also be attribut
ed to multi-processor machines and faulty optimization
(parallelism). I've worked around it by applying the optimizer option MAXDOP
.
http://www.sql-server-performance.com/case_studies.asp
http://support.microsoft.com/defaul...kb;EN-US;243589
http://www.databasejournal.com/feat...cle.php/1438891
ChrisG
'PAGEIOLATCH_SH
BOL and other sources make no referance to this.
Can any body help?Hi
Google does though!!
Try:
http://www.sqldev.net/misc/waittypes.htm
John
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?|||I have heard that this might also indicate contention due to a large number
of indexes on the same table...
(although I personally have not encountered it)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?|||I've encountered this.
I may be talking out of my 4th-Point-Of-Contact, but it can also be attributed to multi-processor machines and faulty optimization
(parallelism). I've worked around it by applying the optimizer option MAXDOP.
http://www.sql-server-performance.com/case_studies.asp
http://support.microsoft.com/default.aspx?scid=kb;EN-US;243589
http://www.databasejournal.com/features/mssql/article.php/1438891
ChrisG
'PAGEIOLATCH_SH
BOL and other sources make no referance to this.
Can any body help?
Hi
Google does though!!
Try:
http://www.sqldev.net/misc/waittypes.htm
John
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?
|||I have heard that this might also indicate contention due to a large number
of indexes on the same table...
(although I personally have not encountered it)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Mat" <anonymous@.discussions.microsoft.com> wrote in message
news:1ee9301c4577b$3f2d8c00$a301280a@.phx.gbl...
> In current activity i have a wait type of 'PAGEIOLATCH_SH'
> BOL and other sources make no referance to this.
> Can any body help?
|||I've encountered this.
I may be talking out of my 4th-Point-Of-Contact, but it can also be attributed to multi-processor machines and faulty optimization
(parallelism). I've worked around it by applying the optimizer option MAXDOP.
http://www.sql-server-performance.com/case_studies.asp
http://support.microsoft.com/default...b;EN-US;243589
http://www.databasejournal.com/featu...le.php/1438891
ChrisG
Monday, February 20, 2012
Page Numbers
reset after a grouping in the body, is this possible?
In Crystal it is the checkbox option in the Section Expert tab called "Reset
Page Number After."I find the easiest way to do this is to use a subreport. I haven't found a
way to do that either other than subreporting it. The page numbers are only
shown on the subreport.
=-Chris
"Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
>I need the page numbers in the header (or body if it can work like this) to
> reset after a grouping in the body, is this possible?
> In Crystal it is the checkbox option in the Section Expert tab called
> "Reset
> Page Number After."|||Do you have any groupings in your report?
Group A
Page 1
Page 2
Group B
Page 1
What I'm asking is that does the page number reset after each group?
"Christopher Conner" wrote:
> I find the easiest way to do this is to use a subreport. I haven't found a
> way to do that either other than subreporting it. The page numbers are only
> shown on the subreport.
> =-Chris
> "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> >I need the page numbers in the header (or body if it can work like this) to
> > reset after a grouping in the body, is this possible?
> >
> > In Crystal it is the checkbox option in the Section Expert tab called
> > "Reset
> > Page Number After."
>
>|||yes, my groupings are in a list (on recipient) so it can be mailed out to the
recipients, and i dont want them to see how many total pages are being mailed
out, just how many are being mailed to them
Joe Astone (passport name is company's in case you were wondering)
"Cu Nguyen" wrote:
> Do you have any groupings in your report?
> Group A
> Page 1
> Page 2
> Group B
> Page 1
> What I'm asking is that does the page number reset after each group?
> "Christopher Conner" wrote:
> > I find the easiest way to do this is to use a subreport. I haven't found a
> > way to do that either other than subreporting it. The page numbers are only
> > shown on the subreport.
> >
> > =-Chris
> >
> > "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> > news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> > >I need the page numbers in the header (or body if it can work like this) to
> > > reset after a grouping in the body, is this possible?
> > >
> > > In Crystal it is the checkbox option in the Section Expert tab called
> > > "Reset
> > > Page Number After."
> >
> >
> >|||the subreport idea didnt work, it cut the header off of the subreport and
still did the total pages should i put it on the main report...any advice?
"Cu Nguyen" wrote:
> Do you have any groupings in your report?
> Group A
> Page 1
> Page 2
> Group B
> Page 1
> What I'm asking is that does the page number reset after each group?
> "Christopher Conner" wrote:
> > I find the easiest way to do this is to use a subreport. I haven't found a
> > way to do that either other than subreporting it. The page numbers are only
> > shown on the subreport.
> >
> > =-Chris
> >
> > "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> > news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> > >I need the page numbers in the header (or body if it can work like this) to
> > > reset after a grouping in the body, is this possible?
> > >
> > > In Crystal it is the checkbox option in the Section Expert tab called
> > > "Reset
> > > Page Number After."
> >
> >
> >
Page number information available in report body
How can I get the page number while in report body ? I need to show/hide
some controls, depending on the page number.
Any solution is welcome !
Thank you,
CataOn Apr 10, 3:46 pm, "Catalin Magher" <cmag...@.era-environmental.com>
wrote:
> Hi Group,
> How can I get the page number while in report body ? I need to show/hide
> some controls, depending on the page number.
> Any solution is welcome !
> Thank you,
> Cata
Normally, to use Globals!PageNumber, you have to be in the Page Header/
Footer. That said, this link might provide you a work around:
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/2eee17d147fb5603/dda039e65c969ce2?lnk=st&q=get+page+number+in+report+body+reporting+services&rnum=1#dda039e65c969ce2
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||This is an older post, but I tried to find a solution in the forum and
found many with the same unanswered question.
This is how I worked the problem. What you are doing is having the
Report call the global function and pass to a string and then you are
calling the function return str and inserting into the textbox!
Add the following code to the Report properties (main menu
REPORT>Report Properities > Code )
Public Function PageNumber()
Dim str as String
str = me.Report.Globals!PageNumber.ToString()
Return str
End Function
Public Function TotalPages()
Dim str as String
str = me.Report.Globals!TotalPages.ToString()
Return str
End Function
Now add the following function calls to empty textboxes
=Code.PageNumber
=Code.TotalPages
page number in body
Use Globals!PageNumber in any expression.|||i have used in text box =Globals!PageNumber, there is en error message displayed
"these global variables can be used only in page header and page footer"
|||Yes, I'm not sure that it is possible to put it in the body of the report.
|||infact, my ultimate target is to show a row when there will be a new page, other wise hide it. and i can easily do that if i know the occurance of a new page and this can be done if i access page number in a body.
for example
aaaa cccc
dddd
eeee
now "aaaa" will be displayed on the first row of a page, otherwise blank spaces.
|||
Maybe this will help you:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=489400&SiteID=1
|||i have read this link, i have tested that code and it contains same problem as it is mentioned in that link.
in fact i can't use that approch because i am working in table-4 of my report and there are 3 tables above my table and the number of rows of those tables are dynamic, it means that they may contain N number of rows. now how i can bound page break on last table "table-4". so it means that i can't use row number approach as mentioned in above link.
i have another idea but please tell me how will that work,"how can i access report header text field in report body".
page number & records number
1. how to show page number & total page number in report body?
2. how to show total records number?
For #1: Create a text box. For the value, enter the following:
="Page " + Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString()
For #2: If you just want to show the number of rows in a table for example, then create a text box, and enter the following:
=CountRows(Fields!FieldName.Value)
|||thanks for reply, but errors found.
for #1:
[rsPageNumberInBody] The Value expression for the textbox ‘textbox1’ refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer.
for #2:
[rsInvalidAggregateScope] The Value expression for the textbox ‘textbox2’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set.
pls advise, thanks
|||for #1: I can't think of another way to output the page numbers, so you might have to just use the header and footer to handle it.
for #2: Create a text box and enter the value: =CountRows("DataSetName")
This will output the number of rows returned by the dataset.
|||for #2 is work. thanks.|||Okay, I found a solution for #1:
Go to "Report" -> "Report Properties" -> "Code"
In the Custom Code section, enter the following:
Public Funtion PageNumber() as String
Dim str as String
str = Me.Report.Globals!PageNumber.ToString()
Return str
End Function
Public Function TotalPages() as String
Dim str as String
str = Me.Report.Globals!TotalPages.ToString()
Return str
End Function
Now you will be able to access these functions anywhere in the report (header, body, or footer). So, to output the page number and total pages in a textbox located in the body simply enter this for the value:
="Page " + Code.PageNumber() + " of " + Code.TotalPages()
|||I cannot get this to work. I get an end of statement expected error for the first line. I copied the code into report, report properties, code tab and change the function names to suit my naming convention. Also, when I try to refer to the functions in a textbox Code.FunctionName does not recognize the function in the custom code section.|||Okay, I found the error. When I typed in the code for the post, I spelled "Function" incorrectly on the very first line... Just add the missing "c" and you will be good to go. Sorry about that.
Joel
ah, it's okay... I don't know why I didn't notice that. I got the code in without any errors this time. When I test it, it doesn't seem to function as desired.
= Code.FunctionName()
I only get the number 1 in all the textboxes that carry the above information.
|||Can you copy and paste your custom code as well as your expression for the textbox?
Thanks,
Joel
Custom Code
Public Function PageNumber()
Dim str as String
str = me.Report.Globals!PageNumber.ToString()
Return str
End Function
Public Function TotalPages()
Dim str as String
str = me.Report.Globals!TotalPages.ToString()
Return str
End Function
in Text Boxes in Tables
=Code.PageNumber() & " " & Code.TotalPages()
I'm running VS2k5 & SSRS2k5. My report has two columns, and runs about 200 pages. I have two tables, and I'm trying this in both tables in group headers and detail lines. All I get for all the text boxes is "1 1". I hope this information helps. I know I specified earlier that I changed the function names for our naming conventions, but I decided to go with exactly what you have until I can get it to work, then I'll make any necessary changes.
Thanks!
Curtis
|||Hmm, I'm also getting the same results. I think it's safe to say I didn't test this very well. When I first wrote the function, I tested it on a report with only one page and when it outputed "Page 1 of 1", I figured it was good to go. However, after playing around with a report that is 3 pages, it's clear this function is not going to work.
I'm not really sure why we are only getting the value 1 for both globals. It is clearly accessing these globals because if you change their names it will create an error saying they are not members of "Globals". Anyway since that didn't work, I really can't think of another idea on how to output page # and total pages in the body. If you come up with a solution though, I'd be interested to see it.
Thanks,
Joel
I'll see if there is anything I can come up with! If anyone else has any ideas or thoughts, feel free to share! I just do not understand why SSRS should not allow us to use pagenumbering in the data. It doesn't seem to make much sense to me.
Thanks,
Curtis
|||Okay, so I have a solution that works for me. I do not know if it will be a fix all for everyone interested, but I would like to share anyway. I was talking to our SQL developer about my issues with using page numbering in my data. In my case, I am building a table of contents. He intrigued me when he asked me if I thought about using my SELECT statements to predict my page numbers off of my row numbers. I can use this, because I found in my main report I had to define x number of rows per page to keep multiple detail lines of my table together. What I did in SQL is this:
SELECT
,...
, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER
, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER
...
I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.
|||Thanks for the post. I was thinking about trying something like that myself, good idea.