Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: CrystalReportViewer (11.5.3700.0) 'shrinks' report Post Reply Post New Topic
Author Message
N11689
Newbie
Newbie


Joined: 13 Jun 2007
Location: United States
Online Status: Offline
Posts: 22
Quote N11689 Replybullet Topic: CrystalReportViewer (11.5.3700.0) 'shrinks' report
    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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
N11689
Newbie
Newbie


Joined: 13 Jun 2007
Location: United States
Online Status: Offline
Posts: 22
Quote N11689 Replybullet 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.
 
IP IP Logged
N11689
Newbie
Newbie


Joined: 13 Jun 2007
Location: United States
Online Status: Offline
Posts: 22
Quote N11689 Replybullet 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)

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.