cancel
Showing results for 
Search instead for 
Did you mean: 

The CR 2010 for VS engine changes the margins and scales the report

Former Member
0 Kudos

The CR 2010 for VS engine changes the margins and scales the report but only when printing.

Environment:

OS: Windows 7 x64 / Windows 2008 x64

VS: VS 2010 x64

CR designer: CR 2008 SP3.5

CR engine: CR 2010 for VS SP1

We have upgraded the Crystal Reports engine from version 10 to u201CCrystal Reports 2010 for VSu201D and are now having major issues with printing reports to preprinted papers, giro forms etc. because the report margins are changed and the reports are scaled (when report elements are in non-printable area?). Reports with elements in non-printable area are shown correctly in print preview (CR 2010 CrystalReportViewer) but moved to printable area when printed. This behavior was different in CR 10. Changing the PrintLayoutSettings in code is ignored when printing.

Error u2013 The printed reports are scaled:

- Print in the CR 2008 Designer SP2

- CR 2010 for VS SP1

OK u2013 The reports are not scaled:

- Print in the CR 2008 Designer SP3.5

- Print in the CR 10 Designer

- CR 10 engine

Test:

1) Crystal Reports Designer 2008 (with SP 3.5)

a) Create a new blank RPT file.

b) Set report margins to 0,0,0,0 in Page Setup.

c) Add a box in the upper left corner (x=0, y=0).

d) Select "Print preview" and validate that the box is located in 0,0 in preview window.

e) Select u201CPrintu201D and validate that the box is located in 0,0 of the paper. Some of the box borders might be outside of the printable area but that is ok.

2) Visual Studio 2010 and u201CCR 2010 for VSu201D with SP1:

a) Create a new Windows Forms Application project (.NET Framework 4.0). Set project to u201C.NET Framework 4.0u201D and platform target u201Cx86u201D.

b) Add the CrystalReportViewer control to Form1.

c) Add the RPT file to the CrystalReportViewer control

d) Run the application

e) Validate that the box is located in 0,0 in the CrystalReportViewer control.

f) Select the "Print" icon in the CrystalReportViewer

h) Click the "Print" button and validate that the box is moved to the printable area which is wrong.

Notice: In the print dialog (CR 2010 for VS) select the "Layout" tab page and see that "Scale u2026" is selected and cannot be changed. This is different from the CR 2008 Designer even though that it is the same report file and printer.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

.

Former Member
0 Kudos

Is there any news about this?

I'm opening the reports with openDocument.aspx. Adding the registry key doesn't work for me.

I've tried this:

- load the report with de viewer

- export it to PDF. NO adjust, no fit, no reescale... 100% Size

- save it in my computer

- open the report whit adobe reader and print it with my SO print control (no fit, no scales, etc.).

It works, but this is it is not acceptable to the clients. It's a very complicated workaround to them.

Thanks

0 Kudos

I suggest installing the latest SP 16 and see if that resolves the issue. Lot's of update in SP 13 for handling printing.

Don

Answers (1)

Answers (1)

0 Kudos

Printer functionality has changed as of CR 2008, you now have the option to set orientation by section. And placing objects outside of the printable area may have worked in CR 10 but with the changes it no does.

Go to Printer Setup page and check the Dissociate... In code you can set it also to true or false and test again.

Also search here on PrintOutputCotroller and you'll find examples of how to manage your printers in this version.

Thank you

Don

Former Member
0 Kudos

Hi.

I have tried every piece of example code (DissociatePageSizeAndPrinterPaperSize, PrintLayoutSettings, PrintOutputController.ModifyPageMargins etc.) on your site.

Please try the steps I wrote in the first post. It takes 1 minute to reproduce the bug.

former_member183750
Active Contributor
0 Kudos

I have done the requested test (and more - see below) and can not reproduce the issue.

Tests done

1) Crystal Reports Designer 2008 (with SP 3.5)

a) Create a new blank RPT file.

b) Set report margins to 0,0,0,0 in Page Setup.

c) Add a box in the upper left corner (x=0, y=0).

d) Select "Print preview" and validate that the box is located in 0,0 in preview window.

e) Select u201CPrintu201D in the CR designer. Results in the box printing at 0,0 coordinate of the paper.

f) Repeat all of above with a text field report

g) Select u201CPrintu201D in the CR designer. Results in the text printing at 0,0 coordinate of the paper.

2) Visual Studio 2010 and u201CCR 2010 for VSu201D with SP1:

a) Create a new Windows Forms Application project (.NET Framework 4.0). Set project to u201C.NET Framework 4.0u201D and platform target u201Cx86u201D.

