Friday, March 30, 2012
Page Break at End throws unwanted additional blank page in PDF
Originally posted as "Extra Page Break thrown in Export to PDF" - however I
thought this might be misinterpreted as a page size issue.
We have a report which has a group. The "Page Break at End" option is
checked for the group. The report renders correctly in the report manager
with totals immediately under the last group.
Unfortunately, when exporting to PDF, an additional blank page is added.
Can this be avoided?
Note, the report has three tables which are directly on top of each other -
the tables are all sitting within a rectangle.
many thanks
MattJust a thought - Could I edit the RDL file directly and put a condition in
the PageBreak at End element - is this an possibility?
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:ex8fbmIGFHA.3732@.tk2msftngp13.phx.gbl...
> Hi,
> Originally posted as "Extra Page Break thrown in Export to PDF" - however
I
> thought this might be misinterpreted as a page size issue.
> We have a report which has a group. The "Page Break at End" option is
> checked for the group. The report renders correctly in the report manager
> with totals immediately under the last group.
> Unfortunately, when exporting to PDF, an additional blank page is added.
> Can this be avoided?
> Note, the report has three tables which are directly on top of each
other -
> the tables are all sitting within a rectangle.
> many thanks
> Matt
>|||In answer to editing the RDL - unfortunately, no.
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:eWdstsIGFHA.2824@.tk2msftngp13.phx.gbl...
> Just a thought - Could I edit the RDL file directly and put a condition in
> the PageBreak at End element - is this an possibility?
>
> "Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
> news:ex8fbmIGFHA.3732@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > Originally posted as "Extra Page Break thrown in Export to PDF" -
however
> I
> > thought this might be misinterpreted as a page size issue.
> >
> > We have a report which has a group. The "Page Break at End" option is
> > checked for the group. The report renders correctly in the report
manager
> > with totals immediately under the last group.
> >
> > Unfortunately, when exporting to PDF, an additional blank page is added.
> > Can this be avoided?
> >
> > Note, the report has three tables which are directly on top of each
> other -
> > the tables are all sitting within a rectangle.
> >
> > many thanks
> >
> > Matt
> >
> >
>|||Actually, the additional page only seems to occur when the table has rows
after the last group - in my case, it's a grand total field
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:eWdstsIGFHA.2824@.tk2msftngp13.phx.gbl...
> Just a thought - Could I edit the RDL file directly and put a condition in
> the PageBreak at End element - is this an possibility?
>
> "Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
> news:ex8fbmIGFHA.3732@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > Originally posted as "Extra Page Break thrown in Export to PDF" -
however
> I
> > thought this might be misinterpreted as a page size issue.
> >
> > We have a report which has a group. The "Page Break at End" option is
> > checked for the group. The report renders correctly in the report
manager
> > with totals immediately under the last group.
> >
> > Unfortunately, when exporting to PDF, an additional blank page is added.
> > Can this be avoided?
> >
> > Note, the report has three tables which are directly on top of each
> other -
> > the tables are all sitting within a rectangle.
> >
> > many thanks
> >
> > Matt
> >
> >
>|||I believe there are some issues with page breaks while exporting to PDFs..
Hopefully some of these kinds of things will be fixed as time goes forward,
I have yet to be able to eliminate all of the extra pages as well...
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
"Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
news:ex8fbmIGFHA.3732@.tk2msftngp13.phx.gbl...
> Hi,
> Originally posted as "Extra Page Break thrown in Export to PDF" - however
> I
> thought this might be misinterpreted as a page size issue.
> We have a report which has a group. The "Page Break at End" option is
> checked for the group. The report renders correctly in the report manager
> with totals immediately under the last group.
> Unfortunately, when exporting to PDF, an additional blank page is added.
> Can this be avoided?
> Note, the report has three tables which are directly on top of each
> other -
> the tables are all sitting within a rectangle.
> many thanks
> Matt
>|||I have found a work around - although it's a bit clunky.
The issue seems to be where you have something appearing after the last
group. If there is nothing after the last group, the report exports to PDF
correctly. But because I want grand totals I have not been able to simply
put a summation in the table footer.
Firstly, I am using a stored procedure as my report data source.
I added two additional fields to my stored procedure result set a) a grand
total field and b) a last group flag.
I then put the grand total field into a footer row of the outermost group
and set the hidden property to an expression including the Last Group flag
which evaluates to false when at the last group.
This is not a particularly complex thing to work around - but was quite
painful as I resist having to use unintuitive solutions such as this because
they make maintenance more difficult :)
Note: I would have used pagenumbering to determine the last page but
unfortunately, the Global values for Pagenumber and TotalPages are not
accessible within the body of the report.
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:OLxJc%23NGFHA.2932@.TK2MSFTNGP15.phx.gbl...
> I believe there are some issues with page breaks while exporting to PDFs..
> Hopefully some of these kinds of things will be fixed as time goes
forward,
> I have yet to be able to eliminate all of the extra pages as well...
>
> --
> 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
> "Matt" <NoSpam:Matthew.Moran@.Computercorp.com.au> wrote in message
> news:ex8fbmIGFHA.3732@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > Originally posted as "Extra Page Break thrown in Export to PDF" -
however
> > I
> > thought this might be misinterpreted as a page size issue.
> >
> > We have a report which has a group. The "Page Break at End" option is
> > checked for the group. The report renders correctly in the report
manager
> > with totals immediately under the last group.
> >
> > Unfortunately, when exporting to PDF, an additional blank page is added.
> > Can this be avoided?
> >
> > Note, the report has three tables which are directly on top of each
> > other -
> > the tables are all sitting within a rectangle.
> >
> > many thanks
> >
> > Matt
> >
> >
>sql
Page break and subreports
I have a main report that calls subreports. When a subreport has enough data such that it will not fit into the remaining area of the current page the renderer inserts a page break leaving alot of ugly white space. Is there any way to sop this behaviour? This seems like a very basic thing.
not sure is this is the exact reason, but are u using 8.5 * 11 layout for subreport also, if yes u need to decrease it as per your req. because a ful page cannot be accomodated in a page and so ssrs inserts a page break
Priyank
|||Priyank,
All of the subreports and the main report for that matter are 8.5 x 11 but what would I change them to? Let me give you an example of my problem. Lets say the first sub report takes up three inches of the first page when rendered. If the second sub report takes up less than the remaining space (5.5 inches) it prints on the same page otherwise it page breaks and starts on a new page. Since the subreports can vary in rendered length depending on data I have no idea what their size will be.
Another thread stated that subreports operate under and assumed KeepTogether. While this may explain what is happening it does not resolve the issue.
Page break and subreport
Using SSRS 2005, SP1.
I've got a report which contains a subreport.
This subreport is based on a list and can display one or more records.
When i put the subreport in its parent report, i give it an height
which is equal to the height necessary for displaying one record.
When i run my report, if the subreport display one record, there's no
problem.
But if my subreport display more than one record, and then needs to
extend its height, the report works properly but i've got a blank page
after.
As i can't know how much records my subreport has to display, i don't
see how to resolve this problem of blank page.
Is there anyone who've got idea?
Thanks in advance.
Jerome
I hope my english is enough efficient to explain my problem!Jerome,
You're not alone! I am also having this problem, but I'm getting 2
blank pages after my subreport. I ran the subreport by itself and get
no blank pages. I also ran the parent report by itself and get no
blank pages. I only get the blank pages after the subreport when I put
the subreport inside the parent report.
I hope you get feedback because I need it too!!
jennifer
Jerome FAURE wrote:
> Hello,
> Using SSRS 2005, SP1.
> I've got a report which contains a subreport.
> This subreport is based on a list and can display one or more records.
> When i put the subreport in its parent report, i give it an height
> which is equal to the height necessary for displaying one record.
> When i run my report, if the subreport display one record, there's no
> problem.
> But if my subreport display more than one record, and then needs to
> extend its height, the report works properly but i've got a blank page
> after.
> As i can't know how much records my subreport has to display, i don't
> see how to resolve this problem of blank page.
> Is there anyone who've got idea?
> Thanks in advance.
> Jerome
> I hope my english is enough efficient to explain my problem!
Page break and on last record problem
Hello,
In crystal these are available-
1- Conditional Page break 'OnLastRecord'- I have few groups and if I put page break it breaks on each group even if that group has 2 rows but I want a break at the end of the page. So is there conditional page break in SSRS 2005.
2- I am also having problem with controlling Number of lines in a page, few pages are very long as compared to others, though when export to pdf it gives according to the page size set, but not while viewing, is there any work around to this in SSRS 2005.
I will appreciate any suggestion or comment.
regards
1 - this might help you get started http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1682115&SiteID=1 -- if not, what have you tried so far?
2 - when you say "few pages are very long as compared to others" you have to specify: what output format are you talking about? PDF uses printable page size, HTML uses interactive page size, Excel is different because it's allowed to have as many rows as are within an explicit page break set by your code.
I have tried to define "explicit" and "implicit" page breaks separately; see the grey shaded note close to the beginning of this post: http://spacefold.com/lisa/post/Reset-On-Group-(Page-X-of-XX-in-a-group%2c-within-a-total-Y-of-YY-for-the-report)%2c-SQL-Reporting-Services-Style-.aspx. You will also find something similar referenced in the thread to which I linked above.
The difference between behavior of "implicit" page breaks for different formats isn't a bug requiring a "workaround"; it's a feature <s>. Different formats do have different requirements and that's a fact of output life.
So if you want page breaks based on some condition which is external to formatting requirements for a given output format, IOW consistent across output formats, you need to define what that condition is explicitly.
>L<
|||Thanks for the reply.
I think I am still having problem.
Here is what I am doing-
I have three groups - 1-Customer, 2-Department,3-Priority and the details.
1- need to break if customer = Inactive
2- need to break if Department = Closed
3- need to break Priority = normal
So I made first group - Group1(Customer) then inside that I made another groupd Group1A(for customer) without any header and footer and changed the Group expresseion with a boolean parameter 'PageBreak' as is mentioned in the article and similarly did the for other groups but still no luck and it is breaking with the Group. Please let me know if I am following this correctly.
I am hiding the boolean parameter as I don't want to prompt it.
thanks
|||I think you are mixing up a couple of things. The idea of using a parameter had nothing to do with data-based conditional page breaks <s>.
That example I pointed you to had a condition that came in from the outside, so it was a parameter. Your condition has to do with your data, and I didn't mean you to emulate the parameter part . I'm sorry about this...
I wanted you to see the idea of the nested groups in which one group handles your real group break and the other one is responsible for the conditional page break, by grouping on what may be a completely unrelated expression. OK?
I don't have your exact data set but I have created an example with a completely arbitrary page break that is caused by a data condition, instead of the external (parameterized) condition in the other example I pointed to. I will tell you what I did and maybe this will be a better example for you. It isn't going to be *exactly* what you need. But it should show you what you have to do, depending on the effect you're after.
1. I have a table of orders for customers with locale data. I did a query out of this data that looks like this:
Code Snippet
SELECT Customer, Locale FROM OrderHeader ORDER BY Customer
2. In this dataset, let's say I wanted to group by the customer's last name. I only want page breaks if the Locale starts with "N". (I told you it was totally arbitrary! )
3. I set a group on a "normal" group break expression -- in this case
Code Snippet
=Fields!Customer.Value
I set this group to repeat headers since that happened to be where the headers were.
4. I create an outer group on the following, non-normal expression:
Code Snippet
=IIF(LEFT(Fields!Locale.Value,1) ="N",
Fields!Customer.Value,
False)
... and this is the group that has the page break.
Does this help you understand better? The point is, the outer group is going to force a page break when you provide the group break expression with the value that is actually changing, which I've done in the first argument to IIF() here. In the second argument, the value False isn't changing, and the outer group doesn't break.
>L<
|||Thanks a lot, I thing I got it.
Is there anything like 'OnLastRecord' in SSRS.
and is there a way to get a certain number of rows in a page.
thanks
Page break and grouping question
I have to make a report that shows 2 tables one above the other.
The both tables have grouping values, and I want in each page to
display the both tables so I'm making a page break in each group/
table.
The problem is that the both tables goes to separate pages...what I
want is a full page break after the second table is filled up
It looks simple, but I don't know how!
Something like this
---
table 1
record 1, record 2
table 2
record 1, record 2
---
->Break in the end
->Next page
---
table 1
record 1, record 2
table 2
record 1, record 2
---
Thanks for your help,Sorry, I forgot to say that the two tables have different datasets.
Thanks for your help.
Page break after X items
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff. If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.
Thanks in advance.Figured it out. I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:
public shared function GetCount(CurrentCount As Integer) As Integer
If CurrentCount Mod 2 = 0 Then
GetCount = CurrentCount-1
Else
GetCount = CurrentCount
End If
end function
Hello Nblankton
that was a very good idea, I did try to use it but for some reason it only works with 2 records.
I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).
I'm not sure if I'm missing something or it is a bug.
Any Idea?
Thank you
MQ
|||You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.
Something like CurrentCode-(CurrentCode Mod 4)+1.
I worked out a different method later that I think is a little clearer, though. This groups by 3's:
public shared function GetCount(CurrentCount As Integer) As Integer
GetCount = (CurrentCount+1)/3
end function
Hi Nblankton
thank you for the response, after I wrote the note I searched the forum and found this
"=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.
Thank you for your help. adding a group to control the amount of record per page is a great idea.
MQ
|||hi, I hope someone can help me!I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"
I added a new group (I selected table, right-click Proprieties, groups and add)
and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
A scope problem
did I wrong the place to write the expression?
Thanks in advance
sql
Page break after X items
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff. If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.
Thanks in advance.Figured it out. I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:
public shared function GetCount(CurrentCount As Integer) As Integer
If CurrentCount Mod 2 = 0 Then
GetCount = CurrentCount-1
Else
GetCount = CurrentCount
End If
end function
Hello Nblankton
that was a very good idea, I did try to use it but for some reason it only works with 2 records.
I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).
I'm not sure if I'm missing something or it is a bug.
Any Idea?
Thank you
MQ
|||You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.
Something like CurrentCode-(CurrentCode Mod 4)+1.
I worked out a different method later that I think is a little clearer, though. This groups by 3's:
public shared function GetCount(CurrentCount As Integer) As Integer
GetCount = (CurrentCount+1)/3
end function
Hi Nblankton
thank you for the response, after I wrote the note I searched the forum and found this
"=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.
Thank you for your help. adding a group to control the amount of record per page is a great idea.
MQ
|||hi, I hope someone can help me!I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"
I added a new group (I selected table, right-click Proprieties, groups and add)
and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
A scope problem
did I wrong the place to write the expression?
Thanks in advance