Print Page | Close Window

CrystalReportViewer (11.5.3700.0) 'shrinks' report

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=882
Printed Date: 28 Apr 2024 at 9:49pm


Topic: CrystalReportViewer (11.5.3700.0) 'shrinks' report
Posted By: N11689
Subject: CrystalReportViewer (11.5.3700.0) 'shrinks' report
Date Posted: 19 Jun 2007 at 12:04pm
We develop our reports in Crystal XI developer.  We do NOT embed our reports in our VB.NET application.  We use our VB.NET application to execute our reports. 
 
I have our VB.NET app calling the CrystalReportViewer.  The report comes up in the viewer(preview), but the entire report is 'condensed' it seems to have a 1-inch margin all around it, and if I print from the viewer I get the same results on the printed copy.  This is causing data on the report to be truncated.  If I run the report (Refresh) the report in Crystal XI Release 2 it looks just fine and prints fine.
 
How can I get the CrystalReportViewer to fill the viewer with the report without any margins?  Thank you.



Replies:
Posted By: hilfy
Date Posted: 21 Jun 2007 at 4:40pm
When you developed your reports, what page margins did you set?  Under Page Setup, have you turned on "No Printer"?  That might help.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: N11689
Date Posted: 22 Jun 2007 at 5:59am

We develop our reports with the No Printer option not selected.

To test, I modified a report and selected (checked) the No Printer option.  I saved the report and ran it through my vb.net app again.  Same results.  If I could attach a screen shot, I would, but I'm not sure how or if you can do that in this forum.
 
Thanks.
 


Posted By: N11689
Date Posted: 30 Aug 2007 at 6:51am
I found the problem to this.  The reportdocument object model's printoption.copyfrom method was setting the report's page margins incorrectly.  I don't know why, exactly.
We created two objects
objPrinterSettings As New System.Drawing.Printing.PrinterSettings &
objPageSettings As New System.Drawing.Printing.PageSettings
 
We were settings these values based on the default printer.  Margins were fine.  We used the copyfrom command
rptDocument.PrintOptions.CopyFrom(objPrinterSettings, objPageSettings) and this was resetting the rptDocument's page settings incorrectly.
 
To correct.  Created a new object, objRptPageMargins as CrystalDecisions.Shared.PageMargins  Then before the CopyFrom method, set the objRptPageMargins' top, bottom, left and right margins equal to the rptDocument's page margins.   After the CopyFrom method, used the rptDocuments applymargins method to apply the objRptPageMargins back to the rptDocument.  The margins are now correct.

rptDocument.PrintOptions.ApplyPageMargins(objRptPageMargins)




Print Page | Close Window