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

greylimbo

Members
  • Posts

    26
  • Joined

  • Last visited

greylimbo'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. You need to implement a customizer class have a look at this link http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=39979&catid=9&limit=6&limitstart=0
  2. You need to implement a renderer. this will probally help http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=39979&catid=9&limit=6&limitstart=0
  3. Yeah we had this issue, so we implemented this Code: <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[JasperCompileManager.compileReport(getClass().getResource("/templates/subreport.jrxml"«»).openStream())]]></subreportExpression> within the mainReport thereby compiling the subreport jrxml everytime the main report is run. We have since changed this to compile and jar up all our jrxml files in a ant script, which then also handles all the fonts and customizer classes we have to go with our reports.
  4. This is an example of a chart customizer I have working, I jar up the class and add a classpath in ireports. eg: Options->Classpath->Add jar and viola it works like a charm. Code:public class BillingChartCustomerizer implements JRChartCustomizer { public void customize(final JFreeChart chart, final JRChart jasperChart) { final GroupedStackedBarRenderer renderer = new GroupedStackedBarRenderer(); final KeyToGroupMap map = new KeyToGroupMap("C1"«»); map.mapKeyToGroup("group1", "C1"«»); map.mapKeyToGroup("group2", "C1"«»); map.mapKeyToGroup("group3", "C2"«»); renderer.setSeriesToGroupMap(map); renderer.setItemMargin(0.0); final CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setAxisOffset(RectangleInsets.ZERO_INSETS); plot.setRenderer(renderer); } }
  5. Place the pie chart in the summary band with a counter for each of the 4 types.
  6. check out this thread http://www.jasperforge.org/index.php?option=com_joomlaboard&func=view&id=36107&catid=8
  7. check this thread http://www.jasperforge.org/index.php?option=com_joomlaboard&func=view&id=36107&catid=8
  8. Tahoma Bold.ttf and Verdana Bold Italic.ttf Post edited by: greylimbo, at: 2008/04/08 14:26
  9. and here is the xml data [file name=statementInputData.xml size=2916]
  10. Here is the jrxml that truncates the text [file name=StatementCurrentSRFont2.jrxml size=2911]
  11. Sorry for the delay, but here is the test case. I have tried to debug, and found JRPdfExporter bombs on "phrase.add(chunk);" line 1629 in "protected Phrase getPhrase(JRStyledText styledText, JRPrintText textElement)" and the exception thrown is "java.lang.ClassNotFoundException: com/lowagie/text/rtf/RtfBasicElement" it bombs when I try step into "phrase.add(chunk);" I have included a jrxml referencing a .ttf font that works "StatementCurrentSRFont1.jrxml" and the one that bombs "StatementCurrentSRFont2.jrxml" and a test xmldatasource that I am using. "StatementCurrentSRFont2.jrxml" is the jrxml that references "Verdana Bold Italic.ttf" and is the one that truncates the font. Thanks again. [file name=StatementCurrentSRFont1.jrxml size=2903]
  12. I have also noticed this bug? Im using ttf fonts with my Pdf generation. Depending on the font(which leads me to suspect this maybe a ttf font specific problem), an exact number of characters is ommited from the large textfields. This varies according to the font used.
  13. The main report Code:<?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="main" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <queryString language="xPath"><![CDATA[/tubeList//tube]]></queryString> <field name="rfdTubeListClient" class="java.lang.String"> <fieldDescription><![CDATA[rfdTubeListClient]]></fieldDescription> </field> <field name="rfdTubeListGrade" class="java.lang.String"> <fieldDescription><![CDATA[rfdTubeListGrade]]></fieldDescription> </field> <field name="user" class="java.lang.String"> <fieldDescription><![CDATA[/tubeList/user]]></fieldDescription> </field> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="30" isSplitAllowed="true" > <staticText> <reportElement x="0" y="0" width="141" height="23" key="staticText-1"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <text><![CDATA[Main report]]></text> </staticText> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="201" y="0" width="100" height="18" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{user}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="24" isSplitAllowed="true" > <subreport isUsingCache="true"> <reportElement mode="Transparent" x="0" y="18" width="535" height="5" backcolor="#FFCC99" key="subreport-1" isPrintRepeatedValues="false" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/> <subreportParameter name="XML_DATA_DOCUMENT"> <subreportParameterExpression><![CDATA[$P{XML_DATA_DOCUMENT}]]></subreportParameterExpression> </subreportParameter> <subreportExpression class="java.lang.String"><![CDATA["templates/subreport.jasper"]]></subreportExpression> </subreport> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="12" y="0" width="100" height="18" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{rfdTubeListClient}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="141" y="0" width="100" height="18" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{rfdTubeListGrade}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport> and then the subreport Code:[code] <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="subreport" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <queryString language="xPath"><![CDATA[/tubeList//selectionCriteria]]></queryString> <field name="name" class="java.lang.String"> <fieldDescription><![CDATA[name]]></fieldDescription> </field> <field name="value" class="java.lang.String"> <fieldDescription><![CDATA[value]]></fieldDescription> </field> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="36" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="535" height="18" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="18" width="535" height="18" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{value}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport>
  14. This is easy as pie. have included a small example mainreport, subreport and make sure your xml datasource has "<?xml version="1.0" encoding="UTF-8"?>" at the begining. good luck! [file name=testData.xml size=3080]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/testData.xml[/file]
  15. try the xml example and here is a xpath link thats usefull http://www.zvon.org/xxl/XPathTutorial/General/examples.html
×
×
  • Create New...