b) Add the CrystalReportViewer control to Form1.

c) Add the RPT file to the CrystalReportViewer control

d) Run the application

e) Validate that the box is located in 0,0 in the CrystalReportViewer control.

f) Select the "Print" icon in the CrystalReportViewer

g) Click the "Print" button

h) Text filed report test results in the text printing at 0,0 coordinate of the paper.

i) Box report test results in the text printing at 0,0 coordinate of the paper.

3) VS2010 IDE

a) Create a new blank RPT file.

b) Set report margins to 0,0,0,0 in Page Setup.

c) Add a box in the upper left corner (x=0, y=0).

d) Preview report in the ID designer and validate that the box is located in 0,0 in preview window.

e) Select u201CPrintu201D in the IDE designer. Results in the box printing at 0,0 coordinate of the paper.

f) Run above report in code

g) Preview report and validate that the box is located in 0,0 in preview window

h) Select the "Print" icon in the CrystalReportViewer

i) Click the "Print" button

j) Text filed report test results in the text printing at 0,0 coordinate of the paper.

k) Repeat all of above with a new report that uses a text field rather than a box.

None of my reports have the option "No Printer" checked.

All of my reports have the option "Dissociate Formatting Page Size and Printer Paper Size" checked

From the above, you can see that all of the printing tests result in consistent printing, be it a report created in CR 2008 or CRVS2010, useing a box or a field. No difference in printing.

Suggestions:

1) I am not sure if you have followed the steps you recommended. E.g.; are you creating a new report or using your existing report? See if following the steps described reproduces the issue (it may be there is something specific to your existing reports)

2) Make sure you have the latest printer driver available for your printer

3) Try a different printer

4) Add a report to the VS2010 IDE and preview the report in the IDE of VS2010

5) Compare the "No Printer" and "Dissociate Formatting Page Size and Printer Paper Size" options

6) Consider creating a phone case so a support technician can troubleshoot the issue with you

- Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

Thanks for the help. I have tried all that you have suggested but without a successful result. I have found some differences that might give you some clues.

- Have in mind that printing from the CR 2008 Designer SP3 works (like in CR 10). It doesnu2019t work with SP2 so a bug must have been fixed in SP3 or SP3.5.

- The same report with u201CDissociateu2026u201D checked isnu2019t printed correctly in the SP 2008 SP3 Designer.

- I have found a different behavior between the print dialog that is called from the CR Designer in the VS IDE and the print dialog that is called from the CrystalReportViewer control.

o VS IDE: The check boxes u201CDo Not Scale Report Pageu201D and u201CCenter the Pageu201D are selected and disabled.

o CrystalReportViewer: u201CLayoutu201D tab page: u201CScale Report Page to Fit Printer Pageu201D and u201CCenter the Pageu201D are selected and disabled.

- Same scenarios if the report file is created in VS or the CR 2008 Designer.

- What type of printer are you using? I have only access to laser printers. You might be testing a printer with a larger printable area.

former_member183750
Active Contributor
0 Kudos

In Page Setup, make sure the option Dissociate Formatting Page Size and Printer Paper Size is disabled (no check mark). And test to see if this helps.

- Ludek

Former Member
0 Kudos

"Dissociate Formatting Page Size and Printer Paper Size" is unchecked.

- The print is correct if "Microsoft XPS Document Writer" or "Cute PDF Writer" is selected in the CrystalReportViewer print dialog.

- I installed "CR 2008 for VS" and the same application, report and printer works fine, but this version is missing some export features that we would like to use.

I'll create a bug report.

Former Member
0 Kudos

For your information: It's a bug.

This error is already reported: 1563479 - Page Scaling issue when printing from the .NET Winform Application (CR 2008 for VS) and accepted as a bug.

I would like to add a note to the Product Error report that a bug fix for CR 2010 for VS is also required.

How do I get hands on the bug fix as soon as possible?

former_member183750
Active Contributor
0 Kudos

See:

- Ludek

Former Member
0 Kudos

I have read the blog article and understand now the technical reasons for the difference in printing in the CR Designer and from a .NET application. But as a customer of your product I must state that it's unacceptable for us.

Trevor Dubinsky (SAP): If printing on pre-formatted forms concider not printing directly to the forms but scanning the forms and adding it as a background image in the report, then aligning the fields to the background image. If the report is aligned differently fields and the image should realign uniformly.

The above suggestion will for example not work where customers must print on a pre-formatted giro form that later must be scanned by an external system. These reports must not be scaled. We have several other examples of pre-formatted reports and pre-printed paper with company logo etc.

