Jump to content

PrintArea XLS with JasperReport 3.7.3 and POI 3.5-FINAL


pvillar

Recommended Posts

Hi,

I created a template JasperReport with Java, using the library of version 3.7.3 and I use to export the library POI 3.5-FINAL.
I would like to get that number of leaves occupied preview xls file width and height
My export function has the following code:

         JRXlsExporter JRXlsExporter exporterXLS = new ();
         exporterXLS.setParameter (JRXlsExporterParameter.JASPER_PRINT, print);
         exporterXLS.setParameter (JRXlsExporterParameter.OUTPUT_STREAM, os);
         exporterXLS.setParameter (JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
         exporterXLS.setParameter (JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
         exporterXLS.setParameter (JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, eliminarEspacios)
         if (filename! = null & & nombreFichero.length ()> 5) {
         exporterXLS.setParameter (JRXlsExporterParameter.OUTPUT_FILE_NAME, filename);
         else {}
         exporterXLS.setParameter (JRXlsExporterParameter.OUTPUT_FILE_NAME, "Report.xls");
         }
         exporterXLS.setParameter (JRXlsExporterParameter.IGNORE_PAGE_MARGINS, Boolean.TRUE);
         exporterXLS.setParameter (JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
         exporterXLS.setParameter (JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, eliminarEspacios)

         if (nombresPestanas! = null & & nombresPestanas.length> 0) {
         exporterXLS.setParameter (JRXlsExporterParameter.SHEET_NAMES, nombresPestanas)
         }

         Object> <string, Map param = new HashMap <string, Object> ();
         exporterXLS.exportReport ();

I have also stated jasperreport.properties file with multiple variables declared as you choose the default font in case of not finding the set, and two variables that should do what I want:

      net.sf.jasperreports.export.xls.fit.width = 8
      net.sf.jasperreports.export.xls.fit.height = 20


But do not work. The file it is taking well as the rest of the variables is reading.
Any suggestions?

 

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...