03-02-2022 11:15 AM
Good morning,
I have a pdf report that varies in page length, however my department requires it to be all on one page. I was successful in getting everything one page using CV Extender function. But since the font size is static, it minimizes the text regardless of pages.
Wondering if there is way to write a rule that can switch between font sizes. For e.g. IF Page Number > 1, then font size 9. Else, run font size 12.
Any idea will be appreciated.
03-02-2022 01:52 PM
Basically, What function I need to use to grab the report page number as an integer?
03-02-2022 02:12 PM
Unrelated to your question, I'd love to know how you are using a CV Extender to get everything on one page. Can you share?
03-03-2022 12:11 PM - edited 03-03-2022 12:15 PM
The main expressions I are -- GetReportOptions & .FormatReportUIItem. This has a range of formatting functions that can be called. XF Manual (Pg. 336) talks more about it. It pretty cool how much you can customize your report/cv.
Here is the code:
Try
Select Case args.FunctionType
Case Is = CVExtenderFunctionType.FormatReportUIItem
Dim uiItem As CVExtenderReportUIItem = args.Report.CurrentUIItem
If uiItem.UIItemType =XFReportUIItemType.DataCellLabel Then
uiItem.FontSize = 11
Else If uiItem.UIItemType = XFReportUIItemType.RowHeaderLabel Then
uiItem.FontSize = 11
Else If uiItem.UIItemType =XFReportUIItemType.PageHeaderLabelTitle Then
uiItem.FontSize = 15
Else If uiItem.UIItemType = XFReportUIItemType.PageHeaderLabelCenter1 Then
uiItem.FontSize = 10
'
Else If uiItem.UIItemType = XFReportUIItemType.PageHeaderLabelCenter2 Then
uiItem.FontSize = 10
'
Else If uiItem.UIItemType = XFReportUIItemType.PageHeaderLabelCenter3 Then
uiItem.FontSize = 10
End If
Cheers,
Mustafa