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

burferd

Members
  • Posts

    87
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by burferd

  1. I am not just interested in filling the cell with the correct value. I want to be able to place the formula so that if someone modifies a cell on the resultant excel page, it will change accordingly.
  2. I searched the documentation and forum for 'excel formula' but did not find anything in the documentation and only a couple vague references in the forum. I think I know the answer, but can anyone tell me if there is any way to pass excel formulas to a cell in a jasper report and have it export to the excel output? I need to be able to fill an excel output cell with a formula. Can it be passed as a string? Is there any special jasper data type that will allow this?
  3. Thanks for the feedback. I found the problem. The code in my last post worked. I had a problem before I got there that I found with the debugger.
  4. I'm still having problems with this. I suspect it is that I am not sure exactly what I need in the exporter settings. Any chance of either including the required parameters or pointing me to where I can find an example?? I removed the response.setXXX() calls and changed the export code to: exporter.setParameter(net.sf.jasperreports.engine.JRExporterParameter.JASPER_PRINT, reportout); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, java.lang.Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, java.lang.Boolean.FALSE); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:/MyReport.xls"); exporter.exportReport();
  5. Doesn't anyone write files directly to disk? It seems like a lot of people have looked at this, but no one has any suggestions on how to do this or where to look for an answer.....
  6. I have checked 'The JasperReports Ultimate Guide' and numerous posts on this forum, but have not been able to find an answer to my question. I have an application that generates an Excel report. When the report is generated, I get a prompt to save or open the file. That all works just fine, but what I need is to create the file and write it directly to a directory on disk without being prompted. Here is the code I am using to generate the report: public String doExcelReport( JasperPrint reportout, String filename ) { result = "Ok"; FacesContext faces = javax.faces.context.FacesContext.getCurrentInstance(); HttpServletResponse response =(HttpServletResponse)faces.getExternalContext().getResponse(); JRXlsExporter exporter = new JRXlsExporter(); ByteArrayOutputStream xlsReport = new ByteArrayOutputStream(); try{ exporter.setParameter(net.sf.jasperreports.engine.JRExporterParameter.JASPER_PRINT, reportout); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, java.lang.Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, java.lang.Boolean.FALSE); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, xlsReport); exporter.exportReport(); }catch (JRException jex){ result = "Couldn't complete xls export:"+jex.getMessage(); return result; } byte[] bytes = xlsReport.toByteArray(); response.setContentType("application/vnd.ms-excel"); response.setContentLength(bytes.length); response.setHeader("Content-disposition","attachment; filename=""+filename+".xls""); try{ ServletOutputStream ouputStream = response.getOutputStream(); ouputStream.write(bytes, 0, bytes.length); ouputStream.flush(); ouputStream.close(); }catch (Exception ioex){ result = "Couldn't complete xls export:"+ioex.getMessage(); } faces.responseComplete(); return result; } If there is a way to dump the file directly, I suspect it will be a parameter set in the following type of calls: response.setContentType("application/vnd.ms-excel"); response.setContentLength(bytes.length); response.setHeader("Content-disposition","attachment; filename=""+filename+".xls"");
  7. Thanks for the feedback. I added the following: commons-beanutils-1.7.jar commons-collections-2.1.jar commons-logging-1.0.2.jar and I still get the same error: com.sun.rave.web.ui.appbase.ApplicationException: #{PayrollPreviewPage.reportBtn_action}: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/commons/javaflow/bytecode/Continuable
  8. I have several cells with Oracle.BigDecimal fields that I have set the 'Pattern' to #,##0.00 I was under the impression that I would always get two decimal places in the output, but I do not. If the number is a whole number, I get no decimal places. If the number is like 10.50, I get 10.5 (only one decimal place). What is wrong with this? Is it a quirk for Excel or is it in Jasper?
  9. I found the problem. I was setting colors in the 'All' tab. When I set it in the 'Common' tab, it worked. I would think that you should be able to set in either place.
  10. I am trying to create an Excel viewable report and I set the background of my header row to a color. When I run the report inside iReport, it displays in Excel, but I do not see the background color in the cell. What do I need to do in order to see the color when displayed?
  11. Using Java Studio Creator, Oracle, SunAppServer 8.2, JasperReports 1.3.2. When attempting to run JasperFillManager(), I get the error listed below. It appears to be a reference into a javaflow module. I am attempting to write a Pdf report that works fine from within iReport. I have the following jar files loaded with my server: jasperreports-1.3.2.jar jasperreports-1.3.2-javaflow.jar jasperreports-1.3.2-applet.jar commons-digester-1.7.jar itext-1.3.1.jar poi-2.0-final-20040126.jar jfreechart-1.0.0.jar Am I loading the correct jar files? ================= error ============== type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception com.sun.rave.web.ui.appbase.ApplicationException: #{PayrollPreviewPage.reportBtn_action}: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/commons/javaflow/bytecode/Continuable
  12. Sorry about the multiple posts - not sure what happened.
  13. I am able to use stored procedures with MySql, but I do not seeem to be able to use stored procedures with Oracle. iReports complains that it is not a valid function or procedure. Is there some trick to using Oracle stored procedures?
  14. Java source is using the following libraries: jasperreports-1.3.2.jar jasperreports-1.3.2-javaflow.jar itext-1.3.1.jar poi-2.0-final-20040126.jar jfreechart-1.0.0.jar commons-digester-1.7.jar
  15. I used iReport1.3.2 to compile, but I have other versions installed on my computer. Should I uninstall the other versions? What jar files should I be including in my project?
  16. Using Java Studio Creator, Jasper Reports 1.3.2 I'm trying to write an Excel spread sheet and among my code I have the following: JRXlsExporter exporter = new JRXlsExporter() ... exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); ... The code compiles OK, but when I try to execute, I get a page error: ExceptionDetails: java.lang.NoSuchFieldError IS_DETECT_CELL_TYPE The parameter is detected with the code completion in the IDE, so it is obviously seen by the IDE. The jasper 1.3.2 jar file is loaded in the war file since I can print PDF versions of my reports. Anyone have a clue as to why I get the NoSuchFieldError?? Is there something else I need to include?
  17. I found the problem I needed to include itext-1.3.1.jar
  18. I am generating a report in my application and viewing it in JasperViewer. I want to write that report to a file in PDF format. JasperViewer appears to have a PDF format as one of the save options, but when I select that format, it does not create a file. How can I create a PDF file from JasperViewer??
  19. I am using the following to generate and view a report compiled with iReport: JasperPrint jp = JasperFillManager.fillReport( reportDir+MyReport.jasper, parameters, MySqlConnection); JasperViewer.viewReport( jp, false ): This seems to work with the following issues: 1) I can only find the reports when I use the default iReport path "C:/Program Files/JasperSoft/iReport-1.3.2" 2) Every time a report is run, there is a new version in the directory. My questions are: 1) How can I place the compiled report files in a different directory and make sure that they are found? 2) How can I avoid accumulating a new version every time the report is run? The directory gets very cluttered with stuff that is no longer needed
  20. Can I call a MySQL stored procedure from within a report to fetch data? If so, how do I set up the stored procedure to execute when the report runs?
  21. Using Windows XP I FINALLY managed to generate a report and display it in JasperViewer, but I cannot close the viewer. There is no close button and clicking the 'X' in the upper right corner does not close the viewer. Right clicking and selecting 'Close' does not close the viewer either. How do I close it?
  22. How do I change the default directory for compiled reports? I am trying to run a report in my code that runs fine in iReport, but I keep getting an error that says it cannot load class 'Report_name_bunchOfNumbers'. I did a search on my computer (using Windows XP, tried all Jasper versions between 2.8.7 and 3.0.2, J2ee SDK 1.4.2) and found the class in question (Report_name_bunchOfNumbers) in directory C:Program FilesJasperSoftiReport(version). I think this is the root of my problems. How do I set the system up properly so I can generate a compiled report and have my code find it? I move my compiled code to a directory C:ReportsJasperReports. I think what I need to do is also point my iReports to generate compiled reports in that directory as well. Am I correct here or all washed up????? Someone else MUST have gone through this before.
  23. Can anyone at least tell me if what I am attempting to do in code is correct or if I am doing something wrong?? I am using JR 1.3.0, J2EE (SDK1.4.2), Sun Application server 8.2. Does anyone use JR1.3.0 and should it work in this environment??
×
×
  • Create New...