Setting PageMargins for Reports

Discussion forum about all things Report Builder (all versions).
HansDanzl
Austria
Posts: 35
Joined: 04 Oct 2017, 13:34
Location: Austria

Setting PageMargins for Reports

Post by HansDanzl » 10 Jul 2009, 02:29

i create a report with salreportprint and want to change the bottom-margin for the report (predefined in a. .qrp-file).
can you give me some code samples to use the functions for this purpose (GetPageMargins/SetPageMargins from reportbuilder.apl)

thanks

hans danzl
eurotours, austria

HansDanzl
Austria
Posts: 35
Joined: 04 Oct 2017, 13:34
Location: Austria

Re: Setting PageMargins for Reports

Post by HansDanzl » 20 Jul 2009, 22:41

is there really nobody out there who uses the functions "GetPageMargins" and "SetPageMargins" (from reportbuilder.apl) to change the bottom-margin for a report under certain conditions?
:(

Mike Vandine

Re: Setting PageMargins for Reports

Post by Mike Vandine » 24 Jul 2009, 15:42

Hi Hanz,

Let me check this out and get back to you.

Best regards,

Mike Vandine

Re: Setting PageMargins for Reports

Post by Mike Vandine » 26 Jul 2009, 18:37

Hi Hans,

As a base, I used the ReportBreakGroupTutorial.app from the Samples. In the main report (frmReport), I set up 5 variables:

Number: nLeft
Number: nRight
Number: nBottom
Number: nTop
Number: nReturn

Then in the report procedural code I did a:
Call axReport.GetPageMargins( nTop,nLeft,nBottom,nRight,nReturn )
Set nTop=nTop+500
Set nLeft=nLeft+500
Set nBottom=nBottom+500
Set nRight=nRight+500
Call axReport.SetPageMargins( nTop,nLeft,nBottom,nRight,nReturn )
Call axReport.GetPageMargins( nTop,nLeft,nBottom,nRight,nReturn )

The first GetPageMargins showed the default of 1000 for top and bottom and 1250 for left and right. After doing a SetPageMargins and then another GetPageMargins, the margins had been set to 1500 and 1750 respectively.

Hope this helps!

Best regards,

Mike

HansDanzl
Austria
Posts: 35
Joined: 04 Oct 2017, 13:34
Location: Austria

Re: Setting PageMargins for Reports

Post by HansDanzl » 26 Jul 2009, 23:15

Hi MIke,

thank you for the help.

I previously used the wrong 'instance variable' (not the 'axReport.')

Best regards

Hans

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests