on 08-26-2013 7:04 PM
Need help with determining how to disable Scale Report Page to Fit Printer Page for VB.NET because all my crystal reports print outs are smaller than how they use to print after upgrading to Crystal Reports XI SP4. I have coded the program to not scale during run-time but nothing seems to make a difference in terms of disabling the Scale Report Page to Fit Printer Page.
Dim printPrompt As New Windows.Forms.PrintDialog
printPrompt.PrinterSettings = New System.Drawing.Printing.PrinterSettings
printPrompt.AllowSomePages = True
Dim oLayout As New CrystalDecisions.Shared.PrintLayoutSettings
oLayout.Centered = False
oLayout.Scaling = PrintLayoutSettings.PrintScaling.DoNotScale
Dim margins As PageMargins
margins = rpt.PrintOptions.PageMargins
margins.bottomMargin = 0
margins.leftMargin = 0
margins.rightMargin = 0
margins.topMargin = 0
rpt.PrintOptions.ApplyPageMargins(margins)
rpt.PrintToPrinter(printPrompt.PrinterSettings, printPrompt.PrinterSettings.DefaultPageSettings, False, oLayout)
As far as I know, this works fine with SAP Crystal Reports, developer version for Microsoft Visual Studio (2010 / 2012) - reference KBA 1836340. I do nto remember if there were any issues with this in CR XI, however I would highly recommend upgrading to CR XI R2, Service Pack 6. See this blog on how to.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My apologies, I'm actually using 13.0.2000.0 SAP Crystal Reports for .NET Framework 4.0 SP6 Runtime files and SAP Crystal Reports, developer version for Microsoft Visual Studio 2010 version 13.0.6.1027. I uninstalled the newest version and installed CR XI R2 Service Pack 6 but was unsuccessful due to the fact that my reports have already been upgraded to latest version.
I was not successful with making the code work with VB.NET
Select GetPreviewPagesStartwith.Text
Case "Full Size"
PrintLayout.Scaling = PrintLayoutSettings.PrintScaling.DoNotScale
Case "Fit Width"
PrintLayout.Scaling = PrintLayoutSettings.PrintScaling.ShrinkOnly
Case "Fit Page"
PrintLayout.Scaling = PrintLayoutSettings.PrintScaling.Scale
End Select
rpt.PrintToPrinter(printPrompt.PrinterSettings, printPrompt.PrinterSettings.DefaultPageSettings, False, PrintLayout)
Yes, I have removed all the old CR assemblies and have only used the latest 13.x versions. I usually uncheck "No Printer" and select "Microsoft Office Document Image Writer", I have also tried make sure "No Printer" is checked and set the printer to "Microsoft Office Document Image Writer", or Xerox Printer or Dell Printer. The "Scale Report Page to Fit Printer Page" is still greyed out and my code still does not disable option "Scale Report Page to Fit Printer Page".
To rule out my code, I have recreated everything from scratch using a very basic test vb project with the latest 13.x CR assemblies, and just added the CrystalReportViewer control to my form. I then created new blank crystal report and every time I run a test print using the CrystalReportViewer, the "Scale Report Page to Fit Printer Page" is still greyed out.
Is there a way to disable this feature the "Scale Report Page to Fit Printer Page" CrystalReportViewer? Or better yet can you explain to me what causes the "Scale Report Page to Fit Printer Page" and "Center to Page" to automatically be checked and greyed out? I can't seem to find any way to disable the setting because all of my 1000 of Crystal Reports don't line up anymore. I have tried recreating them but by default the "Scale Report Page to Fit Printer Page" and "Center to Page" are checked and greyed out automatically.
Not sure why "Scale Report Page to Fit Printer Page" and "Center to Page" would be checked and grayed out. I am not able to repro it here.
But, make sure you have at least one printer driver installed - a real printer driver. E.g.; PDF printer driver or Microsoft XPS document printer don't count.
- Ludek
Okay I tried with a real printer and confirmed that the print outs are still shrinking and the options "Scale Report Page to Fit Printer Page" and "Center to Page" are still greyed out. What I did notice is that this problem only occurs during run time. When I print the report in the dev environment straight from Crystal reports, the print out comes out exactly the same size. But as soon as I execute the test project, the print outs automatically shrink during runtime. I am using the Crystal Report Viewer default settings and clicking on the print button from the toolbar. The problem occurs during run time and not during design time.
Sorry Ray. I have no idea why those options would be grayed out. Never seen that before...
See if enabling the option "Dissociate Formatting Page Size and Printer Paper Size" will help (Page Setup).
If the Dissociate option does not help, I'd suggest creating a phone support case here:
http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100
- Ludek
Hi Guys,
Scale to fit is for when you, for example, use a custom paper size in a report, say 4 x4 and then try to print to a printer that does not support that size and only has 8 1/2 x 11. The report page is smaller than what has been selected from the printer so now you can scale the output to not scale, the option is no longer grayed out.
The issue is the Framework is scaling the page, we don't have any control over that part. all part of System.Printer properties.
Some current testing suggests setting the report margins to zero seems to be part of the fix. At least it reduces the amount the objects are moved.
It works in CR Designer because CRD does not use the framework to print the report and uses DEVMODE to get the printer properties.
By default I think the framework scales .5% or something like that. You'll notice the very center of the page is exact and the further you move in any direction the more the objects appear to be adjusted.
Trying to find ways to make this work...
Don
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.