I'm trying to automatically create report from an existing jasperreport template, I have already done this with CSV files, this is part of the code for CSV files :
Map parameters = new HashMap();
parameters.put("ReportTitle", "Address Report");
parameters.put("DataFile", name+".csv - CSV data source");
Set states = new HashSet();
states.add("Active");
states.add("Trial");
parameters.put("IncludedStates", states);
JasperPrint print = JasperFillManager.fillReport("../Desktop/Test/"+name+".jasper", parameters, getDataSource(name));
JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "../Desktop/Test/"+name+format.format(new Date())+".pdf");
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
JasperExportManager.exportReportToPdfFile(print, "../Desktop/Test/"+name+format.format(new Date())+".pdf");
but I didn't find anything related to xlsx files or if there are any libraries that can help in this job, if anyone has any help or idea, I would appreciate it
Thank you
Actually I've found the answer, Methods like
setParameters()and others have been deprecated in the newer versions of iReport. If you still want to use it you can download4.5.0libraries or lesser version This website has some good information on how to solve this problem : http://jasperreports.sourceforge.net/sample.reference/xlsxdatasource/index.htmlI hope this may help