Skip to main content
August 25, 2023

How to adjust report margins using Cube view extender rule.

  • August 25, 2023
  • 2 replies
  • 0 views

Hello,

We are having this below requirement, where we trying to achieve this using Cube View extender rules.

Rule should vary margin depending if it's landscape or portrait.

If Landscape, then
Right and Left should be 0.25, Top should be 0.75, and Bottom 0.5
Else If Portrait, then
 Left should be 0.75, Right should be 0.25 with Top and Bottom 0.5 

 

Any help or suggestion will be of great help!

Thanks in advance.

2 replies

August 30, 2023

You might need to experiment a bit, to find the right threshold for you, but this approach might work:

 

Case Is = CVExtenderFunctionType.GetReportOptions

	Dim reportOptions As New CVExtenderReportOptions()
	If args.Report.PageWidthMinusMargins > 1600 Then  	'Landscape
		' set whichever option
		reportOptions.ReportMarginTop = -1.0
	Else	                                                ' portrait
		' set whichever option
		reportOptions.ReportMarginTop = 1
	End If
	Return reportOptions

 

nidhiAuthor
August 30, 2023

We tried your code it's working fine for Top and Bottom, for right and left we are getting this below error:

Error compiling Business Rule 'Test_R'.

1) Error at line 240:  'ReportMarginLeft' is not a member of 'CVExtenderReportOptions'.

2) Error at line 242:  'ReportMarginRight' is not a member of 'CVExtenderReportOptions'.