2006 JR Open Discussion Posted August 22, 2006 Share Posted August 22, 2006 By: chenwj - cwscwj I really need help,filling date to subreport 2006-03-11 22:48as i was executing filling date to subreport in my java programe, there is a err like that'net.sf.jasperreports.engine.JRRuntimeException: Error preparing statement for executing the report query : select * from proTable where unitKind ='aa ', seems it couldnt pass the parameter value to the subreport, pls help me, this question already trouble me many days By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-13 19:15hello, all ,pls give me some suguestions on how to slove this question, i have tired to many ways but doesnt work at all, many thanksssss firstly By: nsorochan - nsorochan RE: I really need help,filling date to subrep 2006-03-13 21:56need more information please. Can you post the code? The query? the jrxml? Is the parameter listed as a data in the report? By: Slobodan Kasterovic - kaster RE: I really need help,filling date to subrep 2006-03-14 00:18I can just join nsorochan! This is really unsufficient illustrated problem! We need at least jrxml! By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-14 18:06yes, buddy, i will sent my jrxml file and my code for you to test, and could you give me your email address or sth to contract with , if possible , could you use someone instant messaging service , e.g Msn, throught add in friends list then have a commuincation online, it will be more helpful to me ..thank you very much~!!! By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-14 18:15 // to compile the subreport jrxml file , and get a subrepot jasper file String jasperSubFileName= JasperCompileManager.compileReportToFile("F:\ireport\iReport-1.1.0\subTestReport.jrxml"); JasperReport comSub = (JasperReport)JRLoader.loadObject(jasperSubFileName); // to push comSub object to the master report that is name of 'testReport', parameters.put("testReport", comSub); ////to compie master report .jrxml file into .jasper formate String jasperFileName= JasperCompileManager.compileReportToFile("F:\ireport\iReport-1.1.0\testReport.jrxml"); /////////////////////fill date String jrprintFileName= JasperFillManager.fillReportToFile(jasperFileName, parameters,getConnection()); my code is similar to the way done in the sample demo, and my sql query is select totalNum,unitNum,bioChemi,anti,chemi,midMed,midCre,others, unitKind,zongshu,buhege from proTable where unitKind =$P!{unitKind}, if you needs more information, pls tell me : cwscwj@hotmail.com thank you very much again~!! By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-14 18:59btw, i dont understand why there is a code like this "parameters.put("ProductsSubreport", subreport);" in the jasperreport demo, and it's unsuccessful for me to compile this words, coz the 'ProductsSubreports' is a subreport name but not a master name, the comiplier displays this err like 'net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.JasperReport value assigned to parameter subTestReport in the testReport dataset.', could you tell me which one is right to use bewteen master report name or subreport one , as i use master report name as my first parameters in the put() method, the compiler displays my front error in the thread " By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-18 22:53Hello all,, pls give a look at my issue.., many thanks... im trying to many ways in order to slove the question but fails again... By: chenwj - cwscwj RE: I really need help,filling date to subreport 2006-03-20 23:35thanks all that care my issues and give helps to me ,,i already slove this question, a bit hard to explain it clear in a words, if you have similar quesion you could email to me : cwscwj@hotmail.com and there r two advice on my issue: 1.take care of using the method of 'setAutoCommit()' 2. take care of the property of the imagine expression class in your subReport attribute , eithor to use String or Jasperreort Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now