Jump to content

bob4fit

Members
  • Posts

    8
  • Joined

  • Last visited

bob4fit's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I use iReport 4.0.1. I have searched the iReport Ultimate Guide and the iReport Forum. I have report A and report B. Both have the same user input parameter. Report A has a page header and a page footer. Report B does not. My customer would like to print A and B together. My solution is to add report B as a subreport in report A. It works accept that the page header and footer print on the pages that contain report B as a subreport. I understand how to use the Print When Expression property for the page header and footer in typical scenarios. But I haven't figured out how to use it for individual pages in a report. Can anyone offer advice how to exclude a page header and footer when the page contains a subreport? Or, have I made this too hard? Is there a way to print report A followed by report B? Much appreciated. bob4fit in Pennsylvania, USA
  2. I have created many reports using iReport 4 and all execute well on a Windows server. I'm migrating to a Mac Mini running OS X Lion. Most reports run as expected but my simplest reports that have no parameters will not run. I get the error below. Can anyone explain what it means and recommend a solution? Thank you all. Bob. net.sf.jasperreports.engine.JRException: Error executing SQL statement for : DriversByLastName at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:169) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:684) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605) at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:901) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at JasperReportsGenerator.main(JasperReportsGenerator.java:205) Caused by: java.sql.SQLException: No database selected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2293) at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:163) ... 9 more
  3. A colleague found a solution. Based on other posts he read he changed the report language from Groovy to Java. Then he wrote this expression: (($V{returnVariableTotalCost} != null) ? $V{returnVariableTotalCost} : java.math.BigDecimal.ZERO).subtract (($V{returnVariableTotalPayments} != null) ? $V{returnVariableTotalPayments} : java.math.BigDecimal.ZERO) bob4fit
  4. I have an invoice report with a subreport for costs and a subreport for payments. Both subreports return variables to the main report whare I calculate: BalanceDue = totalCost - totalPayments. The calculation works fine if both subreports return a value. The equation fails if either returns NULL. No surprise. How can I set the value of the cost and payment variable from NULL to zero in this equation: $V{returnVariableTotalCost} - $V{returnVariableTotalPayments} I've tried two approaches with no luck: ($V{returnVariableTotalCost}?$V{returnVariableTotalCost}:0) - ($V{returnVariableTotalPayments}?$V{returnVariableTotalPayments}:0) and ($V{returnVariableTotalCost}?:java.math.BigDecimal.ZERO) - ($V{returnVariableTotalPayments}?:java.math.BigDecimal.ZERO) Much appreciated. Bob
  5. I have a report that lists the outstanding balance by customer and the number of days ("Age") since we sent the invoice. I have the balance listed from largest age to smallest age. I'd like to group the balances every 30 days. 0-30 days, 31-60 days, 61-90 days, 91 and older days and then sum the balance in each age group. Can someone give me a pointer to how to write a groovy expression to do this grouping? Thank you, bob4fit
  6. mdahlman Thank you for the pointer. That expression didn't work but you gave me enough insight that I tried this expression and it works. $F{UseCustAddress} bob4fit
  7. I have a report that can either be sent to a customer at their home address from the customer table or to their company address from the company table. Both addresses are in my query for the report. The field UseCustAddress(boolean) defines which address to use. I'm seeking a solution for print the correct address. I'm considering using the Print When Expression property but don't know the Groovy syntax to do the following: If UseCustAddress==False Then print the customer's company address Else print the customer's home address Can anyone offer some guidance on the correct Groovy syntax? Thank you - bob4fit
  8. Thanks for the suggestion to move Detail bands using the XML editor. I just used it and it worked just fine.
×
×
  • Create New...