Jump to content

itpragmatic

Members
  • Posts

    17
  • Joined

  • Last visited

itpragmatic'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. Hello Expert, I have been working on i report 3.0 to generate reports based on calculations. I am able to get total amount from query itself. Additionally, i need to calculate grand total based on mathematical operations. Using variables, i can produce this total in number. Now i want to write this total in the words. I have written a function in sql (amount_to_words) to convert amount in numbers to words. I am able to see total successfully using that function. But for grand total(Variable) I am not able to use it as for grand total i am calculationg it using variables. and it is not possible for me to import that variable in the query or i don't know how to import it in query if it is possible. Has anyone got idea about this issue? Please share your knowledge. Thanks in advance. Best regards.
  2. Set your parameters' class to java.lang.Long. Doesn't it work? Which version of ireport you are using?
  3. hello..this is pretty older post but i am hopeful to get some clue from here. I am having same scenario. one main report and 2 subreports (DataDetails and ProcessDetails.) Main report and DataDetails use jdbc connection while ProcessDetails must use JRDataSource. I am having problem while executing this within java file. I tried in following way. 1. created a java bean for the ProcessDetails(sub report which uses JRDataSource) and in the class file called its instance. 2. Main report file and DataDetails(both uses database connection) already exist. Didn't change anything in that. 3. In ProcessDetails subreport, connection type is kept to "Use a DataSource expression" and Data Source Expression is set to $F{newBeanField}(This is defined in java bean file). 4. in main class I did following, please see the code. 5. Now my problem is as main report and DataDetials(subreport1) are connection oriented and ProcessDetails uses JRDataSource, I am not able to fill the report using either JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, jbs); or JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, conn); 6. Am i committing mistake anywhere? I know we can't use both connection and jrdatasource in fillreport. What I should change in order to generate every report. Please suggest/help/advise. Thank you in advance. Code:ArrayList<JasperBeanSample> list = new ArrayList<JasperBeanSample>(); JasperBeanSample jasperBeanSample1 = new JasperBeanSample(); jasperBeanSample1.setId(10); jasperBeanSample1.setName("abcabc"); jasperBeanSample1.setEmailId("abc@gmail.com"); list.add(jasperBeanSample1); JasperBeanSample jasperBeanSample2 = new JasperBeanSample(); jasperBeanSample2.setId(20); jasperBeanSample2.setName("xyzxyz"); jasperBeanSample2.setEmailId("xyz@yahoo.com"); list.add(jasperBeanSample2); JasperBeanSample jasperBeanSample3 = new JasperBeanSample(); jasperBeanSample3.setId(30); jasperBeanSample3.setName("pqrpqr"); jasperBeanSample3.setEmailId("pqr@hotmail.com"); list.add(jasperBeanSample3); JRBeanCollectionDataSource jbs = new JRBeanCollectionDataSource(list); //jasperBeanSample1.setNewBeanField(jbs); Map<String, Object> jasperParameter = new HashMap<String,Object>(); jasperParameter.put("newBeanParameter", list); JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, jbs); //JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, conn);
  4. Experts, 1. I would like to know whether we could pass connection and JRDataSource altogether in function? If filename is source filename, jasperParameter is hashMap, conn is connection and jbs is datasource, then in any scenario can we pass all these together like following? I believe we can not do that but I would like to confirm about it from the experts. JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, jbs,conn); 2. Another question in my mind is I have one main report along with 2 subreports. Main report and subreport2 uses connection while subreport1 does not use the connection but JRDataSource. In this scenario what should be done if I want to generate those reports? One with JRDataSource and 2 with connection. This is why i asked first question. I have already created a bean for the datasource and was able to display it through ireport but my concern starts when I start to use JasperFillManager. Please do let me know your ideas and suggestions. Your help is appreaciated. Has anyone gone through similar scenario? Following is what I thought. 3. If I combine Main report and subreport1 and if i create its bean....then is it going to work? I mean to say creating beans for main report and subreoprt1 and pass datasource only through subreport2. Is is feasible and possible? Or I am tinking out of track? Please do let me know if anybody knows the answers. Thank you very much.
  5. experts, i have been working on passing collection datasource from java to jasper file. Something is going wrong. I will write the steps here how i am doing it and also attach the jrxml and java files. 1. Basically, i want to pass list of data to jasper file throgh java file so that it can generate the reports accordingly. 2. I have a master report,one sub report, one java file to write exporter's logic and a java bean file which includes getters and setters method. 3. Initially i thought of parameter of type object and pass the data via this object. It didn't work. I referred following thread to understand where i am going wrong. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=73972 4. I created a java bean file which contains getters and setters methods and in main report i created a parameter along with a field which can hold list of data. 5. In main report i created field called workListDS and also the fileds which i declared in the java file to generate the report. 6. In subreport expression, i wrote $F{workListDS} to get the list of data. Still I am not able show all beans. I can see only first bean which i had declared and not the rest. I don't know where i am committing mistake. Also right now i am declaring those text fields on the main report. If i declare those on subreport (where i wish to declare). , report does not compile. PLease help. PLease suggest your ideas and advices. I am attaching here my both jrxmls.java files and pdf files.
  6. Experts, Any ideas? Has not anyone done this before. Please share your experience and I would appreciate it.
  7. Ok so you must have been trying to execute your application within a java file to ireport, right? If this is true then you have to use SimpledateFormat in your program and also need to parse it. Don't forget to include import java.text.DateFormat; import java.text.SimpleDateFormat; import java.text.ParseException; import java.util.Date; in the program. Anyways I am still not sure how exactly you are working in ireport with your csv files (I mean to say you want to it within a java file or how?) I apologize if I am asking anything wrong but I didn't understand your problem thoroughly yet.
  8. Hi there. The simplest ways is, go to DATE2 and DATE1 textfields. Under text field properties click on pattern and select your desirable format, in your case it must be yyyy/mm/dd HH:mm.ss before that set your expression class of your both date(date1 and date2) text fields to java.util.date and then update your sql query using following. select, ------ TIME_FORMAT(TIMEDIFF(date2,date1),'%H:%i:%S')as execute_time from ------------ and see whether it works. This is what I can suggest after reading your problem as i am not sure in what exactly fromat you want to display your result. All the best. Post Edited by itpragmatic at 09/29/2010 13:42
  9. Hi there! When you amend (make any changes) your subreport first compile it. After that execute main report. Then your changes are going to reflect in main report. All the best.
  10. any suggestions experts? kind regards. Post Edited by itpragmatic at 09/29/2010 05:35
  11. Experts, I read this thread and I thought you may help me to resolve the similar issue. I am trying to use multiple(2) subreports in one master report. In subreport1 I am showing some database results and from subreport2(i want to display 3 columns of data called formula, status, result) . I am using empty datasource for the subreport3. Now, my question is, "can we pass objects to the reports from subreports?" I might have different values to display in the report via my java program. I have defined 3 parameters in the subreport2 called $P{formula},$ P{value} and $P{result}. It would not be feasible to use multiple parameters for same columns/data. I would like to know, can we pass objects via any mechanism? Can we store any mechanism which can store objects those eventually consist of different parameters? I searched on the forum and found JRBeanCollectionDataSource. Will it be useful for me? If yes would you please let me know step by step execution/changes required in the main report or subreports? I am not sure how to use this myBean thing. I would like to learn though. Is it the right direction to get for what I am looking for? Please suggest your ideas. Thank you in advance.
  12. Experts, I am trying to use multiple(2) subreports in one master report. In subreport1 I am showing some database results and from subreport2(i want to display 3 columns of data called formula, status, result) . I am using empty datasource for the subreport3. Now, my question is, "can we pass objects to the reports from subreports?" I might have different values to display in the report via my java program. It would not be feasible to use multiple parameters for same columns/data. I would like to know, can we pass objects via any mechanism? Can we store any mechanism which can store objects those eventually consist of different parameters? I searched on the forum and found JRBeanCollectionDataSource. Will it be useful for me? Is it the right direction to get for what I am looking for? Please suggest your ideas. Thank you in advance.
  13. Issue resolved with help of conditional operator. One has to pay attention towards opening and closing parentheses. :) conditionMain ? trueValue:(condition2 ? : trueValue: trueValue3) Post Edited by itpragmatic at 09/27/2010 13:05
  14. Any suggestions experts? Do i need to change my query for this?
×
×
  • Create New...