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

dusca

Members
  • Posts

    12
  • 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 dusca

  1. Hello, I need to run a reporting application in a Java8 environment machine. Because of this, I need to compile my reports using Java8. On my development machine, my eclipse project is set up to use Java8 as a JDK, and all project compliance params are set to Java8. However, the development machine also has installed and runs by default Java 11. Even though my compiling application starts with Java8, the compiled results are compiled using Java11. I get an error: I tried to run the application by adding in classpath a new user library pointing to eclipse jdt (eclipse/plugins/org.eclipse.jdt.core_3.27.0.v20210823-1758.jar) but that was no help, because that ended up in the same error but in a different place: I am compiling the jrxml files by calling: JasperCompileManager.compileReportToFile(getSourceAbsolutePath(), getDestinationAbsolutePath()); and I see no option to set the compile with version peroperty to this Please note this is not a maven or gradle project, it is a simple Java application with a main() method, and I've set up the required libraries manually in the classpath.
  2. Hi, I need to add a query to my report that is built around a parameter that I receive: Something along the lines of SELECT $P!{groupBySelector} as MyGroup, SUM(quantity) AS quantity, SUM(amount) AS value FROM ( ... another complex select here, but not relevant to the issue at hand ...) GROUP BY $P!{groupBySelector}[/code]Now, this is a legacy report, written directly in xml (jrxml) that has been working for several years now. But, in migrating the reports to be opened in the Studio, this query is not accepted in the dataset and query editor. The error is: Caused by: org.postgresql.util.PSQLException: ERROR: non-integer constant in GROUP BY[/code]I googled this error, and tried a solution to put $P!{groupBySelector} as "$P!{groupBySelector}". This only results in another error being thrown: Caused by: org.postgresql.util.PSQLException: ERROR: column "null" does not exist[/code] The parameter is defined as: <parameter name="groupBySelector" class="java.lang.String" evaluationTime="Early"> <defaultValueExpression><![CDATA[$P{groupBy}.equals("field1") ? "intern.onefield" : $P{groupBy}.equals("field2") ? "intern.twofield" : "intern.threefield"]]></defaultValueExpression> </parameter>[/code] How can I make this report work in JasperSoft Studio?
  3. you are correct. for each subreport in a detail field there is a lot of overhead (the sql query would be more expensive i think - i may be wrong here, so plese correct me) - that is why i embed my subreports in the summary band, or in a new report group's header/foooter But now that you pointed out the performance issue, I used the SubreportVisitor lucian suggested to compile the sources, and passed the subreport dir parameter to the report. Thanks!
  4. Hi I'm coming back to this with a problem. So my Subreport is defined using this expression: <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[net.sf.jasperreports.engine.JasperCompileManager.compileReport(getClass().getResource("Subreport.jrxml").openStream())]]></subreportExpression> If I run and execute the report from Ireport, the subreport is loaded, it all works like a charm But from my application, when I generate it using JasperPrint jPrint = JasperFillManager.fillReport(rep, params, conn); JRExporter exporter = getExporter(pdf); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, byteArrayOutputStream); exporter.exportReport(); it doesn't work. No exception is thrown, it just doesn't embed the subreport. So how can this be? Do I need to do something more in my reporting app?
  5. Hi is it possible to set an option so that a crosstab's columns would stretch to fill the page width? ( if the width of columns when it's filled is less than the crosstab element's width). Usually one can't know exactly how long the header names will be, but if one can set say a minimum width and allow it to stretch that would be great. i couldn't find such an option, but it would be a nice feature
  6. Jack Dawson Wrote: Your way might be little expensive. Hi I am facing a similar problem. But i think you are wrong that it is more expensive to do one SQL query to the database that doing 1 + x (where x can be >1000) queries for each subreport. so i am raising the same question: how can one send the result of the query (or a subset of the query) to a subreport?
  7. i found out why the particular one was created. eclipse forgot to delete the jasper file from the bin directory, so it was in the run dir. so .. in the end i used greylimbo's solution after all. thank you, it is quite a trick. i cannot imagine another way, to use a relative path to the subreport Post edited by: dusca, at: 2008/05/14 20:06
  8. lucian, then how is it explained that one of the reports works without a full abstract path? the same directories are used in both cases . all jrxml files are in one directory and all jasper files in another.
  9. to answer my own question, loadObject has no effect. so it's not that later edit: this is killing me now! I have a report that has one subreport. the subreport expression is something like "SubraportulMeu.jasper" that works perfectly with the code explained above. then another report, but with two subreports, with the same expression - gives me the "cannot load" exception. i quadruple checked but just can't figure out what the heck is the difference, why one works but the other doesn't. to the first i only send $P{} params, to the second i send $P{} and $F{}. that is the only thing that is different, but shouldn't be relevant. Post edited by: dusca, at: 2008/05/14 15:19
  10. thanks lucian, greylimbo. tried first the greylimbo approach but didn't quite work as i needed, so i am using lucian's solution so now I have something along the lines of: Code:JasperCompileManager.compileReportToFile(jrxmlPath,jasperPath); ret = (JasperReport) JRLoader.loadObject(jasperPath); JRElementsVisitor.visitReport(ret, new SubreportVisitor(sourcePath, destinationPath)); and in my visitor I get the subreport path and also JasperCompileManager.compileReportToFile(subReportJrxmlPath, jasperPath); but at runtime I get a Code:[code]net.sf.jasperreports.engine.JRException: Could not load object from location : MySubReport.jasper at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:267) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:308) am I supposed to do a JRLoader.loadObject for the supreport too,or what am I missing? the jasper files exist and are all in the same dir. thanks
  11. I have an app that has as input jrxml file names, and outputs the pdf reports. So I am given a "mainReport.jrxml" string, and should output the pdf. I can easily compile "mainReport" to compiledDirectory, load it into a JasperReport object and then call JasperFillManager.fillReport () But in the case of a report having subreports, how do I find that mainReport subreports (and what are their filenames) to compile those also? there is no JasperReport.getSubeports() or something similar... any ideas? I hope I was explicit enough
×
×
  • Create New...