I am doing a SSRS report to generate some kind of print outs.
I need to have different footers inside the whole print out.
e.g. After first several pages I need to use page number as page footer( this can be easily done). but after that i need have footers as Annex A -1, Annex A-2, or Annex B -1 , Annex C - 1, when the page is Annex A, Annex B...etc.
the greate thing about SQL Server Reports that you can do almost everything through expression, all what you have to
is to find the expression that fit your purposes, for example through page numbers or if this page contains specific thing
to be numbered Annex-1 or whatsoever.
“First, solve the problem. Then, write the code.”
(John Johnson)
________________________________________________
Please mark as Answer if it helped you :)
Hi, may I know how to check or what's the function if this page contains specific things? (e.g. contains some text box, so that will be very easy for to determine the footer)
=iif(Globals!PageNumber<=Globals!TotalPages,"Page "+ Globals!PageNumber.ToString() +" of"+Globals!TotalPages.ToString()",code.GetPageName(txtPageName) assign the value to Textbox in footer.
You create custom code and pass the Page Name when you reach the total page numbers...
Public iTotalPage as Integer
Public sPage as string=string.empty
Public Function GetPageName(sPageName as string) //pass the PageName to the function and keeping adding 1,2 for all Annex A,Annex B,Annex C...
If sPage<>sPageName then //here we are checking whether Annex A=Annex B. If not then continue adding 1,2,3 so on till we get Annex B
iTotalPage= iTotalPage+1;
sPageName+"-"+iTotalPage
sPage =sPageName
Else
iTotalPage= 1;
sPageName+"-"+iTotalPage
sPage =sPageName
End if
return sPageName
End Function
Please 'Mark as Answer' if my reply helped you..
Nanda
Marked as answer by You-Hu Fu on May 26, 2010 11:29 AM
spidercool
0 Points
5 Posts
How to have different footer in SSRS?
May 18, 2010 02:12 AM|LINK
I am doing a SSRS report to generate some kind of print outs.
I need to have different footers inside the whole print out.
e.g. After first several pages I need to use page number as page footer( this can be easily done). but after that i need have footers as Annex A -1, Annex A-2, or Annex B -1 , Annex C - 1, when the page is Annex A, Annex B...etc.
Anyone can help me with this?
Thanks.
SSRS footer
jaffal
Member
595 Points
145 Posts
Re: How to have different footer in SSRS?
May 18, 2010 11:22 AM|LINK
the greate thing about SQL Server Reports that you can do almost everything through expression, all what you have to
is to find the expression that fit your purposes, for example through page numbers or if this page contains specific thing
to be numbered Annex-1 or whatsoever.
(John Johnson)
________________________________________________
Please mark as Answer if it helped you :)
spidercool
0 Points
5 Posts
Re: How to have different footer in SSRS?
May 18, 2010 11:32 AM|LINK
Hi, may I know how to check or what's the function if this page contains specific things? (e.g. contains some text box, so that will be very easy for to determine the footer)
Thanks.
beharavenkat...
Contributor
2799 Points
448 Posts
Re: How to have different footer in SSRS?
May 19, 2010 12:06 PM|LINK
Write expression
=iif(Globals!PageNumber<=Globals!TotalPages,"Page "+ Globals!PageNumber.ToString() +" of"+Globals!TotalPages.ToString()",code.GetPageName(txtPageName) assign the value to Textbox in footer.
You create custom code and pass the Page Name when you reach the total page numbers...
Public iTotalPage as Integer
Public sPage as string=string.empty
Public Function GetPageName(sPageName as string) //pass the PageName to the function and keeping adding 1,2 for all Annex A,Annex B,Annex C...
If sPage<>sPageName then //here we are checking whether Annex A=Annex B. If not then continue adding 1,2,3 so on till we get Annex B
iTotalPage= iTotalPage+1;
sPageName+"-"+iTotalPage
sPage =sPageName
Else
iTotalPage= 1;
sPageName+"-"+iTotalPage
sPage =sPageName
End if
return sPageName
End Function
Nanda
spidercool
0 Points
5 Posts
Re: How to have different footer in SSRS?
May 20, 2010 02:23 AM|LINK
Hi,
Thanks for your code, I am trying it out.
But I met some issues. May I know what is txtPageName?
Thank you.
beharavenkat...
Contributor
2799 Points
448 Posts
Re: How to have different footer in SSRS?
May 20, 2010 04:29 AM|LINK
that will be footer textbox name, just I have mentioned like that, you can mention the textbox name which you have declared in the footer.
Nanda
spidercool
0 Points
5 Posts
Re: How to have different footer in SSRS?
May 20, 2010 05:27 AM|LINK
You mean assign value to text box txtPageName as
=iif(Globals!PageNumber<=Globals!TotalPages,"Page "+ Globals!PageNumber.ToString() +" of"+Globals!TotalPages.ToString()",code.GetPageName(txtPageName)
?
I got the error "txtPageName' is not declared.
Please help, thank you.
You-Hu Fu
Star
8174 Points
795 Posts
Re: How to have different footer in SSRS?
May 24, 2010 07:38 AM|LINK
Hi,
TextPageName is just the mentioned textbox name which you have declared in the footer.
Regards,
Challen Fu
Feedback to us
Microsoft One Code Framework
spidercool
0 Points
5 Posts
Re: How to have different footer in SSRS?
Jun 03, 2010 03:13 AM|LINK
forgive me if i understand wrongly,
Do you mean you add a text box named 'txtPageName' inside the footer.
Then you assign value
=iif(Globals!PageNumber<=Globals!TotalPages,"Page "+ Globals!PageNumber.ToString() +" of"+Globals!TotalPages.ToString()",code.GetPageName(txtPageName)
to this text box 'txtPageName'.
I notice that this txtPageName as a para. within the assigned value itself.
and I still got the error "txtPageName' is not declared.
Please help, thanks.