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

fishermania

Members
  • Posts

    14
  • Joined

  • Last visited

fishermania's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. I want to have different datasources sent to different subreports via parameters. I beleive I know how do to this via java, but have not been able to get the right syntac in netbeans. I have registered 2 datasources for the test PROD and UCLLIS. Prod is currently in use for the main report. I attempt to use the other datasource using a parameter of class type java.sql.Connection. For the expression i have tries both it.businesslogic.ireport.util.Misc.getConnection("repo:/datasources/UCLLIS") and it.businesslogic.ireport.util.Misc.getConnection("repo:/datasources/Prod"). If I display the report connnection in main report it displays as oracle.jdbc.driver.T4CConnection@34c7543. Now if i display my new parameter for the subreport it report a null. What is the proper syntac to reference the other registered datasource? I am currently running 3.6 and using netnebans 6.5 as my deleopment envirmoent. here i an export of my datasource. Both work fine if used as the only datasource. <?xml version="1.0"?><!-- iReport connections --> <iReportConnectionSet> <iReportConnection name="Empty datasource" connectionClass="com.jaspersoft.ireport.designer.connection.JREmptyDatasourceConnection"> <connectionParameter name="records"><![CDATA[1]]></connectionParameter> </iReportConnection> <iReportConnection name="Prod" connectionClass="com.jaspersoft.ireport.designer.connection.JDBCConnection"> <connectionParameter name="ServerAddress"><![CDATA[test.com]]></connectionParameter> <connectionParameter name="SavePassword"><![CDATA[true]]></connectionParameter> <connectionParameter name="Url"><![CDATA[jdbc:oracle:thin:@test.com:1521:db1]]></connectionParameter> <connectionParameter name="JDBCDriver"><![CDATA[oracle.jdbc.driver.OracleDriver]]></connectionParameter> <connectionParameter name="Database"><![CDATA[db1]]></connectionParameter> <connectionParameter name="Password"><![CDATA[passwrod]]></connectionParameter> <connectionParameter name="Username"><![CDATA[user]]></connectionParameter> </iReportConnection> <iReportConnection name="UCLLIS" connectionClass="com.jaspersoft.ireport.designer.connection.JDBCConnection"> <connectionParameter name="ServerAddress"><![CDATA[test2.com]]></connectionParameter> <connectionParameter name="SavePassword"><![CDATA[true]]></connectionParameter> <connectionParameter name="Url"><![CDATA[jdbc:sybase:Tds:test2.com:3014/db2]]></connectionParameter> <connectionParameter name="JDBCDriver"><![CDATA[com.sybase.jdbc2.jdbc.SybDriver]]></connectionParameter> <connectionParameter name="Database"><![CDATA[db2]]></connectionParameter> <connectionParameter name="Password"><![CDATA[password]]></connectionParameter> <connectionParameter name="Username"><![CDATA[user]]></connectionParameter> </iReportConnection> </iReportConnectionSet> Thanks for the help. Bryan
  2. What is the correct parameter class when calling this function?
  3. You could do your formatting in a variable. When displaying it on your report do it as a String and then just replace your commas with ticks.
  4. I use ireports to build our base JRXML report and templates. Here some links for info on Jasperreports and ireports. On the left or middle there is links for FAQ, tutorial, samples, and more documentation. Jasper Reports http://jasperforge.org/website/jasperreportswebsite/trunk/documentation.html?group_id=252 Ireports http://jasperforge.org/projects/ireport http://jasperforge.org/plugins/mwiki/index.php/Ireport/Tutorials
  5. I use JNI to launch java classes that I need. You can write a java library that runs and prints reports and just call it from C.
  6. I want to have different datasources sent to different subreports via parameters. I beleive I know how do to this via java, but have not been able to get the right syntac in netbeans. I have registered 2 datasources for the test PROD and UCLLIS. Prod is currently in use for the main report. I attempt to use the other datasource using a parameter of class type java.sql.Connection. For the expression i have tries both it.businesslogic.ireport.util.Misc.getConnection("repo:/datasources/UCLLIS") and it.businesslogic.ireport.util.Misc.getConnection("repo:/datasources/Prod"). If I display the report connnection in main report it displays as oracle.jdbc.driver.T4CConnection@34c7543. Now if i display my new parameter for the subreport it report a null. What is the proper syntac to reference the other registered datasource? I am currently running 3.6 and using netnebans 6.5 as my deleopment envirmoent. here i an export of my datasource. Both work fine if used as the only datasource. <?xml version="1.0"?><!-- iReport connections --> <iReportConnectionSet> <iReportConnection name="Empty datasource" connectionClass="com.jaspersoft.ireport.designer.connection.JREmptyDatasourceConnection"> <connectionParameter name="records"><![CDATA[1]]></connectionParameter> </iReportConnection> <iReportConnection name="Prod" connectionClass="com.jaspersoft.ireport.designer.connection.JDBCConnection"> <connectionParameter name="ServerAddress"><![CDATA[test.com]]></connectionParameter> <connectionParameter name="SavePassword"><![CDATA[true]]></connectionParameter> <connectionParameter name="Url"><![CDATA[jdbc:oracle:thin:@test.com:1521:db1]]></connectionParameter> <connectionParameter name="JDBCDriver"><![CDATA[oracle.jdbc.driver.OracleDriver]]></connectionParameter> <connectionParameter name="Database"><![CDATA[db1]]></connectionParameter> <connectionParameter name="Password"><![CDATA[passwrod]]></connectionParameter> <connectionParameter name="Username"><![CDATA[user]]></connectionParameter> </iReportConnection> <iReportConnection name="UCLLIS" connectionClass="com.jaspersoft.ireport.designer.connection.JDBCConnection"> <connectionParameter name="ServerAddress"><![CDATA[test2.com]]></connectionParameter> <connectionParameter name="SavePassword"><![CDATA[true]]></connectionParameter> <connectionParameter name="Url"><![CDATA[jdbc:sybase:Tds:test2.com:3014/db2]]></connectionParameter> <connectionParameter name="JDBCDriver"><![CDATA[com.sybase.jdbc2.jdbc.SybDriver]]></connectionParameter> <connectionParameter name="Database"><![CDATA[db2]]></connectionParameter> <connectionParameter name="Password"><![CDATA[password]]></connectionParameter> <connectionParameter name="Username"><![CDATA[user]]></connectionParameter> </iReportConnection> </iReportConnectionSet> Thanks for the help. Bryan
  7. could you post you main report code and are you calling this from a java program. If you are can you post the relevent sections?
  8. What section are you subreports in? What section are you doing you addition in? Do you display you total varaible below you subreports? Processing order for the report can affect his.
  9. Are you getting you counts back from you subreports?
  10. I tihnk I may know what is wrong. How I do I manually chnage the net.sf.jasperreports.compiler.classpath in netbeans for a jasperreport?
  11. I am using netbeans 6.5 and jasperserver/ireport plugin ver3.5.1 . I am getting information from 1 datasource in my main report. I then pass parameter to a subreport that gets information from a different datasource. I have both of these jdbc datasources working fine when the reports are indiivually, but if I try to create a spereate connection parameter to pass to the subreport is says it can not find the driver. I have gone into tools->options and added the driver to the ireport classpath. However I think I need to add these to the net.sf.jasperreports.compiler.classpath. How do you change this property from the main report? Just remember this same connection work fine when expectlcicty selecting the dtatsource in netbeans. Here is my parameter. <parameter name="parameter1" class="java.sql.Connection" isForPrompting="false"> <defaultValueExpression><![CDATA[java.sql.DriverManager.getConnection("jdbc:sybase:Tds:server.com:3014/lis","user","pass")]]></defaultValueExpression> </parameter> Here is the error I receive. I think it can't find the jar file. Error filling print... Error evaluating expression : Source text : java.sql.DriverManager.getConnection("jdbc:sybase:Tds:server.com:3014/lis","user","pass") net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : java.sql.DriverManager.getConnection("jdbc:sybase:Tds:production_server.pa-ucl.com:3014/lis2000","sa","oracle") at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:197) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:574) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:542) at net.sf.jasperreports.engine.fill.JRFillDataset.setFillParameterValues(JRFillDataset.java:637) at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:585) at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1222) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:853) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:802) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:896) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: java.sql.SQLException: No suitable driver found for jdbc:sybase:Tds:server.pa-ucl.com:3014/lis at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at RelativeAnalyte_1247069719543_429123.evaluate(RelativeAnalyte_1247069719543_429123:151) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186) ... 13 more Print not filled. Try to use an EmptyDataSource... Thanks for the help - Bryan
  12. I was double checking my could and you are right I don't need to recompile. I accessed and loaded my jasper report directly and it worked fine. Thanks for the suggestion
  13. Yes they are dynamic reports. They are sent to multiple sites everyday. For now they will be server based prints, but soon They will be published no our intranet for use on clients. I know we have the most current Jre on all the client, but I can guarantee that most don't have the JDK. So you know I reference the java executable directly when testing these i.e. C:Program FilesJavajdk1.6.0_01/bin/java So on a computer that only JRE installed what would suggest that I do? Would specifying a classpath directly to the java bin directory fix the problem?
  14. I have found strange bug that is stopping me from distributing reports to my client computers. When I call this command when running my java code I receive the following error. JasperDesign jasperDesign = JRXmlLoader.load(reportFile); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); Could not create the report Error compiling report java source files : C:iReportsscriptsUnitExpiring_1178286175890_328702.java Error compiling report java source files : C:iReportsscriptsUnitExpiring_1178286175890_328702.java This is happening when I try to run the java on jre 1.6.1. This code works fine when I run it with JDK 1.6.1. I simulated on 2 different computers. A windows 2000 server and windows XP professional box. Same result each time.
×
×
  • Create New...