08-25-2023 09:40 AM
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.
08-30-2023 03:54 AM - edited 10-26-2023 05:35 AM
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
08-30-2023 04:11 AM
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'.