cancel
Showing results for 
Search instead for 
Did you mean: 

Set "page setup" -> Margins-> "adjust automatically" programmatically

Former Member
0 Kudos

Hi,

Is it possible to set the option "File" -> "page setup" -> "Margins" -> "adjust automatically" from the code...before printout ?

Maybe this is done only in the Crystal tool...but I want the same result on my templates.

Rgds,

Lars

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Lars;

No, I do not see any option to adjust the margins automatically via our SDK. Have a look at the SDK library here:

https://boc.sdn.sap.com/node/11690

Regards,

Jonathan

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks alot for the answers!

I have alot of templates made in old versions of CR(some of them behave strange when we changed to CR 12 runtime...not correct margins), I hoped that i could convert all with a home made tool.

Rgds,

Lars

0 Kudos

That functionality is only in the Crystal Report Designer. It should therefore work if you set that option for each report when designing the report.

What happens is we query the default printer and retrieve the printers margins and thena djust the page accordingly. This is all done within the crw32.exe using a combination of our API's and Windows API's.

To do so you need to use the RAS server which will require the full developer version of CR Designer, the parts included with .NET is CR Basic and does not include RAS.

Using the RAS API's with this function will allow you to set the margins after you query the printer driver for it's margins: CrystalDecisions.ReportAppServer.Controllers.ISCRPrintOutputController.ModifyPageMargins(int, int, int, int)