cancel
Showing results for 
Search instead for 
Did you mean: 

Changing fontsize in pivot2 breaks PDF-export

HamzaJ
12 - Data Integration
12 - Data Integration

Hey,

So I used the following widgetscript to alter the font in a pivot-table. In the dashboard these alterations are visible, however when exporting it to PDF the pages are all blank.

 

widget.transformPivot(
  {},
  function (metadata, cell) {
    cell.style = {
      backgroundColor : 'lightgray',
      fontSize : 14,
      fontWeight : 'bold',
      fontStyle : 'italic',
      textAlign : 'center',
      color : 'black',
      borderColor : 'black',
      borderWidth : '3px',
      minWidth : '150px',
      maxWidth : '200px'
    };
  }
);

 

 (https://community.sisense.com/t5/build-analytics/pivot-2-0-manipulating-a-pivot-chart/m-p/3589)

Did anyone experience this aswell? Or perhaps uses a different type of script to alter fontsize and color in  

1 REPLY 1

Sijo1995
9 - Travel Pro
9 - Travel Pro

Hi @HamzaJ ,

 

Please try this script

widget.transformPivot({
	type: ['member','value']
}, (metadata, cell) => {
	const { columns, rows } = metadata;
	const isRowHeader = rows && rows.some(row => row.title === cell.content);

	// is header
	if (isRowHeader || columns && !rows) {
		cell.style = {
			fontWeight: 'bold',
			color: '#132f57',
			backgroundColor: '#e2e9ec',
			textAlign: 'center',
			whiteSpace: 'normal'
		}
		
		// is row
	} else {
		cell.style = {
			fontWeight: 'bold',
			color: '#132f57'
		}
	}
	//cell.style.whiteSpace= 'normal'
});

 

Thanks

Sijo