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

julien.dufee

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by julien.dufee

  1. Hi, I have a problem, when i run my program i have a error. this is my code: protected void onSubmit(AjaxRequestTarget p_target, Form<?> p_form) { // Upload the file final FileUpload logo = m_fileUpload.getFileUpload(); boolean extension = false; if (logo != null) { // Verify the extension for (int i = 0; i < FILE_EXTENSION.length; i++) extension = extension || logo.getClientFileName().endsWith(FILE_EXTENSION[i]); if (extension) { File newFile = new File(LOAD_FOLDER + logo.getClientFileName()); m_reportModel.setLogo(newFile.getAbsolutePath()); if (newFile.exists()) { newFile.delete(); } try { newFile.createNewFile(); logo.writeTo(newFile); } catch (Exception e) { s_logger.error(e.getMessage(), e); throw new IllegalStateException("Error"); } } } // Add parameters to report m_params = new HashMap<String, Object>(); m_params.put("runningDate", "Executed on " + p_testPlanResult.getRunningDate().toString()); m_params.put("url", p_testPlanResult.getTestPlan().getUrl()); m_params.put("ou", p_testPlanResult.getTestPlan().getOu()); m_params.put("name", p_testPlanResult.getTestPlan().getName()); m_params.put("description", p_testPlanResult.getTestPlan().getDescription()); m_params.put("runs", p_testPlanResult.getRuns()); m_params.put("failures", p_testPlanResult.getFailures()); m_params.put("title", m_reportModel.getTitle()); m_params.put("logo", m_reportModel.getLogo()); m_params.put("logoBull", m_reportModel.getLogoBull()); m_params.put("fileName", fileName.toString()); // fin du nom du rapport ajout du titre du rapport fileName.append("_" + m_reportModel.getTitle() + ".pdf"); OutputStream out = null; try { // Open the download window and get back the OutputStream WebResponse response = (WebResponse) getResponse(); out = response.getOutputStream(); response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment; filename=" + fileName.toString()); // Fill the report with our DataSource and our parameters JasperPrint jasperPrint; String InputStream = getReportModelFile(); JRDataSource JRDataSource = build(m_listTestStep); jasperPrint = JasperFillManager.fillReport(InputStream, m_params, JRDataSource); // Export to PDF with the OutputStream JRPdfExporter pdfExporter = new JRPdfExporter(); pdfExporter.setParameter(JRPdfExporterParameter.JASPER_PRINT, jasperPrint); pdfExporter.setParameter(JRPdfExporterParameter.OUTPUT_STREAM, out); pdfExporter.exportReport(); out.flush();[/code] and
×
×
  • Create New...