Jump to content
Changes to the Jaspersoft community edition download ×

neetikamittal

Members
  • Posts

    29
  • 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 neetikamittal

  1. Hi, I tried to do this, I made a jsp page with option buttons, Bsaed upon option One will select ,query will be modified or you can say condition will change dynamically. I am attaching my servlet code and jsp page. All u need is to make a paramater in Ireport GUI and replce the portion of ur query with $!{/name of the parameter} May be this will help u. In this code I am replacing query but u can replace particular parameters also. Thanks Neetika
  2. Hi friends, I report is taking too much of time to generate a html report that I am worried wat will be the real performance when I will try to run it on real production environment. Now I am generating a report with app. 5000 records and it is taking 10 minutes. So can anybody suggest me about how to increas the performance . wat I need to do. I read it somewhere that due to antivirus installation on PC makes it too slow. But can anybody tell me how much time it will take in general to generate a report of 5000 records in html format. Thanks
  3. Hi friends, Is this possible with Ireport that based upon users field selection in an INPUT FORM,only those particular column should appear not the other columns. means if a user selects firstname,homephone,workphone then only those should come on a web based report,not the other columns. I don't want to produce sepearte reports for each possible combination of columns . suggest me some better idea. do I need some other technology to dynamically change my column definations. Thanks Neetika Mittal
  4. Hi Lucian, Actually I am trying to have a customized report. I have a jsp page with one of its field as text field to enter the name of the person which the user wants to see the report. That is why I used prepared statements. My question Is still there. How can I make my $P{homephone} iterate through the string array value against a single key in hashmap. Amber 32473474232 //these phone nos are in string Array Amber 23282842234 //hashmap("homephone",s1) Amber 23278733439 //$P{homephone}should fill these values one by one In Report Design I have $P{firstname} $P{homephone} I already posted the code earlier. U can have look at it. Thanks Neetika
  5. Thanks for ur response. But till now I am working only with JDBC DataSource. I don't know wat kind of changes U r trying to say . Can U explain in detail. Wat Should I need to do ? Do u have any example/code snippets for this. I will be highly obliged. meanwhile I am trying my best to solve this problem. Thanks Neetika
  6. ya I fully understand this But how can I iterate through that array to have corresponding values. also how to fill that $P{homephone} with different values for each person whose first name is 'amber'or smthing else. I didn't find any type other that that where I can define the parameter type as array. Is there any mechanism that can fill the values one by one that is in array? first name is fine but $P{homephone} will be having different values . problem is there. Thanks Neetika
  7. Hi all, I didn't get any answer of my earlier posted query. my question is if I assign a String array against a single key value then How the paramter defined will iterate through that array. My earlier post will help u in better understanding. But I will try again to explain it. I want that if I choose that ok I need all the person's homephone nos whose name is "jane" then I am supposed to create 2 parameters as $P{firstname} and $P{homephone} but so far I am able to get the phone nos. but now how to make the parameter do the iteration I don't know like jane 233989439 jane 343454656 jane 343435455 jane is printing very well but in case of homenos as they will be different parameter should fill the phonenos iteratively. I am really stuck in this did somebody ever tried this kind of situation? Plz let me know. Neetika Mittal
  8. Hey, I also came across the same problem but wen I restart my server It just went away. U can try also. I am working on Tomcat5.5 Hopefully It will work Neetika
  9. Hi Friend, If I tried to put multiple values against a single key in hashmap. Whether the parameter defined in Ireport design phase will automatically iterate through those values one by one against that key. I want to have a report like First Name Homephone Amber 4089874563 Amber 4987654567 Amber 3448768907 here all three Amber are different persons. so I designed a report like this First Name HomePhone $P{firstname} $P{homephone} and write a code like this PreparedStatement stmt = jdbcConnection.prepareStatement("select firstName, homePhone from person where firstName = ?"); stmt.setString(1,name); ResultSet rs = stmt.executeQuery(); ArrayList names = new ArrayList(); while (rs.next()) { names.add(rs.getString("homePhone")); } Object ia[] = names.toArray(); int len=ia.length; String[] s1=new String[len]; for(int i=0;i<len-1;i++) { s1= ia.toString(); } hmap.put("homephone",s1); hmap.put("firstname",name); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,hmap,jdbcConnection); JRHtmlExporter exporter = new JRHtmlExporter(); Map imagesMap = new HashMap(); req.getSession().setAttribute("IMAGES_MAP",imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,out); exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,Boolean.FALSE); exporter.exportReport(); But I think my parameter field is not iterating through the array values that I put in code. So how can I do this thing. it seems in IREPORT hashmap will take only single value against a key. Plz let me know as soon as possible. Thanks Neetika
  10. Hi Friends, Hopefully One of u have gone through mine problem. My problem is I have one parameter named $P{homephone} to display the runtime filled values from database. that HomePhone field is of char[10] in database. So I declared that parameter of type java.lang.String but wen I am running a particular query,multiple values will be returned in result set so I created a arraylist of those values to put against that single key. then I convert that arraylist to string array,so that value can be filled in. But I think when running or filling up the report,that parameter defined their is not iterating the values rather it is giving an error. Could not create the report Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. I am attaching a code snippet and also jrxml file for reference. Plz have a look at it. try{ JasperDesign jasperDesign = JRXmlLoader.load(reportFile); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); Class.forName("com.mysql.jdbc.Driver"); Connection jdbcConnection = DriverManager.getConnection(databaseName,userName,password); PrintWriter out = res.getWriter(); Map hmap=new HashMap(); String name = req.getParameter("firstName"); String cb1 = req.getParameter("homeinfo"); if(cb1.equals("on")) { PreparedStatement stmt = jdbcConnection.prepareStatement("select firstName, homePhone from person where firstName = ?"); stmt.setString(1,name); ResultSet rs = stmt.executeQuery(); ArrayList names = new ArrayList(); while (rs.next()) { names.add(rs.getString("homePhone")); } Object ia[] = names.toArray(); int len=ia.length; String[] s1=new String[len]; for(int i=0;i<len-1;i++) { s1= ia.toString(); } hmap.put("homephone",s1); //see here an string array is against a single key,I want that rarameter defined in report,iterate through this array and give the respective values. //String s = rs.getString("homePhone"); // hphones.put("homephone",rs.getString("homePhone")); hmap.put("firstname",name); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,hmap,jdbcConnection); JRHtmlExporter exporter = new JRHtmlExporter(); Map imagesMap = new HashMap(); req.getSession().setAttribute("IMAGES_MAP",imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,out); exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,Boolean.FALSE); exporter.exportReport(); [file name=ctisreport1-358199458018b4d15c8080966996a531.jrxml size=22891]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ctisreport1-358199458018b4d15c8080966996a531.jrxml[/file]
  11. Hi Friends, u may find me too impatient but I can't wait for too long. actually I tried to put a string array against a single key in hashmap. now wat I think is Parameter field named "homephone" is not able to populate the string array values agaist this single key. I tried to check whether against that key string array values are there or not. My code is printing those values against that key. But now Problemm is Ireport is not filling up those string values against a that key in my Parameter field defined . I defined a field named $P{homephone},drag this field in details section so that runtime values from database can be filled in. here is my code where i tried to pick homephonenos of all the persons whose name is "amber". Most important thing is in database homePhone field is of type char[10] so I declred my parameter homephone as of type java.lang.String and in java code I tried to make a arraylist then converted that arraylist into string array. and then called the HASHMAP's put(key,value) method see the code below. I have slightly modified the code so don't check for prepared statemnets. Map hmap=new HashMap(); String cb1 = req.getParameter("homeinfo"); if(cb1.equals("on")) { PreparedStatement stmt = jdbcConnection.prepareStatement("select firstName, homePhone from person where firstName = 'amber'"); ResultSet rs = stmt.executeQuery(); ArrayList names = new ArrayList(); while (rs.next()) { names.add(rs.getString("homePhone")); } Object ia[] = names.toArray(); int len=ia.length; String[] s1=new String[len]; for(int i=0;i<len-1;i++) { s1= ia.toString(); } hmap.put("homephone",s1); //problem is here only I think so //hmap.put("firstname",name); but when i tried this I am getting all the values against homephone key String[] strings = (String []) hphones.get("homephone"); out.println("length of string array is"+strings.length); for(int i=0;i<strings.length;i++) { //strings= ia.toString(); out.println("value of string "+i +"is"+strings); } but when this servlet code tries to fill the values in parameter fields defined it is showing error like Could not create the report Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. so for reference I am attaching jrxml code also. I wish One must have understand my problem. Hope to get the soln very soon [file name=ctisreport1-03818669ee2bcad10ef67e95550ff804.jrxml size=22811]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ctisreport1-03818669ee2bcad10ef67e95550ff804.jrxml[/file] Post edited by: neetikamittal, at: 2006/09/06 06:17
  12. Hi, I tried to convert the arraylist into an atring array. Phonenos from database are printing very well on console. But in Parameter field values r not coming up. it is empty. can't I put a string array against a single key in hashmap. or I need to do something else so that phonenos can comein from database against the name entered by user. like if user puts "amber" and click checkbox HOMEPHONE as he wants to see the phonenos of all the persons whose name is "amber" and datatype for homePhone in database is char[10]. then wat I need to do . I tried the code attached below and now it is giving the error in tomact log file as Could not create the report Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. Incompatible [Ljava.lang.String; value assigned to parameter homephone in the ctisreport1 dataset. today only I posted a query with all my code and jrxml file. U can have a look at that. Thanks neetika Post edited by: neetikamittal, at: 2006/09/06 00:20 Post edited by: neetikamittal, at: 2006/09/06 00:22
  13. Hi, My problem is. I want to populate the parameter values against a single key . I created a parameter named homephone ($P{homephone}) of type String as in database values r of type char[10] then in report design I place the same parameter on the detail section. I tried the below code(giving an arraylist values to a single key.and then converting those arraylist values into an array and then to a string array as my parameter is of type string. so plz have a look at the code. and also I am attaching jrxml file for reference. public void runReport(String databaseName, String userName, String password,String reportFile,HttpServletResponse res,HttpServletRequest req) { try{ JasperDesign jasperDesign = JRXmlLoader.load(reportFile); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); Class.forName("com.mysql.jdbc.Driver"); Connection jdbcConnection = DriverManager.getConnection(databaseName,userName,password); PrintWriter out = res.getWriter(); Map hphones=new HashMap(); String name = req.getParameter("firstName"); String cb1 = req.getParameter("homeinfo"); if(cb1.equals("on")) { PreparedStatement stmt = jdbcConnection.prepareStatement("select firstName, homePhone from person where firstName = ?"); stmt.setString(1,name); ResultSet rs = stmt.executeQuery(); ArrayList names = new ArrayList(); while (rs.next()) { names.add(rs.getString("homePhone")); Object ia[] = names.toArray(); int len=ia.length; String[] s1=new String[len]; for(int i=0;i<ia.length;i++) { s1= ia.toString(); } hphones.put("homephone",s1); //String s = rs.getString("homePhone"); // hphones.put("homephone",rs.getString("homePhone")); hphones.put("firstname",name); } JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,hphones,jdbcConnection); JRHtmlExporter exporter = new JRHtmlExporter(); Map imagesMap = new HashMap(); req.getSession().setAttribute("IMAGES_MAP",imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,out); exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,Boolean.FALSE); exporter.exportReport(); [file name=ctisreport1-462ed27cef2de3dc5c0ba85b3aa7badd.jrxml size=22880]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ctisreport1-462ed27cef2de3dc5c0ba85b3aa7badd.jrxml[/file]
  14. Hi, In the database homephone is defined as type char[10] not of String type. So I defined a parameter homephone with type as java.lang.String and default expression as new String("") I am attaching the jrxml file. plz have a look at it. Thanks Neetika [file name=ctisreport1.jrxml size=22944]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ctisreport1.jrxml[/file]
  15. Great work. But it don't have query builder. or it is there. b'coz query builder was next release feature. But it looks gud and really a hard work.
  16. Hi Friends, So far now I have successfully generated a web based reports Now I am trying to generate a report based on input form parameters. I have a input form having a input field of name and a checkbox option regarding homephone no. so based on the name given and checkbox option (yes) report will give list of all the persons of that name and their respective homephone nos. my problem is in HASHMAP parameter how can I associate multiple values to a single key. here is the code snippet. Name field is printing very well. but wat about the phone nos. I tried arraylist but it is giving a error. Plz have a look at it. I checked it values of arraylist are stored very well against homephone key. but while generating report it is giving error:---> Could not create the report Incompatible java.util.ArrayList value assigned to parameter homephone in the ctisreport1 dataset. Incompatible java.util.ArrayList value assigned to parameter homephone in the report1 dataset. JasperDesign jasperDesign = JRXmlLoader.load(reportFile); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); Class.forName("com.mysql.jdbc.Driver"); Connection jdbcConnection = DriverManager.getConnection(databaseName,userName,password); PrintWriter out = res.getWriter(); Map hphones=new HashMap(); String name = req.getParameter("firstName"); String cb1 = req.getParameter("homeinfo"); if(cb1.equals("on")) { PreparedStatement stmt = jdbcConnection.prepareStatement("select firstName, homePhone from person where firstName = ?"); stmt.setString(1,name); ResultSet rs = stmt.executeQuery(); ArrayList names = new ArrayList(); while (rs.next()) { names.add(rs.getString("homePhone")); hphones.put("homephone",names); //String s = rs.getString("homePhone"); //hphones.put("homephone",rs.getString("homePhone")); hphones.put("firstname",name); } JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,hphones,jdbcConnection); JRHtmlExporter exporter = new JRHtmlExporter(); Map imagesMap = new HashMap(); req.getSession().setAttribute("IMAGES_MAP",imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,out); exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,Boolean.FALSE); exporter.exportReport(); It seems like report is having problem in filling values of homephone nos in the parameter given in report . I also created two parameters which I defined here during Ireport design. Thanks(hope to hear soon) Neetika
  17. Hi Frends, my earlier query is http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=518&catid=9 so anybody can help me in passing the runtime fields values to subreport . Plz help me. I tried to give something like "http://localhost:8080/myapp/subreport?emp_id=$F{emp_id}" This emp_id is added as parameter in both subreport amd masterreport. But In my servlet I am getting value of emp_id as ((java.lang.Integer)field_emp_id.getValue()) I was expecting to get yje runtime value of emp_id of masterreport. in 'hyperlinked ref. expression ' field . but if i am giving "http://localhost:8080/myapp/subreport?emp_id=2" Its working but this is hardcoding and its generating subreport related to emp_id =2 only. I want to generate subreports of employee on whose emp_id I will click . Plz help . servlet code is given for reference [file name=servlet.txt size=2669]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/servlet.txt[/file]
  18. Hi Admin/Frends, I give reference to a servlet and also give the parameter value also .E.g "http://localhost:8080/myapp/subreport1?emp_id=2" It is working fine but this is hard coding of parameter passing to a subreport. I want to generate subreports based on the value of the textfield which I hyperlinked to my subreport. I have one textfield named $F{emp_id} and in its hyperlinked reference expression I tried to give "http://localhost:8080/myapp/subreport1? emp_id=$F{emp_id}" so that when masterreport runs whatever value it has in this "emp_id " field ,I can pass the same value to subreport to generate data. but its showing this http://localhost:8080/myapp/select1.do?emp_id=((java.lang.Integer)field_emp_id.getValue()) I was expecting to get the runtime value of emp_id field of masterreport. One can say on the fly subreport generation . Can anybody tried this thing. Plz help me in this as soon as possible. here is my previous query http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=382&catid=9 Post edited by: neetikamittal, at: 2006/08/02 20:50
  19. Hi frends, What I am trying to do is using a query builder tool I am saving a query say Query1.sql But in ireport when I am trying to load that query from that loaation It is uploading but not in readable format.I suppose it is uploading in different encoding scheme. I am using Navicat query builder tool but it is storing query in its own directory. So my question is can't I upload a query generated by some query builder tool in ireport. Thanks Neetika
  20. Hi Admin, Really people like you are great and important for the developer community. Thanks a lot. Now its working and I will love to help someone having the same criteria. Thanx Neetika Mittal
  21. Thanks admin, It raises one more question like how can I get a subreport by clicking on a text field hyperlink in master report. I am confused like whether I need to put a subreport element on master report itself or I just need to right click on hyperlinked text field and in its properties I need to give the path of subreport.jasper file. Actually its not cleared in documentation that what hyperlink type i need in order to have a subreport in masterreport and what one is needed to write in "HYPERLINKED ANCHOR EXPRESSION" field. When I am giving subreport.jasper file in reference expression,I am not getting a html output rather I am getting A jasper view of file. Plz do tell me what should I need to do get a hyperlinked generated subreport from a java code. What should I place on my masterreport to do this? What parametre I need to set up and their values as well? Also In java code what should I write? Do I need a separate servlet code for subreport? where to put all .jasper files in my tomcat/webapp/... directory? Plz I know These can be basics but It Will help others also. If you have any links,codes,tuorial ,you are welcomed. I am attaching my servlet code for reference. Thanks Neetika Post edited by: neetikamittal, at: 2006/08/01 01:07 Post edited by: neetikamittal, at: 2006/08/01 01:10
  22. Hi Frends, I am stuck in generating subreports via hyperlink . Masterreport is coming up when i deploy the application on tomcat but on hyperlink text,Clicking is not making any effect,But in status bar path of the file which I mentioned in "Hyperlink Reference Expression" field is shown. I mentioned there the path of the html file i.e "C:\testing\subreport2.html" Do I need to do coding in my servlet code for subreport generation. One more thing is I didn't put any subreport element in master file.What I did is I just put 3 fields .One field out of them I tried to make as hyperlink by right clicking and giving the values to hyperlink properties as "Reference" and In reference type expression "C:\testing\subreport2.html" Thats it. now plz tell me where I did the wrong. Thanks neetika
  23. Hi Frends, I am able to make a subreport generation from master report.But in 'Hypertype link' field I filled it the value "Reference" & in hyperlink Reference Expression I gava the path of subreort as"c:\testing\subreport.html" In Ireport itself it is working but when I try to deploy it on Tomcat ,Masterreport is coming and image is also coming but clicking on the image it is not openning subreport. So can anybody help me about this. LIke should i write something. in servlet or some addition of jar files are needed. where to put those sureports in tomcat directory. Help me in solving this. Thanks Neetika
  24. Hi, Can any body tell the steps to generate a sub report via hyperlink. Like if I put a image in my report then on right click in properties menu I got one tab named hyperlink. But now I don't know what HYPERLINK TYPE I should choose to connect to another report 1.e subreport. What should I put in anchor name expression. I am using 1.2.4 ,jdk1.5,mysql5.0,tomcat5.5 Plz tell me each and every step. Thanks Neetika
  25. Hi Frends, Do ant body knows about the latest release of ireport s. Somebody told me that Query builder tool will be the new feature in the next release on ireport. Currently ireport1.2.5 is there. If the new release will come up in a week then It will all my hard work of 2 weeks .otherwise I has to work on Pentaho Report designer which currently is having some of the capability of query building by showing tables in left side window and Default 'insert select ' option. Reply me as soon as possible. Thanks Neetika
×
×
  • Create New...