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

mohanbelaguli

Members
  • Posts

    8
  • 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 mohanbelaguli

  1. Hi Guys I have to display 50 rows per page in a pdf document. For this I used following peice of code in the jrxml 1. <group name="group_1" isStartNewPage="true" isResetPageNumber="true" > <groupExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%50==0)]]></groupExpression> </group> 2. <break> <reportElement uuid="ef99bfff-1ce6-4adb-ab3d-54ad1782f795" x="0" y="20" width="100" height="1"> <printWhenExpression><![CDATA[$V{REPORT_COUNT} % 50 == 0]]></printWhenExpression> </reportElement> </break> In the first case it is randomly putting the values in each page like 1st page 25,2nd page 2, 3rd page 30 like that In the second 50 records are comming but inserting blank page in the end everytime So either I have to achive proper records using <group or eliminate the blank page comming at the last using <break> I have been trying from 2 days and unable to achive either of them. Can anybody pls guide me on this
  2. Hi I have a tabular data of 25 columns above which I have to display some three lines of information. When I export the data to csv empty commas are getting appended for the information i display above the table It is something like this Report Name,,,,,,,,,,,,,,,,,,,,,,,,,,,, Report Info,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Generated Date,abc,,,,,,,,,,,,,,,,,,,,,, column1,column2,column3,column4,column5,column6,column7,column8 row1,row2,row3,row4,row5,row6,row7,row8 For the data above the column, the empty commas are getting added whose number is equal to the number of columns in the table Can some body pls suggest me how to avoid these extra commas. My requirement is some thing like this Report Name Report Info Generated Date,abc column1,column2,column3,column4,column5,column6,column7,column8 row1,row2,row3,row4,row5,row6,row7,row8 I want to strip off those extra commas when the report gets generated. Can somebody pls sugges me how to go about doing this as this has become very critical for my project
  3. Hi I have a tabular data of 25 columns above which I have to display some three lines of information. When I export the data to csv empty commas are getting appended for the information i display above the table It is something like this Report Name,,,,,,,,,,,,,,,,,,,,,,,,,,,, Report Info,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Generated Date,abc,,,,,,,,,,,,,,,,,,,,,, column1,column2,column3,column4,column5,column6,column7,column8 row1,row2,row3,row4,row5,row6,row7,row8 For the data above the column, the empty commas are getting added whose number is equal to the number of columns in the table Can some body pls suggest me how to avoid these extra commas. My requirement is some thing like this Report Name Report Info Generated Date,abc column1,column2,column3,column4,column5,column6,column7,column8 row1,row2,row3,row4,row5,row6,row7,row8 I want to strip off those extra commas when the report gets generated. Can somebody pls sugges me how to go about doing this as this has become very critical for my project
  4. Hi I want to align the data while exporting to excel. I am using <jr:table to display a table data which has 35 columns in it. Above the table I have to display three lines of data. I have defined three text fields in the title band and <jr:table in the detail band. The three lines of data which I am displaying is occpying cell A and B depending on the lenght After which <jr:table data is getting displayed I want the three fields in the title band and <jr:table in the detail band to display from cell A.Now what is happening is the field in the title band is dispplaying at cell A and <jr:table data is displaying from cell B A B c field1 field2 header1 header2 tablevalue1 tablevalue2 I want to display something like this A B c field1 field2 header1 header2 tablevalue1 tablevalue2 Can any body pls help me in this regard. I tried all possible cominations and i am at a loss how to proceed on this. A screen shot is attached
  5. Hi Sanbez I thank you profusely for your help in this regard. I implemented subreports. I am exported the files to csv but the the subreport records are not comming exactly below the other. Some extra commas are getting added Eg: Field1,,,Field2 abcdedf,,,1 ,insideName,insideId1, second,,,2 ,insideName,insideId2, In csv it is getting added like this if I add subreport data. Here the data under Field1 and Field2 are comming form Employee and insideName and insideId1 are comming from subreports Field1 Field2 abcdedf 1 insideName insideId1 second 2 insideName insideId2 The data i am feeding like this Bean bean1 = new Bean(); Employee emp = new Employee(); emp.setId("1"); emp.setName("abcdedf"); bean1.setEmps(emp); Employee empIns = new Employee(); empIns.setId("insideId1"); empIns.setName("insideName1"); bean1.setEmpList(Arrays.asList(new Employee[]{empIns})); Bean bean2 = new Bean(); Employee emp1 = new Employee(); emp1.setId("2"); emp1.setName("second"); bean2.setEmps(emp1); Employee empIns1 = new Employee(); empIns1.setId("insideId2"); empIns1.setName("insideName2"); bean2.setEmpList(Arrays.asList(new Employee[]{empIns1})); Can you pls let me know if we can arrange the data to come one below the other if you have come across My Main jrxml Code: My Subreport jrxml Code: Post Edited by mohanbelaguli at 07/11/2012 08:08 Post Edited by mohanbelaguli at 07/11/2012 08:10
  6. Hi Sanbex Thaks for the reply. I haved started implementing your suggestion and subscriber data is comming properly.I tried embedding the subreport for dependents but there were some issues and data was not getting displayed. Since even in subreport we have to iterate through the collection of dependent objects, I thought I will achve this in main report and then transfer to sub report. While iterating I am not getting the individual values during iteration. I have tried to achive similar structure with diffent objects Class A{ private List<Employee> empList; private Employee emps; } I am able to display Employee emps. But not able to display the elements in empList; Pls have a look at the code below: I have declared fields as shown below <subDataset name="dataset1" uuid="09015d96-ad5a-4fed-aa9e-19d25e02e205"> <field name="empList" class="java.util.List"> <fieldDescription><![CDATA[empList]]></fieldDescription> </field> </subDataset> <field name="emps" class="Employee"> <fieldDescription><![CDATA[emps]]></fieldDescription> </field> I am displaying data as show below: <detail> <band height="224" splitType="Stretch"> <textField> <reportElement uuid="5a1f7a60-468e-4c32-a55b-d095276f0fc2" x="0" y="0" width="100" height="20"/> <textElement/> <textFieldExpression><![CDATA[((Employee)$F{emps}).getName()]]></textFieldExpression> </textField> <textField> <reportElement uuid="1fafdabd-3f1b-4175-90bf-fc807d81a42e" x="100" y="0" width="100" height="20"/> <textElement/> <textFieldExpression><![CDATA[((Employee)$F{emps}).getId()]]></textFieldExpression> </textField> <componentElement> <reportElement uuid="66786f07-dbf9-4c05-a769-f76d07261bca" key="table" x="0" y="20" width="802" height="204"/> <jr:list xmlns:jr="" xsi:schemaLocation="" printOrder="Vertical"> <datasetRun subDataset="dataset1" uuid="a669f047-7641-464d-9560-559b865a2af5"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{empList})]]></dataSourceExpression> </datasetRun> <jr:listContents height="204" width="802"> <textField> <reportElement uuid="30f2b194-b444-4c09-aed2-c99023ecf505" x="130" y="77" width="100" height="20"/> <textElement/> <textFieldExpression><![CDATA[name]]></textFieldExpression> </textField>http://jasperreports.sourceforge.net/xsd/components.xsdhttp://jasperreports.sourceforge.net/jasperreports/componentshttp://jasperreports.sourceforge.net/jasperreports/components <textField> <reportElement uuid="30f2b194-b444-4c09-aed2-c99023ecf505" x="130" y="77" width="100" height="20"/> <textElement/> <textFieldExpression><![CDATA[id]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> </band> </detail> In the above code I am able to display <textFieldExpression><![CDATA[((Employee)$F{emps}).getName()]]></textFieldExpression> and <textFieldExpression><![CDATA[((Employee)$F{emps}).getId()]]></textFieldExpression> But in I have to iterate through the empList and display the id and name inside the list. I am not getting the id and name at all while iterating through the list Can u pls suggest me a way how I can iterate through the list where datasource comes from a bean like <field name="empList" class="java.util.List"> My jrxml and data I am feeding like this ArrayList employeeList = new ArrayList(); Bean bean1 = new Bean(); Employee emp = new Employee(); emp.setId("1"); emp.setName("abcdedf"); bean1.setEmps(emp); bean1.setEmpList(Arrays.asList(new Employee[]{emp})); Bean bean2 = new Bean(); Employee emp1 = new Employee(); emp1.setId("2"); emp1.setName("second"); bean2.setEmps(emp1); bean2.setEmpList(Arrays.asList(new Employee[]{emp1})); students.add(bean1); students.add(bean2); JRBeanCollectionDataSource(Employee.getEmlList())) new Post Edited by mohanbelaguli at 07/10/2012 16:07
  7. Hi All I am new to jasper reports but I am required to develop a fairly complex report(w.r.t organization of the datasource). I have to use javabean as the datasource. I have datasource bean as shown below: pulic class A{ Subscriber subscriber; List<Dependent> dependentList; } I have to create a table where each bean in the Collection corresponds to one row in the table. But after displaying subscriber as one row. I have to iterate through a collection of dependentList and display as subsequent rows. Here the properties in both Subscriber and Dependent are same an I have list of A type objects. If I represent the same in jsp its translates to something like this: <table> <% for(int i=0;i<alist.size();i++) { A a = (A)alist.get(i); Subscriber subscriber = a.getSubscriber; List<Dependent> dependent = a.getDependentList(); %> <tr> <td> <%=subscriber.getData()%> </td> </tr> <% for(int i=0;i<dependent.size();i++) { Dependent dependent = (Dependent)dependent.get(i); %> <tr> <td> <%=dependent.getData()%> </td> </tr> <% } } %> </table> 1. Iterate through a list to get subscriber and List<Dependent> objects 3. Create a row with subscriber data 4. Iterate through List<Dependent> and create rows which each data I browsed through the net,e- books and demos for past two days. I found <jr:table but it just takes collection of similar beans and not assorted data like this. I went through subreports but we cannot arrange that in a table structure with each row comming from different datasource. I am goind mad. Can somebody pls guide me how can I implement the above structure. What feature in jreports I can use to implement this. I am running out of time can somebody pls guide me on this
  8. Hi All I am implementing table with java bean as the datasource. With the code given below I am getting the table.But first record is getting incremented and am getting only from the second record. I went through all the links in the google as well as the related threads. As given in the http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html#FAQ20 I tried REPORT_DATA_SOURCE as a parameter as shown below in the jrxml file. I dint find solution in any of the threads <parameter name="TableDataSource" class="net.sf.jasperreports.engine.JRDataSource"/> and using dataSourceExpression as <dataSourceExpression><![CDATA[$P{TableDataSource}]]></dataSourceExpression> But it is always returning empty table however if I give REPORT_DATA_SOURCE like <datasetParameterExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></datasetParameterExpression> the records are comming except the first CAn anybody pls let me know what I am doing wrong. I am a newbie to jasper reports and have critical deliverable. somebody pls help MY JRXML My JavaBean Source Main File Can anybody tell me what mistake I am doing Post Edited by mohanbelaguli at 07/03/2012 13:57 Post Edited by mohanbelaguli at 07/03/2012 13:59
×
×
  • Create New...