We have thousands of customer reports that are printed correctly with CR10 so we have now rolled back to CR 10 in our latest product version and looking forward to a fix in the next CR 2010 for VS service pack.

0 Kudos

Hi All,

We've discovered a new registry key that may help resolve this. You have to use the key tree for your version but try this:

[ H K E Y _ L O C A L _ M A C H I N E \ S O F T W A R E \ B u s i n e s s O b j e c t s \ S u i t e 1 2 . 0 \ C r y s t a l R e p o r t s \ D e s i g n e r O p t i o n s ]

" D e a l W i t h M i n i m a l M a r g i n s W h e n P r i n t i n g " = " 0 "

It may not work for CR for VS 2010 but let us know and we'll make sure it gets into SP2, or try to.

Don

Former Member
0 Kudos

Thanks for the suggestion. But we have in the meantime rolled back to CR 10 for all developer environments, so I can't at the moment spend a day installing and testing your latest suggestion. The error scenario is clear and described above in steps. If a report element is tried printing in a non-printable area (and laser printers have different printable area) then the report is scaled. The print out must not be scaled.

We have created a "SAP Error Report" and are waiting for a workaround.

Former Member
0 Kudos

hello i encounter exactly the same issue and the workaround of adding the register key (hkey...) dose not work for me.

I'm using the most recent 13.0.2 version (SP2)

like it have been said before ,while printing the report a scaling is forced by the system with no control by me.

it is really important that i could print with out scaling since i need to set objects in a spesific location (on the page) regardless of minimal margins that set by the printer.

any help \ workaround will be appreciated.

0 Kudos

Hi Gooli,

SP 2 is not the most recent. SP 5 is now available.

http://scn.sap.com/thread/1952705

Thanks

Don

0 Kudos

Hi all,

I am working with the last version (13.0.7) and the problem is still there...

Are you trying to find a solution or we should assume that this problem will never be solved?

Thanks in advance,

Aitor

0 Kudos

The registry keys work. You need to do more debugging.

0 Kudos

Hi Don,

Thank you very much for your reply.

I have used the solution you wrote on this thread:

http://scn.sap.com/message/10585416

but I still have some problems. When I use CR 2010 that key works perfectly and the page is not scaled. However, we are using CR 2008 SP4 in our final product and that key is not working for me.

Which is the key I have to create for CR 2008?

Thanks in advance,

Aitor

Edit:

I have also tried adding the following registry keys but no one worked for me:

HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\DesignerOptions

HKEY_CURRENT_USER\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\DesignerOptions

HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Crystal Reports\DesignerOptions

HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\DesignerOptions

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\Crystal Reports\DesignerOptions

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\DesignerOptions

In addition, I do not know if it is relevant or not, but I did not have any "Business Objects" folder below 'HKEY_LOCAL_MACHINE\SOFTWARE' so I had to create the rest of the path.

0 Kudos

Hi Don,

Excuse me for my insistence but this is a critical problem for some of our clients since they need to print labels without margins. They are complaining because this was working fine with our last version (which used CR 11) but not with the current one.

As I said in my previous post, I was able to solve the problem using CR2010, but unfortunately we are currently working with CR2008 SP4 and if it is possible we would like to continue with it.

Could you please tell me if it is possible to solve the problem in that version? If yes, which is the key I have to add to the register in order to solve it? If not, would it solve the problem if we update to CR2008 SP5 or SP6? Or do we need to go to CR2010 anyway?

Thank you very much in advance,

Aitor

0 Kudos

for CR 2008 use this tre structure:

HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports

Don

0 Kudos

Hi Don,

Thanks again for your reply. The key that has finally worked for me is:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\Crystal Reports\DesignerOptions

However, at least in my case, that key has no effect when I print from the Crystal Report Viewer, and the only way to do it work is using RAS. This means that if I want to print from the viewer, I will have to catch the print event or add my own button to print.

Thank you very much for your help Don.

Best regards,

Aitor

0 Kudos

Great, use ProcessMonitor when using the veiwer print button and see if or where it's trying to read that key from.

If not, search, there is a smaple on how to replace the viewers print button with your own code.

Don

0 Kudos

Hi Don,

I have installed ProcessMonitor and after doing some tests I would say that the CR2008 viewer is not trying to read any key from the registry. I have attached an image where you can see that the CR2010 viewer (on the rigth) has read the registry key before printing but those lines are missing when I print from the CR2008 viewer (on the left).

Does this mean that the CR2008 viewer will never read that key from the registry? Did you manage to print without scalling from your CR2008 viewer or do I have to use RAS to avoid this problem anyway?

Thanks in advance.

Aitor