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

ozwolverine

Members
  • Posts

    22
  • 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 ozwolverine

  1. bklawans wrote: I'm at a loss as what could be going on here. I can compile the file you attached in a previous post without any trouble on my machine. Definitely something in your environment, but I'm not sure what. Do you have access to another system to test on? -Barry Hello Barry, I think your comment is very important, that means it must be a problem in my environment. - Is your java code equals as mine? I guess it is, - Should I upload my java class for you to test it? - What IDE are you using to compile the .jasper file from de Java class? - What is the configuration you have for locale, language, i18n, etc, in your system? - What OS are you using? I guess that if my environment settings are the main problem, all these information is very valuable to get a solution :-) Thanks a lot, Johnny
  2. ozwolverine wrote: Yep, I missed to tell you an important part of my environment, I deploy my applications under jboss-4.0.4.GA. I'm going to check if it has another jar inside its libs directories, but I don't think so. No matter that, I'm going to do other tests: I'm going to try to deploy my application under linux to see if theres any difference. [/ul] I set my environment under Linux, trying different configurations, UTF-8, ISO-8859-1, even I tryed compiling my project with a different IDE, JDeveloper 10g, but I didn't get any positive result :(. I'm going to make a small console app, to see if the problem is with my application server (jboss) [/ul] The tests I did on Linux where outside of any application server, it was just a simple java app, trying to load and compile my .jasper file, hoping that the problem was about my jboss app server, but after the test I know that is not the problem :( Do you, Alexander or Barry, have any other ideas? Thanks a lot for your usual help. Johnny P.S: Sorry about the delay, but I was totally busy, and couldn't get time to make the tests before.
  3. Hello code_slave, You have brought very good ideas on how to test and solve my problem. I will follow your suggestions and let you know the results. thanks a lot, Johnny
  4. Yep, I missed to tell you an important part of my environment, I deploy my applications under jboss-4.0.4.GA. I'm going to check if it has another jar inside its libs directories, but I don't think so. No matter that, I'm going to do other tests: I'm going to try to deploy my application under linux to see if theres any difference.[/ul] I'm going to make a small console app, to see if the problem is with my application server (jboss)[/ul] I will tell you the results. Thanks a lot, Johnny
  5. Hello code_slave, thanks for your answer. The problem is that I modified my SQL query to: SELECT NOMBRECOMPLETO_USUARIOEMPRESA, ID_USUARIOEMPRESA, EMAIL_USUARIOEMPRESA, RAZONSOCIAL_EMPRESA, ID_TIPOUSUARIO FROM usuarioEmpresa ue, Empresa e WHERE ue.NIT_EMPRESA = e.NIT_EMPRESA AND ue.FECHAREG_USUARIOEMPRESA between to_date($P{fechaInicial},'DD-MON-YY') and to_date($P{fechaFinal},'DD-MON-YY') Passing the parameters (fechaInicial and fechaFinal) as Strings, but I stil cannot get results, even if I have records in my db. Do you think I should change my db types from date to timestamp? Thanks a lot, Johnny
  6. Hello Alexander, I followed your suggestions but it didn't get any positive result. I removed all cdata sections as well as text in static text elements, but nothing new happened. I also try using both encodings from the iReport interface: UTF-8 and ISO-8859-1, but everything went the same :( I tried passing the jasper file in different ways to the compileReport method, the old way as a String with the full path, next as a FileInputStream, but with the second option the error message is just a bit different: 12:02:52,375 ERROR [ReporteUsuariosRegistradosFechaActualBean] net.sf.jasperreports.engine.JRException: Invalid byte 2 of 3-byte UTF-8 sequence. 12:02:52,375 INFO [ReporteUsuariosRegistradosFechaActualBean] Invalid byte 2 of 3-byte UTF-8 sequence. So I just kept with the original way, with a String. I tryed making a new report, with just a select to display only one column, the sentence is: select * from usuarioempresa Showing in the details section the ID of the user (usuarioempresa:id_usuarioempresa). I tryed with all options, UTF-8, ISO-8859-1, from iReports and from my web app, but the error keeps appearing in my app. But everything goes perfect in iReport. I was wondering if there's any way to set locale for the report programmatically, the question is because I saw that in iReport console I have this output: Compiling to file... .prueba.jasper -> C:Program FilesJasperSoftiReport-1.2.5prueba.java it.businesslogic.ireport.ReportClassLoader@b0f6ef Compilation running time : 109 Filling report... Locale: español (Colombia) Time zone: default Report fill running time : 47 (pages generated: 1) Exporting xls to file (using POI)... .prueba.xls Export running time : 31 Executing: C:Program FilesOpenOffice.org 2.0programscalc.exe .prueba.xls And as you can see, I don't know how, but iReport compiles ok, and pass a Locale and a Time Zone options to the filling of the report. So I was thinking the problem starts there, but I don't know, because locale setting goes after compilation, or at least that is what the console says. What do you think? Thanks a lot, Johnny I was writting this message the I accidentaly pressed my navigator back button and I lost everything. So I had to rewrite it all.
  7. Sorry, I keep getting the same error message: 20:33:55,683 ERROR [ReporteUsuariosRegistradosBean] net.sf.jasperreports.engine.JRException: Invalid byte 1 of 1-byte UTF-8 sequence. 20:33:55,683 INFO [ReporteUsuariosRegistradosBean] Invalid byte 1 of 1-byte UTF-8 sequence. I thought It could be because I have my eclipse 3.1.2 configured to use ISO-8859-1, so I changed the encoding in Eclipse, but I have the same problem :( I have no clues about this. Thanks for your help, Johnny
  8. Thanks Barry and Alexander,.. I will do what Barry says, Hope to have good news soon. Let's see if this is a bug or just a misconfigured environment. BTW, my environment is: Windows XP Media Center SP2 jdk-1.5.0_06 Eclipse 3.1.2 iReport 1.2.3 and 1.2.5 Jassper Reports 1.2.5 Web app with: JSF EJB3 Jboss-4.0.4.GA Am I missing something? :) Thanks a lot for you interest, Johnny
  9. Hello, this is the jrxml file, once I changed the encoding from utf-8 to iso-8859-1 using: ( Edit, Report Properties, i18n ), the accents (from my mother language, spanish) I had in my report. I created the report with ireport 1.2.3, but I last saved with 1.2.5. thanks a lot, Johnny [file name=UsuariosRegistradosFechas.jrxml size=14940]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/UsuariosRegistradosFechas.jrxml[/file]
  10. But do you think, this is really encoding related problem? I mean, I changed the encoding manually, and as you said it is changed back automatically to UTF-8, so I changed the encoding through iReport to ISO-8859-1, but I'm having the same problem. So I guess that must be some kind of bug. Do you know what could be causing the problem? Thanks, Johnny
  11. I started to make my reports with iReport-1.2.3, as well as my implementation in java with jasperreports-1.2.0. Then someone gave me some advice on how to export to csv, and he told me about to use a specific class but that class wasn't in those versions I was working on, so I downloaded the last version for iReport (1.2.5) and jasperreports (1.2.5), after that, I was able to follow his instructions to export the report to cvs, but on the first stage (compilation of the report .jasper), I got the mentioned error message. I read some forum messages and they talked about changing enconding from UTF-8 to ISO-8859-1, but that didn't work either. So now I don't know what could the problem be. Your help would be very appreciated :) thanks a lot, Johnny
  12. Hello everybody, I'm having this error message when I try to compile my report :(, the error message is: net.sf.jasperreports.engine.JRException: Invalid byte 1 of 1-byte UTF-8 sequence. What could this means? I have found a couple of messages in the forum with the same subject, but some of them talk about changing encoding to ISO-8859-1, but that doesn't solve the problem. Does anyone know what to do? Thanks a lot, Johnny
  13. Hello Alexander, thanks for your answer. So, What I have to load is the .jasper file instead of the .jrxml, right? Thanks again, Johnny
  14. Hello, After watching the examples, I have done this code to run and export my report, but it is throwing this exception: net.sf.jasperreports.engine.JRException: Error loading object from file : c:tmpreportesSECReporteUsuariosRegistrados.jrxml my procedure is: Code: try { NOM_ARCHIVO=PropiedadesSistema.HOME_RUTA_REPORTES +"ReporteUsuariosRegistrados.jrxml"; // NOM_ARCHIVO = rutaReportesBIRT + "WebappReport.jrxml"; System.out.println("Inicia Proceso CSV"«»); System.out.println("Archivo fuente: " +NOM_ARCHIVO); //COmpilar Reporte JasperCompileManager.compileReportToFile( NOM_ARCHIVO ); //Llenar Reporte JasperFillManager.fillReportToFile(NOM_ARCHIVO, parametros, getConnection()); //Exportar Reporte a CSV File sourceFile = new File( NOM_ARCHIVO ); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls"«»); System.out.println("Archivo XLS de salida: " + destFile.toString()); JRXlsExporter exporter = new JRXlsExporter(); // exporter.setParameters ( ) ; exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporter.exportReport(); FileInputStream fileInputStream = new FileInputStream( destFile ); int tam = fileInputStream.available(); byte[] bytesXLS = new byte[tam]; fileInputStream.read( bytesXLS ); fileInputStream.close(); long time = System.currentTimeMillis(); UtilidadesSEC.descargarArchivo( bytesXLS, "reporteUsuariosRegistrados" + time+ ".pdf" ); // JasperRunManager.runReportToPdfFile(NOM_ARCHIVO, archivoPDF, parametros, new JREmptyDataSource()); } catch (JRException e) { logger.error( e ); logger.info( e.getMessage() ); request.setAttribute( "errores", e.getMessage() ); return ""; } What should be the problem? I'm sure the file is in the suggested location. What could the problem be? I'm attaching the report file. [file name=ReporteUsuariosRegistrados.jrxml size=12491]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ReporteUsuariosRegistrados.jrxml[/file] Post edited by: ozwolverine, at: 2006/08/31 05:43
  15. Thanks a lot Alexander, I will follow the three step procedure you have just told me, hope to post good news here :-) Thanks, Johnny
  16. Hello Teodore and Alexander, and everyone :) I have read the API doc and watch some examples and I found code like this: Code: File sourceFile = new File(fileName); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject( sourceFile ); File destFile = new File( sourceFile.getParent(), jasperPrint.getName() + ".xls" ); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporter.exportReport(); But I still have a question. If my reports have parameters, how could I pass them to the report? I can see in the examples that there are some parameters, but those are specific for the classes used (JRXlsExporter). Thanks a lot,
  17. Hello Teodore and Alexander, and everyone :) I have read the API doc and watch some examples and I found code like this: Code: File sourceFile = new File(fileName); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject( sourceFile ); File destFile = new File( sourceFile.getParent(), jasperPrint.getName() + ".xls" ); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporter.exportReport(); But I still have a question. If my reports have parameters, how could I pass them to the report? I can see in the examples that there are some parameters, but those are specific for the classes used (JRXlsExporter). Thanks a lot,
  18. Alexander Merz wrote: 1. Spend some time with reading the API documentation of the classes JRAbstractExporter and JRExporterParameter and derivated classes. 2. Then you will have no problem to understand the examples in the sample directory of the JasperReports distribution. The most of them supports exports in different formats including CSV and Excel.Thanks a lot, I will read them.
  19. teodord wrote: Hi, Check the samples from the project distribution package. Almost all of them show how to export to XLS and CSV. Thanks, Teodor Thanks a lot, I will check them out.
  20. Hello everybody, I need to export my generated report to PDF and csv (or XLS), I know how to export to PDF with Code:JasperRunManager.runReportToPdfFile Is there any way to do it, but to export to CSV (XLS)? Can anyone give me some code excerpt? thanks a lot. Post edited by: ozwolverine, at: 2006/08/29 01:15
  21. Hello Barry, thanks for answering, bklawans wrote: Are you getting any errors from Oracle when you pass the date in as Date objects? When I pass a Date (java.util.Date) without any prior formatting, I just get no results on the report. If you pass the parameters as Date's, JasperReports simply tells the JDBC driver that there is a date param and set the Object you passed. The driver converts the date to a format the db engine understands, so the locale's date format shouldn't matter.This is very strange, if I run the query directly in SQLPlus Console (like this: "SELECT NOMBRECOMPLETO_USUARIOEMPRESA, ID_USUARIOEMPRESA, EMAIL_USUARIOEMPRESA, RAZONSOCIAL_EMPRESA, ID_TIPOUSUARIO FROM usuarioEmpresa ue, Empresa e WHERE ue.NIT_EMPRESA = e.NIT_EMPRESA AND ue.FECHAREG_USUARIOEMPRESA between '01-Jul-2006' and '27-Aug-2006'" ), I get results. But, if I try the query with a different date format like: 'Mon Aug 28 00:00:00 COT 2006' I get: ERROR at line 3: ORA-01858: a non-numeric character was found where a numeric was expected But If I run it from my web app I get: Converting to a string manually should be OK, as long as you do it in a way that gets called before the query is executed. Declare a new parameter of type String that has a default value of the expression that uses a SimpleDataFormat to convert to a string, and use that parameter as part of your query. I will try this, I'm formatting with SimpleDateFormat from my java app, I will change it to the Default Value Expression for parameter option. The exact error you are getting from Oracle would be a big help.When I send a complete java.util.Date I don't get any error message, but when I tried using a String I got an strange error message I will post it as soon as I have access to the application. Thanks a lot for your useful help, Johnny
  22. Hello Everybody, this is my problem. My Web application, has some pages that receive two dates, Once I have them I create the HashMap for the parameters ( Code:HashMap<String, Object> parameters = new HashMap<String, Object>(); ), Then I export my report to PDF ( Code:[code]JasperRunManager.runReportToPdfFile(File_Name, namePDF, parameters, new JREmptyDataSource()); If I run this report I don't get any results, because Oracle needs the dates to be passed in this format: "dd-Mmm-yy" or "dd-Mmm-yyyy". How could I create this date format from java to be sure Oracle recongnizes it as a valid Date? I have tried things like: Code:[code] SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", new Locale("en", "US"«»)); but SimpleDateFormat returns a String not a Date. Is there any way to do a cast since my jasper report to recognize the dates? Thanks a lot, Johnny
×
×
  • Create New...