Jump to content
We've recently updated our Privacy Statement, available here ×

ialonso

Members
  • Posts

    2
  • Joined

  • Last visited

ialonso's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi @shertage, thanks for the link. I'm trying to make the report template again from a new black sheet but I can't find how make reports manually. Do you know some tutorial? Thanks!
  2. I'm new with Jasper Reports. I'm using 5.6.0 version and I can export some data to PDF and all fields are filled correct but when I try to export the same data to Excel, some fields are missing. The code I use it's the some on both clases (I have one class for each file export) I also read that the template to export to PDF or Excel it's the same, so I don't know why fills all in PDF and not in Excel. When I generate the PDF I pass all the data to: JasperExportManager.exportReportToPdfStream(jasperPrint,fileOutputStream);[/code]And when I try to generate the Excel I call this funcion: private void generateExcel(JasperPrint jasperPrint) throws IOException, JRException { JRXlsExporter exporterXLS = new JRXlsExporter(); JFileChooser jFileChooser = new JFileChooser("."); jFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int status = jFileChooser.showOpenDialog(SIXACOPWorkbench.getWorkbenchContext().getWorkbench().getFrame()); if (status == JFileChooser.APPROVE_OPTION) { if (jFileChooser.getSelectedFile() != null) { String pathPDFs = (jFileChooser.getSelectedFile().getAbsolutePath()); File ficheroXLS = new File(pathPDFs+"//testing.xls"); FileOutputStream fos = new FileOutputStream(ficheroXLS); exporterXLS.setExporterInput(new SimpleExporterInput(jasperPrint)); exporterXLS.setExporterOutput(new SimpleOutputStreamExporterOutput(fos)); SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration(); configuration.setRemoveEmptySpaceBetweenRows(true); configuration.setDetectCellType(true); configuration.setWhitePageBackground(false); exporterXLS.setConfiguration(configuration); exporterXLS.exportReport(); fos.close(); } }}[/code]I think that if the template it's wrong the PDF must generate wrong but the output it's correct. And the code it's the same for both, only changes the call to the function that exports. So, what I'm doing wrong when exporting to Excel? Regards.
×
×
  • Create New...