Jump to content
JasperReports Library 7.0 is now available ×

ckgupta

Members
  • Posts

    13
  • Joined

  • Last visited

ckgupta'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. Thanks frankhassanabad for your response. I do not feel the need of sliding other colums to the left automatically, its ok if that column appears blank. What my concern is that the column header should not be visible if there is no data for that field in any row. for example for data in dataBase as ------------------------------- Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark <null> 103 Robert <null> 104 Report should look like ---------------------------------- Name RollNo ------- ----------- John 102 Mark 103 Robert 104
  2. Code:<?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="13"/> <property name="ireport.y" value="0"/> <field name="name" class="java.lang.String"/> <field name="class" class="java.lang.String"/> <field name="rollNo" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Name]]></text> </staticText> <staticText> <reportElement x="72" y="0" width="62" height="20"> <printWhenExpression><![CDATA[$F{class} != null]]></printWhenExpression> </reportElement> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Class]]></text> </staticText> <staticText> <reportElement x="147" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Roll No]]></text> </staticText> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField> <reportElement x="72" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{class}]]></textFieldExpression> </textField> <textField> <reportElement x="147" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{rollNo}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport>
  3. PFA jrxml . I would like to give a brief explanation on it . Consider there is a table Student which has 3 columns Name, Class, RollNo Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark XI 103 Robert XII 104 So when I want to display it in report I want to write a printWhenExpression for Class i.e., column header which will be displayed only if there is any non null value available , so in the previous case Class should be displayed ================================================= Now, if we consider an example as written below Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark <null> 103 Robert <null> 104 Then Class should not even be displayed in report as none of the tuples has non null field in it.
  4. Hi , I want to put a printWhenExpression on a static text based on a condition which says that print the label only if there is atleast a non null textField in a particular column in detail band. Its like print the column header only if there is a non null field in that column. I tried putting this expression ( $F{textfield} != null ) but it works only for first record, if first record has null and second record has not null value then the label will be hidden, where as we want it to be displayed. Please reply if you need any more info. Regards, ckgupta
  5. My problem is :- I m trying to migrate reports from JReport to Jasper report, which currently has dataSource in UDS(User Defined dataSource) which gets populated based on an XML. The UDS gets populated by doing a SAXON parser transformation to the XML and convert it into resultSet object( which are nothing but UDS). Now as we have the code for converting the XML into resultSet , I m trying to reuse the existing code and use the resultSet retrieved to fill the Jasper reports. Now I tried several methods. method1 :- I created a map which containd different resultSet objects wrapped in JRResultSetDataSource . It dint work. method2 :- convert resultSet object into Java Beans and form JRBeanDataSource and added it the map. This worked but I this method might lead to memory issue as we will be dealing with hell lot of JavaBeans object which will simply eat up a considerable memory. method3 :- Calling a method in Java class dynamically from JRXMLs as and when required. this method seemed to me as a very feasible approah but not working. Please advice on the best approach as we are in high need of it. Thanks for your quick response, Chandrakant
  6. there are 5 records in iuf40a.TTECHJOBINTERVAL table. I checked running the record for the same table from Master report . It works fine for subreport1 but invoking DataSource for subreport2 from subreport1 doesnt take place. Moreover, I cant use JREmptyDataSource as Subreport2 needs to be filled based on resultSet retreived from iuf40a.TTECHJOBINTERVAL table. I dont have any exception message in console. Even SOPs dont get printed on console which clearly indicates that getResultSet1() is not even getting called for subreport2. Is it actually possible to make Java invocation from subreport1 to fill subreport2 as it is possible for subreport1 from Master Report.
  7. Hi Teodor, Thanks for replying back . I have uploaded the files . It contains a java file and 3 reports(1 Main report and 2 subreports) . Thanks & Best Regards, Chandrakant
  8. Can this method that you suggested be applied if it dataSource is og type JRResultSetDataSource. I tried passing JRResultSetDataSource as a parameter to subreports , but when I ran it says resultSet is closed. Can you please help me on this . Thanks, ckgupta
  9. luv2eat Wrote: Hi, thanks for the reply. i managed to work out passing the datasources to the all the reports, master and sub. however, that worked fine as long as the datasources only have one record. when there are multiple records i get a "unable to get next record" error from jasperreport (the reports are called by a java application-not from iReport). i did a little research and it seemed that the resultset was closed so the next() of JRResultSetDataSource object could not get to it. would you be able to offer any suggestion regarding that? thanks. m also getting this same kind of error , Can anybody please help on this ?
  10. Hi, I m using dataSourceExpression to pass data to a subreport , it works perfectly fine for a subreport , but while calling a subreport within another subreport using dataSourceExpression it is not working . Can anybody help me on this as I m in urgent need of it. I have attached a zip file containing the 3 reports MainReport -> subreport1 -> subreport2 . and a java class for generating the reports. Thanks & Best Regards, Chandrakant
  11. Hi Teodord, Currently I m facing a serious concern with respect to nested subreports using datasource expression. I have tried to call Java method from parent JRXML(to populate its subreport) which is working for a subreport, but when m calling it from the subreport(to populate another subreport) , the Java method is not getting executed at all. Logically, this should work , but no clue what mistake m making . Please help me on this
×
×
  • Create New...