Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Margins in Preview?

Status
Not open for further replies.

JockePocke

Programmer
Mar 25, 2002
4
SE
Hello everybody.

I'm working with the RDC component as a printing tool for a system I'm developing.

Does anyone know of a way to let the end user change the margins of a report when the report is being shown?

I know that you can manipulate the TopMargin property of the Report object. But the effects aren't shown on the preview.

Any input would be appreciated.

/Joacim Gustavsson
IBS Konsult AB - Sweden
 
I make use of setting the 'TopMargin' and the 'LeftMargin' such that the user can indicate the values for these to best position the body of the report in the printed page.
I can't recall if this has any impact on the previewed report - but I've had no complaints on the version of the application.
Steve
 
I've revisited the code in question.
I use Delphi 5 and make use of the CRViewer component for the previewing of the Crystal Reports.
I use the syntax :
'CRReport.Set_TopMargin(x)' and
'CRReport.Set_LeftMargin(y)'
where x and y are my required top and left margins accordingly. I do this before I set the ReportSource for the CRViewer and call 'ViewReport'.
When looking at the Crystal Report in the 'CRViewer' I do see that the margins have been set accordingly. The values are in twips (1 inch = 1440 twips) so you might need to crank these values up to see the margins change.
Admittedly this is Delphi code and might differ to the language you have chosen to use.
I hope that this is enough to get the answers you need.
Steve
 
Thank you for your input Steve.

I think I have got it to work now. When the Report already was loaded I let the user change the margins after that I save the report and then reload it. Maybe not the best solution but it'll do for now.

/Jocke



 
This was solved by the RefreshEx method in version 8.5 of the RDC. Now everything works as I want it to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top