Skip to main content
Newcomer
March 2, 2022

Controlling Font Size Using IF Statement - Cube View Extender

  • March 2, 2022
  • 2 replies
  • 0 views

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. 

2 replies

Newcomer
March 2, 2022

Basically, What function I need to use to grab the report page number as an integer?

Contributor
March 2, 2022

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?

Newcomer
March 3, 2022

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