cancel
Showing results for 
Search instead for 
Did you mean: 

VS 2010 Upgrade Hell

Former Member
0 Kudos

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

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?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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.

Don

0 Kudos

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]

"DealWithMinimalMarginsWhenPrinting"="0"

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;
            this.crystalReportViewer1.PrintReport();

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]
"DealWithMinimalMarginsWhenPrinting"="0"


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;
            rptClientDoc.PrintOutputController.PrintReport(printReportOptions);


Thank you

Don

Answers (0)