SSRS: Export to PDF - Top Margin is too big - reporting-services

I have a report that requires specific formatting so that it can print to a page of Avery labels. I have set up the report to be two tables side by side to represent the two columns of labels. When I export the report to MS Word and print, the items line up perfectly within each on label on the actual sheet. However, when I export to PDF, my top margin is too big so the alignment with the labels on the paper is off. Does anyone know how to make the PDF export respect my top margin?
Page Size: 8.5in x 11in
Margins:
Top = 0.505in
Bottom = 0.3in
Left = 0.24in
Right = 0.31in

SSRS honors two major render formats. First, the soft page-break render includes the report preview, Word, Excel, and HTML and is more designed for reports which are displayed on a screen. To the contrary, the hard page-break format is utilized by pdf and image format among others, and is more designed for physical printing of reports. A soft break render uses InteractivePageSize as a guide for displaying the report and generally ignores the Margin settings; the hard break format adheres strongly to the PageSize settings and also to the Margins.
These are the main features of each one:
Soft page breaks:
Margins are not applied
Inserted, explicit, or forced page breaks are honored
Report sizes can adjust to include orphaned and oversize objects in a report
Hard page breaks:
Pages moves left to right and then top to bottom
Inserted, explicit, or forced page breaks are honored
Items that are set to keep together may still be pushed to a next page if not enough spaces exists
These two render formats are driven by two report properties found in the Page Category section of report properties. The InteractiveSize Width and Height control the size of the soft page-break render formats. When an object is displayed using one of the hard break renderers, then the PageSize and Margins properties are used.

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.

Reporting Services. Different cell width and height

When I use my report on a server, I get normal width and height (CanGrow is True) of the cell.
When I try to save as Excel, I have width of the cell less then I expected.
When I try to save as Word, I have bad cell`s width and height.
Finally when I try to save as pdf, I have normal cell`s width and height, but have a blank page after after each page of the report.
What am I doing wrong?
Exporting SSRS to Excel and Word can produce unexpected (and undesired) behaviours.
Excel
Regarding the export to Excel - according to the answer on this page
Excel itself doesn't really have a concept of CanGrow and CanShrink - rather, all it can do is
keep row heights at a static value (which it will do if both of those properties [CanGrow and CanShrink] are False), or
"snap to fit".
This does mean you are forced, if you want to export the data to excel, to define a static row height for the report
Word
I can recreate your problem - unfortunately this is a "feature" when exporting to Word. The MSDN reference specifically states
Text boxes grow when they contain non-breaking spaces.
PDF
PDFs creating a blank page between report pages is usually an indication that your Report Body is wider than your printed page (in Report Properties). Check your report is not too wide - even if there is no data displayed in the whitespace.

SSRS report extra page

I have modified a sales invoice report of Dynamics AX. When I deploy and open report in Ax it shows that report has 1 page, but if I export it as PDF or if I print it out then it has two page, first page as it should be and second extra page only with header / footer. I tried to reduce size of header / footer but the problem isn't solved and also if I reduce them fields are moved from wanted positioned as we use pre-printed papers to print reports.
How can I get rid off extra unwanted page?
Often I find that problems like this are related to the page size, report size, and margins. Take a look at the Report properties and take note of the page size and margins. Make sure that in the Body properties of your report, the size is less than the difference between the page size and margins.

SSRS limit data size to page size

In SSRS report, the HTML rendering is displaying around 20 records. Now when i generate the PDF, only 5 records are displayed per page. I want that both the HTML renderer and PDF renderer should be same. Is there any workaround for the same?
The different renderers are rendering the report appropriately for their output. The web viewer is optimised for screen-based reading and generally allows more content per page than the print renderer does as the print renderer is constrained by the paper size that it formats to. Thus you get more pages when rendering for printing than web; however, the content of the report is exactly the same.
The best illustration of this is the Excel renderer - the Excel renderer renders the entire report onto a single worksheet in most cases (for reports with grouping and page breaks set on the group footer it will render each group on its own worksheet). You wouldn't want the Excel renderer to artificially create worksheets to try to paginate your report. It does the appropriate thing which is to include all the data in one big worksheet even though that may be logically thought of as one big "page".
The web renderer page length is determined by the InteractiveHeight attribute of the report (in the InteractiveSize property in the Properties pane for the report) but the interactive height is an approximation rather than a fixed page break setting and your page breaks may still not conform to the print version even though the InteractiveHeight is set to the same length as your target page length.
See this discussion of rendering behaviour for more information on why what you are trying to achieve isn't achievable.

SSRS print preview prints on many pages

Im building out an SSRS report for a client and when i build it, seems to be fine. when I print or do a printer preview however, the report and its contents are being printed over 4 pages rather than all on one page. I could use some help as I dont deal with SSRS that much.
Thanks
In the designer you should open the Document Outline view. The basic structure for a report is something along these lines:
Report
-> Body
-> Control / tablix / subreport 1
-> Control / tablix / subreport 2
-> etc
-> Page Header
-> Page Footer
If you select the Report item, the properties pane will show you several important properties:
Page Size (for printing and pdf renderer)
Interactive Size (for other renderers)
Margins
These properties determine on what sizes the report should be printed. If you select the Body item, you will also see a Size property. That size could grow, depending on your tablixes, because they may expand horizontally and vertically.
Basically if your body size is larger than the Page Size (and margins) allow for, the printer will render additional pages. You should play around with those values to fix your issues, I'd think. Looking at your example screens you could start with:
decreasing the margins
changing the page size so it becomes landscape
play around with positioning in the body to fit more content on a page