cancel
Showing results for 
Search instead for 
Did you mean: 

Viewer VS2010 Automatically Adding Margin

Former Member
0 Kudos

The Viewer in VS2010 is padding a line's worth of space to the top and bottom of reports.  As a result our clients are not able to print W2's and 1099's as the text at the very top and very bottom is being pushed toward the center by about a quarter of an inch.  I tried updating the runtime to the 13.0.4 from 13.0.2 that we currently use and it still has the issue.  If you run the report directly out of CR X, CRXI, and CR2011 it works fine and the text lines up in the positions correctly.  Its almost as though a line worth of space from the page header, and page footer is always being displayed even though the report says to suppress those sections.  I did find another posting on the SAP community that its a known issue for web apps, and that runtime 13.0.5 is supposed to address the issue but hasn't been released as of yet, but has anyone been experiencing the same issue with a win app?  We've got several hunderd customers going to need to print their W2's and 1099's, so we're trying to find a solution for this. 

*Update*  Broke out the ruler to measure to see what's going on.  The report was designed in CR 2011.  The report header/footer and page header/footer are all supressed.  The data is pulled in from tables and layed in the appropriate position to fill in the correct positions on the form when printed.  The margins on the page setup are set to 0 all around, top,bottom,left,and right.  The top of the first field being the social security number should appear at just a tad over 1/2 inch from the very top of the page.  Which it does in the designer, left/right position is no concern as no hroizontal shifts appear to be occurring only vertical.  When you send to to viewer and select the print button, default one built onto viewer control toolstrip, and take measurements, the top of the social security number field is starting a just a tad over 1 inch.  The same thing is happening from the bottom.  It looks like a .25 inch margin or pad of space is being added to the report on the top and bottom.  We're able to duplicate here on our local develpment environment and being reported now by many of our customers as many of them are beginning to prep their W2's. 

As a temporary solution we have customers using the old Crystal XI viewer we have in VB6 as when you run the report through it, it works fine.  So, we've now confirmed if you run the report directly out of Crystal X, Crystal XI, Crystal 2011, and the old XI viewer it works correctly and all the text is fine. 

I would assume that the VS2010 VB.Net viewer would use whatever margin settings that are defined within the report unless otherwise overwritten.  I just want to confirm there's noting programmatically we are supposed to do to make it honor margins of the report when we load them?

*Update* Just updated to the 13.0.5 SDK and recompiled the viewer program.  As well as installed the 13.0.5 runtime.  The padding of space is still occurring.  Its exactly a .5 inch of space being added to the top and the bottom only when its being printed out of the viewer for VS2010.

*Update/Problem/Workaround*  Found the problem and how to duplicate it and work around it for now.  In CR2011 and in the Page Setup of the report, we have the margins manually defined as 0 for Left, Right, Top, and Bottom.  We have the checkbox, "Automatically Adjust" unchecked.  When you load the report to the viewer, you can already tell the text is off before you even print it, but if you print the text is off by .25 of an inch.  So, if you go back into CR2011 and open the report and change the margin in Page Setup for the top to give it a margin, we experimented with this and you have to give it a significant number. If you type .001, doesn't work you still get an added .25 margin added to the report, if you type .01, doesn't work you still get an added .25 margin added to report, if you type .1 or something higher then the margin is actually viewable in the viewer, as you can click on it and it will show the line where the margin object is marked, then the .25 margin that was automatically be added disappears and your text "magically" moves .25 inch further back towards the top of the page.  We moved our fields to compensate for the new margin and now the text prints in the correct spaces everytime.

So, in a nutshell it appears that the Viewer control in VS2010 adds a .25 inch margin by default if the margin manually specified on the report is less that .1 inch in size and you do not have the option selected to "Automatically Adjust".  As a workaround if you define a margin of at least .1 or something significant enough that the viewer registers it, then move your fields to compensate for the new added margin, it works fine and the text aligns properly in the positions defined in the designer. 

Message was edited by: Mitch Atchley

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Mitch

You may also want to look at the following to resolve the issue:

Enable the "No Printer" option

Enable the "Dissociate Formatting Page Size and Printer Paper Size" option

Make sure that you are using the same printer in the app as in the CR design stage.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Thanks Ludek, I found another post mentioning the same items and also tried those during my troubleshooting to no avail.  It wasn't until I manually changed the margin size in the designer was I able to finally get it to print in the correct position every time and the viewer quit apparently adding a .25 inch margin to the page.  We have hundreds of reports in our software package's deployment and we didn't notice an issue till people started having to do their W2's and 1099's and the fields weren't lining up anymore and upon further research any governmental forms we support that had a margin manually defined as 0 weren't working anymore.  We have the no printer option enabled on our reports as a standard after development, but we didn't have the dissociate option, but it did not resolve the issue. 

It's not that big of deal now, we've modified all of our governmental form reports  to include at least a .1 inch margin and all of them appear to be printing correctly now and the .25 inch of margin that was being added is now gone.  The Crystal XI viewer displays it appropriately, as well as if you print and view it in one of the designers, CR X - CR 2011.  Its only in the .Net viewer are we getting this result.  We also have an old Crystal 8.5 viewer I could break out and try, but we never had any issues in the past.  We've had the new .Net viewer deployed for about 8 months now and we will be EOLing the Crystal XI viewer in the next coming months forcing our customer base entirely over to the .Net viewer.  The big thing as you probably already know, is trying to ensure consistency in behavior from one platform to another.

Thanks,

Mitch

Answers (0)