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

foobrother

Members
  • Posts

    18
  • 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 foobrother

  1. Hi everybody, I'm having an issue with my report when I have a subreport which contains another subreport: When I declare my subreports I use the path: $P{SUBREPORT_DIR} + "my_report.jasper" But for some reason, when I have a subreport which contains another subreport, the last one raises an error saying that it cannot find the path P:\developement_folder\\iReports\my_report.jasper Why does it take the default value? It looks like $P{SUBREPORT_DIR} works ok with a first layer of subreports but not with a second layer? Code://CODE FOR SUBREPORTS DECLARATION<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "rpt_pl_fh.jasper"]]></subreportExpression>//SUBREPORT_DIR DECLARATION<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["P:\\developement_folder\\iReports\\"]]></defaultValueExpression> </parameter>
  2. Hi everybody, I have made a query for my report which takes 2 dates as parameter to search data for a specific period. It compiles without any warning/error. But when I try to run the report I get the following error: Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000003096 Error filling print... Error executing SQL statement for : rpt_internal_transfers net.sf.jasperreports.engine.JRException: Error executing SQL statement for : rpt_internal_transfers at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:141) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:681) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:601) at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1247) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:877) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:826) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:59) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:858) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:135) ... 11 more It is generating the error at the first '$' of the first paramater apparently. I have tried to put $P!(myDate} instead of $P(myDate}, but same error. I have also tried the query directly on PostgreSQL and it works fine. I use PostgreSQL 8.4 and iReports 3.6.2 Code: Post Edited by foobrother at 12/07/2009 15:40 Post Edited by foobrother at 12/07/2009 15:41
  3. Hi everybody, I'm having exactly the same issue! Here is my case /uploads/projects/ireport/image/Capture.PNG I have 2 groups (plus another one I don't use for the moment): EPC and Order. In the footer of EPC I would like to get the SUM of the Orders Values. For he moment it's adding, for each Order, n times times the Order Value where n is the number of details row for the current Order. Then it adds the result of each Order. I use iReport 3.6.2 Post Edited by foobrother at 12/03/2009 09:20
  4. Hi, Is it still impossible? Do we still have to provide the total? Thx
  5. Solved it myself this time :D Should have searched a bit more before posting! Code:new Double($F{delta}.doubleValue() > 0.0 ? 1.0 : ($F{delta}.doubleValue() == 0.0 ? 0.0 : 2.0))
  6. And what about if elseif implementation? If you want to make a test which returns 1.0 for positives, 2.0 for negatives and 0.0 for values equal 0 ? I have tried the following code but it doesn't like it: Code: Post Edited by foobrother at 11/25/2009 11:10
  7. No! It's fine in fact! It's even better as it divided the results in 3 groups instead of 2: Positive ones, Negative ones and null ones. I just miss-interpreted the report :P Thanks guys for your help! Post Edited by foobrother at 11/25/2009 10:47
  8. Hi Giovanni, Thank you! Your code seems to work! But I have a new problem. For some reason it seems to return 1.0 for every Positive or Negative value of delta and 0.0 when delta is null. It should return 1.0 when delta is Positive and 0.0 for the rest?! Code:new Double($F{delta}.doubleValue() > 0.0 ? 1.0 : 0.0)
  9. What you wrote seems to be what I want but it's not compiling: Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000003323 Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@1505198 net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The operator > is undefined for the argument type(s) double, Double value = (java.lang.Object)(((java.lang.Double)field_delta.getValue()).doubleValue() > new Double(0) ? new Double(1.0) : new Double(0.0)); //$JR_EXPR_ID=12$ <----------------------------------------------------------------------> 2. The operator > is undefined for the argument type(s) double, Double value = (java.lang.Object)(((java.lang.Double)field_delta.getOldValue()).doubleValue() > new Double(0) ? new Double(1.0) : new Double(0.0)); //$JR_EXPR_ID=12$ <-------------------------------------------------------------------------> 3. The operator > is undefined for the argument type(s) double, Double value = (java.lang.Object)(((java.lang.Double)field_delta.getValue()).doubleValue() > new Double(0) ? new Double(1.0) : new Double(0.0)); //$JR_EXPR_ID=12$ <----------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:191) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:492) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) What I would like to do is to make an expression which takes my Double $F{delta}, checks if its value is positive or not. If positive it returns 1, if not it returns 0. Code:$F{delta}.doubleValue() > new Double(0) ? new Double(1.0) : new Double(0.0)
  10. Hi everybody, I have the same issue. I try to create a group expression which returns 2 different values depending on a Double value test. But I get the following compilation error: Version:0.9StartHTML:-1EndHTML:-1StartFragment:0000000111EndFragment:0000002757 Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@7020d4 net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from double to Object value = (java.lang.Object)(((((java.lang.Double)field_delta.getValue()).doubleValue() > 0.0 ) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <-------------------------------------------------------------------------------------------------> 2. Cannot cast from double to Object value = (java.lang.Object)(((((java.lang.Double)field_delta.getOldValue()).doubleValue() > 0.0 ) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <----------------------------------------------------------------------------------------------------> 3. Cannot cast from double to Object value = (java.lang.Object)(((((java.lang.Double)field_delta.getValue()).doubleValue() > 0.0 ) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <-------------------------------------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:191) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:492) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Code: If I try to cast the result of the test to Boolean I get this compilation error: Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000003199 Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@b4fec5 net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Type mismatch: cannot convert from Boolean to boolean value = (java.lang.Object)((new Boolean((((java.lang.Double)field_delta.getValue()).doubleValue() > 0.0 )) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <----------------------------------------------------------------------------> 2. Type mismatch: cannot convert from Boolean to boolean value = (java.lang.Object)((new Boolean((((java.lang.Double)field_delta.getOldValue()).doubleValue() > 0.0 )) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <-------------------------------------------------------------------------------> 3. Type mismatch: cannot convert from Boolean to boolean value = (java.lang.Object)((new Boolean((((java.lang.Double)field_delta.getValue()).doubleValue() > 0.0 )) ? 1.0 : 0.0)); //$JR_EXPR_ID=12$ <----------------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:191) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:492) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Code:(new Boolean(($F{delta}.doubleValue() > 0.0 )) ? 1.0 : 0.0) Post Edited by foobrother at 11/24/2009 14:30
  11. Hi everybody, I've done a query for my report which contains static dates for the moment. The report works fine. But when I try to put in a parameter I get a division by zero SQL error (I have a division in my query which depends on the dates). Code://Query with static dates:SELECT COUNT(t3.fld_id)/EXTRACT(MONTH FROM AGE('2009-12-01', '1999-01-01'))+ (12*EXTRACT(YEAR FROM AGE('2009-12-01', '1999-01-01'))) FROM tbl_proposals AS t3 WHERE t3.fld_date_entered BETWEEN '1999-01-01' AND '2009-12-01'//Query with parameters (no need to change the other dates as I already //have the error by changing the first twoSELECT COUNT(t3.fld_id)/EXTRACT(MONTH FROM AGE($P{dateTo}, $P{dateFrom}))+ (12*EXTRACT(YEAR FROM AGE('2009-12-01', '1999-01-01'))) FROM tbl_proposals AS t3 WHERE t3.fld_date_entered BETWEEN '1999-01-01' AND '2009-12-01'
  12. Solved! Another stupid error: I forgot to compile the subreport (too used to Eclipse).
  13. Hi everybody, I'm trying to send 2 parameters (which are also parameters from the main report) to a subreport. In the main report, I have added the I want to send in the "Parameters" section of the subreport. In the subreport I have created 2 parameters with the same name as the ones used in the main report. I'm trying to print these parameters in the subreport but I don't get anything. I don't have any error but the parameters are not printed. Any idea? Code: <subreport> <reportElement x="100" y="109" width="200" height="73"/> <subreportParameter name="dateTo"> <subreportParameterExpression><![CDATA[$P{dateTo}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="dateFrom"> <subreportParameterExpression><![CDATA[$P{dateFrom}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "kpi_administration_avg_overdue_client.jasper"]]></subreportExpression> </subreport> Post Edited by foobrother at 07/27/2009 13:53
  14. Solved. I just needed to remove the '!'. I have been to always use it inside a WHERE but apparently it not working in that case.
  15. Hi everybody, I'm new in Jasper Reports and I try to use parameters in my query. However in the WHERE date BETWEEN statement the parameters don't seem to be recognized and I get a syntax error. Cheers. Code:WHERE t5.fld_invoice_date BETWEEN $P!{dateFrom} AND $P!{dateTo})::text AS avg_over_days
  16. Hi, I'm looking at Lists. But I can't find any example. I'm looking in this page: http://jasperforge.org/website/jasperreportswebsite/trunk/samples.html?group_id=252 Is that the right one? Corresponding to /demo/samples/ ?? Post Edited by foobrother at 07/20/2009 14:04
  17. Ok thanks I'll check that. So, for what extra datasets are used for? Post Edited by foobrother at 07/17/2009 08:56
  18. Hi everybody, I'm trying to use several queries for the same report. I've created several datasets for that. I've put the fields of the datasets into my report.But when I try to compile it, the fields are not found. It seems to look for fields into the main "Fields" section.What do I have to do? Cheers.
×
×
  • Create New...