Crystal Reports 11 - Useless blank page is added with just group headers that have data - ms-access

I have a weird problem I have never seen before using Crystal Reports.
I built a complex PDF monthly report for a bank that generates over 200 pages. The specifications took months to adjust with the client but it works perfectly now, showing all the data it's supposed to, all sorted right and with the right headers.
But for some reason the report inserts quasi-blank pages rarely and seemingly randomly before it shows data. These pages aren't entirely blank, all my headers including group headers show, but no details. The correct data shows up a couple of pages later but these useless pages keep popping up in the report no matter what I do with Section Expert. To be clear the headers and the details aren't separated. The headers also display fine in the page with the right data, they just duplicate to the extra blank pages before that.
Here is a sample:
NO "insert blank page" box is checked in any of my sections except the uppermost level of data, which works fine, but these extra pages are not inserted at the end of each group for that level. They are inserted randomly sometimes right in the middle of a coherent section.
I also verified the "Keep Together" option, and it is checked for the 4 lowest levels including the details, so I considered data too big to fit on the same page with its headers but the probleme is rare, random and the data overflows perfectly when it does appear (as on page 3 in my example).
And checking all those boxes off didn't change anything.
There are no suppression formulas and the only suppressed sections are GH1 and GH2, but they are suppressed all the time, unconditionally. I tried adding a conditionnal suppression formula to the headers if there is no data, but the problem is, there is data. The headers just seem to be duplicated uselessly.
The problem doesn't seem tied to any specific change in header value. In my example it changes when the report hits Common Stock Equities for a certain portfolio but doesn't occur when another portfolio displays its Common Stock. And I check the data in my data source, everything is consistent between the rows of data that this happens to and those that don't.
I ran out of ideas on how to get rid of these extra pages. Anyone know what's happening in my report?
Thanks a bunch.

Try toggling 'Keep Group Together' for the groups to see if it has any effect. You'll find the option by right clicking on the group, choose 'Change Group' (to bring up the Group Expert), and on options tab.
This option is often overlooked since 'Keep Together' in the Section Expert is more visible.
(You may also want to look at turning off 'Keep Together' to see how that affects your report)

Related

SSRS Tablix Group Reset Page Number and Page Name not working when Exported to Word

