Controlling Font Size Using IF Statement - Cube View Extender

Mustafa_A
Contributor II

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. 

3 REPLIES 3

Mustafa_A
Contributor II

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

db_pdx
Contributor III

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?

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