Different odd/even pages in MS Access reports - ms-access

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?

Related

SSRS Report not correctly suppressing white space

I have seen some mind-binding situations with SSRS reports in my few years of using it, and I've been able to design around most issues and get it to do everything I've been asked to do.
But apparently, not something extremely simple!
I'm using Visual Studio 2019 version 16.7.2 with the Microsoft SQL Server Reporting Services Designers
version 15.0.19124.0 installed. There's no data bound to the report, this is just a simple design concept.
I have a report that has a static custom page size (in centimetres), interactive size and no margins (12.8 x 17.8cm).
The body size is deliberately set to make it a two page report (2 x the page height).
'ConsumeContainerWhiteSpace' on the report properties is set to true.
Page 1 has an image, consuming the entire space of Page 1 (size of 12.8 x 17.8), with a Text box placed near the bottom right of the image (overlaying it, but not exceeding the width or height of the page, and is set to not grow).
Page 2 is exactly the same, with the content starting where Page 2 would and should start (0, 17.8). However, the Page 2 content is set to hidden (hidden = true, on both the image and the textbox).
When previewed, the report renders two pages, one of which is blank.
If I take the Page 2 content textbox off, and preview it, the report renders as one page (as I need it to).
The same issue occurs if I replace the textbox with a Rectangle or Tablix (the two objects I really need to use in this report as well as the textbox located where it is) and set them to hidden.
Moving any of these objects to the top of Page 2, still results in the same behaviour.
It seems that certain objects, despite being hidden, have space allocated that can't be 'rolled up / truncated / shrunk'. Is this 'by design behaviour'?
Is there some form of magic-witch-craftery I'm missing here to get this to work, or simply something I'm not understanding... ?
Thanks for reading!
Note: So far I have tried the 'Switch to inches, then back to centimeters' solution mentioned in other posts along these lines, have varied 'Keep together' properties, checked 'CanGrow' and 'CanShrink' property changes - all of which have not helped find a solution.
The report body should be set at most wide enough to fit on your output page and long enough to hold all your report items. When you want different items to appear on a new page, put them in a container with a page break set either before or after (whichever is most appropriate). This can also be handled in a data driven manner using page breaks on table groups.
There is no requirement to have white space within your report design to 'fill up' the rest of the page on the rendered report.
If you want anything to appear at the bottom of the report, simply put it in the footer section. If you want specific things to appear at the bottom of the page of different heights on different pages, that is more of a challenge and will usually require some clever data driven spacers within the report body.

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.

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

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)

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.

Report Services: Controlling page breaks inside a table

I'm using a table on my report to present the data. Since it was a lot of data and I wanted to print the report on a A4 page, I split each row into 3 different rows.
My problem is when the report goes to the second page, I want it to break before or after the 3 rows.
example:
name age
address
contact
name age
address
contact
name age
address
* page break *
contact
this is what normally happens. I want to ensure that the page break only happens on the lines.
There are multiple strategies to follow:
The KeepTogether is useful in this case
If you want it to fit on one page only try adjusting page margins, padding, font size, line height to make the report render more compactly
Another alternative is to create a table group on the person, and from the group properties (edit group) check the page break at end property. this way you can have each group on a separate page
Hope this helps
I'm ended up creating a subreport to represent each item.
I looked for the KeepTogether property but that's probably only for reporting services 2008 (I'm using 2005).
If you have the table in a subreport, you must also Right Click -> Format Object -> Uncheck Keep object together.
This was the step that did it for me after I unchecked Keep object together on the table and the subreport details.
I had the same problem, tried 'Keep together' and it didn't work. After a long time of changing and trying many things the one thing that did the job was reducing the bottom margin of a page.