Skip to Content
author's profile photo Former Member
Former Member

VS 2010 Upgrade Hell

I'm having the same problem mentioned in this thread:

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

When I upgraded to VS 2010 I had to upgrade from CR 2008 to CR 2010 for VS. Now I have a report which is designed to print pre-formatted labels and it won't work unless I manually change the page scaling in the printer dialog box to "None". In the past, this was not a problem. The previously mentioned article talks about ways which would seem to let you control this programatically but in the end it seems to be concluded that this behavior is by design, not a bug.

So what do I do about my labels? Am I forced to change the page scaling manually or is there a way to turn it off programatically?

Assuming that this problem isn't going away, I'm going to have to go back to CR 2008, which isn't designed to work with VS 2010. What are my options there? I had initially intended to use CR 2008 and "upgraded" to CR 2010 when I found that things didn't really work right with CR 2008 and VS 2010. For example, intellisense doesn't recognise the reports any longer.

What are my options?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Aug 27, 2011 at 10:03 PM

    Have a look at that post again. I added a reg key that works for CR 2008 but not sure if it works in 2010.


    Add a comment
    10|10000 characters needed characters exceeded

    • Solution:

      Hi All,

      Thanks for waiting. I have the info now...

      It is fixed in CR 2008 as well.

      This should work also for CR for VS 2010 now, SP is not required, add this key to your PC's:

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


      Key=0 => minimal margins

      Key=1 or delete key => large margins

      As well here the sample code and note the PrintToPrinter does NOT read this key, you must use RAS:

      For Winform Viewer, it will not impacted this fix... in CR.Net SDK, if user used reportdocument print function like:
      reportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
      reportDocument.PrintToPrinter(1, true, 1, 1); 
       or they tried to print via CrystalReport Winform Viewer
                  reportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                  this.crystalReportViewer1.ReportSource = reportDocument;
      Even by setting the following registry key to u201C0u201D, the print out page will be large margin.
      [HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Crystal Reports\DesignerOptions]
      However if you using RAS.Net SDK to print like following code, it will be affected by the fix:
                  ReportDocument reportDocument = new ReportDocument();
                  reportDocument.Load(@"C:\Users\Administrator\Documents\Visual Studio 2008\Projects\CrystalReportsApplication1\CrystalReportsApplication1\CrystalReport1.rpt");
                  reportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true; // Please note that, this code is does nothing. The only impacting to print result is the registry key.
                  CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions printReportOptions = new CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions();
                  printReportOptions.AddPrinterPageRange(1, 1);
                  printReportOptions.PaperSize = CrystalDecisions.ReportAppServer.ReportDefModel.CrPaperSizeEnum.crPaperSizePaperA4;
                  printReportOptions.PrinterName = @"\\CNPVGL002\CN64_BW";
                  CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc = reportDocument.ReportClientDocument;

      Thank you


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.