0

Here is my code which provides sum of columns in footer.

drb.addGlobalFooterVariable(totalAmount, DJCalculation.SUM);
drb.addGlobalFooterVariable(basicAmount, DJCalculation.SUM);
drb.addGlobalFooterVariable(cgstColumn, DJCalculation.SUM);
drb.addGlobalFooterVariable(sgstColumn, DJCalculation.SUM);

But i don't know how to add styles to these footer variables. Also is it possible to resize fonts of entire report?

Alex K
  • 22,315
  • 19
  • 108
  • 236
  • The answer on your [first question](https://stackoverflow.com/q/49623525/876298) contains all you need – Alex K Apr 08 '18 at 06:20

1 Answers1

0

Add styles in footer variables

Style style = new StyleBuilder(false).setFont(Font.ARIAL_SMALL)
         .setHorizontalAlign(HorizontalAlign.RIGHT).setBorderBottom(Border.THIN())
         .setVerticalAlign(VerticalAlign.MIDDLE)
         .setPadding(new Integer(0))
         .setStretchWithOverflow(false)
         .build();

drb.addGlobalFooterVariable(totalAmount, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(basicAmount, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(cgstColumn, DJCalculation.SUM, style);
drb.addGlobalFooterVariable(sgstColumn, DJCalculation.SUM, style);

Also use style to resize fonts.

Style style = new StyleBuilder(false).setFont(new Font(18, Font.ARIAL_SMALL, true)).build();
  • Hey thanks. I got it. But i cannot change the font size of data in each column. I tried your method and it looks like it only changes font size of title, subtitle, and Column title but not the data in the column. Is i t possible to change font size of data in the column? – Preciso Sensedge Apr 08 '18 at 06:13
  • use `setStyle(StyleBuilder style)` sets the column value style – Salim Ahmed Apr 08 '18 at 06:26