I have a SSRS (.rdl) report with a tablix whose details group is set to put a page break between group items, reset the page number and set the page name (as per http://blogs.msdn.com/b/robertbruckner/archive/2010/04/25/report-design-reset-page-number-on-group.aspx).
This works correctly when rendered to HTML or as a PDF.
When rendered to Word the page numbers do not reset and the page name never changes (the page name is always the value set on the first page). The page breaks work as expected.
I have read (at https://msdn.microsoft.com/en-us/library/dd283105.aspx#ReportHeadersFooters) that complex expressions must be converted into runs of simple expressions in order to display correctly when exporting to Word. I have done this but the problem persists.
Is there any way to make the tablix group reset page number and page name functionality work when exporting to Word?
If not is there a way of achieving the same effect when exporting a report to Word from SSRS?
This is an older question but recently ran into this issue myself so it might help someone else.
There are a lot of examples out there that use casting in the examples for the page number display (CStr or ToString()). Whenever I invoked those methods, the counts would be off when exporting to Word (either doc or docx).
The only way I could get it to work is with three separate text boxes in the footer with these expressions:
=Globals!PageNumber
"of"
=Globals!TotalPages
Avoid the use of those other approaches. Three separate text boxes was the only way I could get this to work.

SSRS not rendering all page breaks in PDF export

I have a report is ssrs, it consist of a main report which has a header containing the page number and 2 sub reports (report page 1 and report page 2) within a tablix. Report page one comes first, then report page 2 displays on the next page after the end of report page 1. The subreports can be anywhere from 1-3 pages. The page numbering is reset between each set of report page 1 and 2 (so if page 1 is 3 pages and page 2 is 2 pages, it goes from page 1-5, then resets). These are called for each record (with grouping) from the main reports' query. The report is around 1000 pages total. It renders perfectly on screen, but when I try to export to PDF, it will sometimes (like 1 time in the 1000 pages) display part of report page 2 on a page (as expected, the page number matches with it), then it will start printing report page 1 of the next group on the same page.
Here is the layout of the main report:
Here is the document outline for better understanding:
And here is the page that is wrong...
This is what it should look like (the last page of sub-report page 2 even has just the total record like the broken one!
I have tried everything I can think of. I have tried (i think) every combination of page breaks on the rectangles and groups, I have tried making a tablix with 2 rows using the same group and again tried every combination of page breaks. I have tried changing the number of records on a page. I have tried changing the consume whitespace option on both sub and main reports. I have tried adding both calculated and random amounts of white space. I have recreated the report from scratch a couple times. I'm sure there's more, but it would be like going through a full feature list of SSRS... Basically, I tried everything I could think of, then everything suggested in the links on the first page of about 10 different google searches. I just have no idea what is going on with this, any help would be greatly appreciated!
Let me know if you need any more info, screenshots, or whatever and I will try to provide. It may be highly "redacted", but I will provide anything I can.
Thanks, Kevin
Try check the setting "Between each instance of a group" in group properties of tablix.
Try checking your XML for empty TablixRows (which will not show up in the Document Outline). I found with my report that empty tablix rows screw up page breaks in subsequent rows / sub reports when exported to PDF. Where possible hide the TablixRows or insert and empty text box.
This appears to be a bug with SSRS when editing the XML by hand. The Visual Studio GUI seems to not let you delete the last element in a row - perhaps this is a work around. An error or schema validation message would have been nice for us hand coders!
Hope this helps.

Tablix header not repeating on new page, when subreport causes page break

I've been fighting with SSRS for too long now on what should be a simple matter. I'm hoping someone can help me see a solution.
I have a report which has a number of profiles, and each profile has a large number of data sections. The data sections (various tables and charts) are not related to each other in any way other than that they "key" back to the parent profile id.
The goal (which seems simple) is to have a header on each page with the profile information, and then have the data sections (each formatted completely differently) laid out.
The first problem we encountered was that for some reason SSRS2008 does not allow a tablix cell to contain another tablix with a different dataset (why it can't just require a filter based on the parent grouping is beyond me). The recommended workaround for this shortcoming is to either combine all data into a giant dataset (not possible here, data sections are too numerous and varied) or to embed subreports and pass in the parameters. While option number two increases the "work" needed to print a large number of profiles, we proceeded to implement this and it does work.
The problem comes in on the main tablix (the one containing the subreports) that has a static row header group set with "RepeatOnNewPage = true". This setting allows the header to show on every page as desired... except for subreports the span multiple pages, where the header is incorrectly ommitted.
For some reason, when the subreport spans multiple pages, the header of the parent tablix is not repeated! This is driving me insane as it would seem that a couple bad design decisions in SSRS has put me in a situation where I can't create the report I want... headers works without subreports, but I need subreports in order to "join" the data sections to the profile.
This would seem to be a simple and common requirement... after all, it's a report that is being migrated from a decades old reporting system. I've scoured StackOverflow and Google without success... I've seem a number of questions/answers about page breaks, but nothing that suggests a solution to this problem with subreports.
I'm posting this in case I'm missing something. If anyone has any suggestions at all, it would be much appreciated.
A very clean and simple way to repeat the column header on each page
http://www.a2zmenu.com/Blogs/BI/Tablix-headers-not-repeating-in-SSRS-2008.aspx
We've solved our problem... although not in the most ideal way.
The Page Header (of the "master" report, not the subreports) seems to be the only way to consistently have a header section.
We implemented a solution based in large part on this blog posting:
Maintaining State in Reporting Services 2008
We modified slightly from the blog post, removing "id" from the methods and including a GUID to ensure the report values are not mixed up even if the user runs several copies of the report at the same time. (When using shared variables, remember that they are global to the report running across execution instances and across users on the report server, so a lot of care needs to be taken when they are used!)
In the report body we have a hidden text block that calls:
=Code.SetValue("xxx",Fields!Field1.Value) & Code.SetValue("yyy",Fields!Field2.Value)
and in the report page header we reference these as (for example):
=Code.GetValue("xxx")
This works because the body is calculated before the page header, even for Page 1.
Still, in the end it is a hack for something that should be in Microsoft's product, given that they have poured years of development into this product! Why we cannot have nested tablix's and easier to use headers is beyond me... again this is upgrading a report from a program from the early 90's which did all this without problem. At the very least, give us report variables that can be retrieved and set as the report is processed!
Regardless, things are as they are... we've tested the solution with shared variables and it seems to be working very well. We're going to run stress tests to make sure it's implemented correctly, I'll post something here if we find any further problems.
(And if anyone knows of some other way to get consistent header rows on pages, even when there are detail rows with large heights, please share...)
We have faced exactly the same problem during implementation of customer demands on SSRS Reports,
And did try a lot of things which all of them resulted with failure.
In our case,
Main Report has 4 subreport. Each SubReport should be started in new page. And also when new subreport begins, page header should be changed dynamically based on Subreport in body in current page.
Also one of SubReports which was SubReport3 has another case. Basically Main Report was running based on Dealer level. But Customer wants SubReport3 to run for each SubDealer related with #Dealer parameter. Also Customer wants to see each SubDealer data started in New page inside SubReport3.
As a result, we found different workaround as follows.
We created Page Header to Main Report. (Report Menu -> Add Page Header)(As #codinginthevoid said it is most consistent way)
We putted 4 subreports inside separate tablix. We added new column to each tablix. That column in each tablix visiblity = false, width of that column can be as small as possible, then created placeholder inside of that column, wroted down expression as follows:
If expression is in Tablix1, expression was ="Tablix1", if in Tablix2 then "Tablix2" and etc.
Then started design page header for Tablix1, each report item in pageheader that was putted for Tablix1 has visibility expression as follows:
=ReportItems!Tablix1_HiddenTextbox1.Value IS NOTHING
then applied same thing for Tablix2 and etc.
In the end, there were lots of textbox in PageHeader of report and some of them position was completely same, overlapped, But when reports is being rendered, each of those textboxes is being shown it is related page with related subreport.
I have encountered the same problem as well. What I found was that the way to solve the issue was to de-normalise the data, adding a 'Record Type' field to identify whether the row was a parent or a child.
There were two sub-tables in my tablix, both displaying detail data linked to the outer grouping. If I set the headers of the sub-tables to repeat on every page (using the Advanced arrow > Static Properties > KeepTogether = True, KeepWithGroup = After, RepeatOnNewPage = True) then one of the sub-tables would display correctly, however the parent table's repeating header would just disappear.
To keep a long story short, this was a massively annoying problem to solve. The solution is simple, it worked for me, but may not work for everyone.
Linked below is a SSRS2008 example RDL that connects to localhost and has an example of the problem I had and also the solution I implemented. Please feel free to use it if you find it useful!
(I would've posted it on here but Stack Overflow fails for code blocks it seems)
http://www.sqlservercentral.com/Forums/Topic1111567-1633-1.aspx?Update=1

Mimicking Spreadsheet Style in a MS-Access Report

I've been tasked with creating a report in MS-Access that looks exactly like a spreadsheet that a vendor supplies to us for my company to fill in.
The number of records per page is about 40 and there are usually 3-6 pages that need to be prepared. Each month there is a new report sent out and I just got finished writing it all in manually while looking at a report I generated. The purpose of this is to avoid manually transcribing the data.
They are adamant about using their format and will not accept a different report, so I'm trying to be sneaky about it.
Problems
I can duplicate the header of the spreadsheet and the rows just fine, I've just run into a few snags.
Blank rows need to be displayed on the last page of the report instead of nothing being printed (whitespace) and then the page footer.
Whitespace that exists between the Details and the Page Footer is present. The page footer should instead appear to be another row of cells, except that it has the text Page Total and the page total on that row.
The second item happens because the Page Footer always appears at the bottom of the page in a set location as opposed to where the records ended (even if they took up the entire page).
Ideas
If there is someway I could create a
group based on page, then I could
stick that right after the details
section so that it would line up
nicely as opposed to the page total
and still be able to display the page
total.
Inserting blank rows into the rows to
match the number of records, is this
possible? I could calculate how many
extra rows I would need to complete
the page, but how would I insert
those rows into the data source?
Creating a new excel spreadsheet from a template and just writing to there the rows.
I'm using MS-Access 2007 here with a MS-Access 2003 MDB.
Any help is greatly appreciated.
If you need gridlines to print at the end of an Access report, one option is to create a background bitmap that you insert into the report's picture property.
This would be rather fussy, as you could use it only if your headers and footers are identical on all pages, and you'd have to be sure that controls entirely cover the whole detail area so that the background graphic will not show through except on pages where there is blank space. Also, if you altered the width of your detail fields, you'd need to edit the graphic to harmonize with those changes.
Let me just say that I consider the insistance on replicating the look of the spreadsheet to be incredibly boneheaded stupid. What purpose is served by these gridlines except to replicate the visual appearance of a spreadsheet? Are they going to use the grid to write things in? If not, then it's just a really idiotic requirement.
Start by turning a copy of their Excel report into a template file. Remove the data, but keep headers, formating, and formulas as needed (Some data manipulation will be easier in Access.).
This way you can enter and store data in Access. Instead of having users fill-in the spreadsheet in Excel with VBA based on the template file.
You'll run into different issues of how to place the results of a query to a worksheet and filling in formulas in specific fields, etc., but those can be later questions to post.

Different odd/even pages in MS Access reports

For a report in MS Access (2007) I need to put data of some columns on all odd pages and other columns on all even pages. It is for printing out double sided card files onto sheets of paper.
Does somebody have an idea how to do that?
Your question is too general. I would suggest you have all columns in all pages, and then add some code to the page header section (or even in the detail section) "On Format" to change the .Visible property of your Detail text boxes depending on the page number.
I think you'll need to have a Text Box in the page header or footer with "=[Page]" as source data in order to know the correct page number. My Access report knowledge might be severely outdated, though.
Well you can check whether "Page" is odd or even in an "On Format" event and maker columns visible or not visible depending on which page you are on. However, it would be far easier to:
Put in a couple of sections and put in a new page between them. Then it's just a matter of ensuring that you don't overflow the page with too many rows per card.
OR
Make the report wide enough that it forces a second page and then place those columns on a second page (i.e. the back of the first page). As I recall access's print order is left right top bottom, so pages set up like this:
A B
C D
would print like this:
A
B
C
D
In the case of having to display data from the same record on two consecutive pages, this is the option I would choose.
You could alternatively use a pair of queries, printing the first to side A, and the second to side B, perhaps?