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

singmal

Members
  • Posts

    4
  • Joined

  • Last visited

singmal's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, I have a scenario where I pass dynamically generated HTML markup text to a textField w:300, ht: 400 defined in a jasper template. There is another static Image defined on the right hadn side of the textField with width: 200, ht:200. Now my html text can be of variable height , so I defined a strettype to RelativeTObandHeight. But my requirement is when PDF is exported the HTML should wrap around the image for the html text which is longer that the Image height. The HTML text part which is longer than the Image height on the right has to occupy complete width of the band {550}. Is this possible. Please let me know if there is a way around it. Thanks -Mallik
  2. Hi, I have 7 colums of textFields ina detail band to paint rows dynamically based on the data. I got the wordwrapping to work. and the columns to resize based on the height of the tallestColumn. Now the conet in the textFields although I have them horintal and vertical align center, it seems like some of the rows are not being aligned right. Can someone suggest a better way of aligning row data when certain cells have data word wordrapped. Attached a snippet of code. Please suggest a solution. -Mallik 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="InfinitiDataGridSection" pageWidth="345" pageHeight="362" columnWidth="345" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <field name="metricName" class="java.lang.String"/> <field name="currentMonthDelta" class="java.lang.String"/> <field name="lastMonthDelta" class="java.lang.String"/> <field name="lastYearDelta" class="java.lang.String"/> <field name="fiscalYTD" class="java.lang.String"/> <field name="fiscalYTDDelta" class="java.lang.String"/> <field name="sectionId" class="java.lang.Integer"/> <detail> <band height="25" splitType="Stretch"> <elementGroup> <frame> <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="345" height="25" isPrintWhenDetailOverflows="true"/> </frame> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="60" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"/> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{metricName}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="60" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"> <printWhenExpression><![CDATA[(!$F{metricName}.equalsIgnoreCase("Total lead requests") && !$F{metricName}.equalsIgnoreCase("Total # of RATD requests")&& !$F{metricName}.equalsIgnoreCase("Total # of eBrochure requests") && !$F{metricName}.equalsIgnoreCase("Total # of BAPs") && !$F{metricName}.equalsIgnoreCase("CMI RATD request"))? Boolean.TRUE : Boolean.FALSE]]></printWhenExpression> </reportElement> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{currentMonthDelta}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="60" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#FF6600"> <printWhenExpression><![CDATA[($F{metricName}.equalsIgnoreCase("Total lead requests") || $F{metricName}.equalsIgnoreCase("Total # of RATD requests")|| $F{metricName}.equalsIgnoreCase("Total # of eBrochure requests") || $F{metricName}.equalsIgnoreCase("Total # of BAPs") || $F{metricName}.equalsIgnoreCase("CMI RATD request"))? Boolean.TRUE : Boolean.FALSE]]></printWhenExpression> </reportElement> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{currentMonthDelta}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="117" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"/> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{lastMonthDelta}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="174" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"/> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{lastYearDelta}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="231" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"/> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{fiscalYTD}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement style="data" stretchType="RelativeToTallestObject" mode="Transparent" x="288" y="0" width="57" height="25" isPrintWhenDetailOverflows="true" forecolor="#000000"/> <box topPadding="2" leftPadding="3" bottomPadding="2" rightPadding="3"> <pen lineWidth="0.5" lineColor="#CCCCCC"/> <topPen lineWidth="0.5" lineColor="#CCCCCC"/> <leftPen lineWidth="0.5" lineColor="#CCCCCC"/> <bottomPen lineWidth="0.5" lineColor="#CCCCCC"/> <rightPen lineWidth="0.5" lineColor="#CCCCCC"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Helvetica" size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{fiscalYTDDelta}]]></textFieldExpression> </textField> </elementGroup> </band> </detail></jasperReport>
  3. I did design a Multi Axis JFreechart where the Y1 is a Bar chart and Y2 is a line chart in iReport and it works just fine which the input datasource. But to add itemLabels on the JFreeCharts I realized that we need to use ChartCustomizers. I did use them , but the problem Iam facing is 1) Customizer(s) is always displaying same BarChart values for linechart as well as item Labels. 2) Also the line chart is not clear for some reason when displayed. Attached files as to how Iam trying to do it. Please let me know if anyone have a solution to this. -Mallik Code:Added code for my java customizers--------------------package chart.customizers;public class BarChartLabelCustomizer implements JRChartCustomizer{ public BarChartLabelCustomizer(){ super(); } public void customize(JFreeChart chart, JRChart jasperChart) { BarRenderer3D renderer = (BarRenderer3D) chart.getCategoryPlot().getRenderer(); renderer.setBaseItemLabelsVisible(true); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseItemLabelFont(new Font("Helvetica",Font.PLAIN,4)); renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER,TextAnchor.BOTTOM_CENTER,TextAnchor.CENTER,80.1)); }}-------------------Second Cutomizer-----package chart.customizers;public class DualYLineLabelCustomizer extends JRAbstractChartCustomizer{ public DualYLineLabelCustomizer(){ super(); } public void customize(JFreeChart chart, JRChart jasperChart) { CategoryItemRenderer renderer = ((CategoryPlot) chart.getPlot()).getRenderer(1); renderer.setBaseItemLabelsVisible(true); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseItemLabelFont(new Font("Helvetica",Font.PLAIN,4)); renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.INSIDE1,TextAnchor.BOTTOM_CENTER)); renderer.setSeriesPaint(0,new Color(246,189,15)); renderer.setSeriesPaint(0,new Color(0,0,0)); renderer.setSeriesStroke(0, new BasicStroke(3)); }}
  4. Hi, I am having issue(s) displaying dynamic HTML content to show up on the PDF. I can only see couple of lines being displayed and the bold , paragraph doesn't work excatly the way they are supposed to work. I created a textField in column Header band. I have selected the markup type as html , in the textfield property and did set the variable html text as a string 'htmlText' parameter set on the java servlet parameters.put("htmlText","has all the html text in it") 1) Does anybody know the limitations on displaying the HTML text in jasper, if there are any ?? 2) How do I implement pagination if the size of the htmlText is larger than the defined columnHeader band width = 300 In our case the htmlText is variable and can be very large at times. Please share your findings (Attached the html code snippet) Thanks regards Mallik Code:<html> <body> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b>China Analysis: August 1 to August 31</b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b>Topic: Forms</b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b>Contact Us</b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b> MMMMMMMMMMMMMMMMMMMMMMMM </b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b> <i>Summary</i> </b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> In August, eBrochure form requests totaled 524, a -15.3% decrease from the month prior. Overall unique visitors to the site were down 10% in the month, leading to the decrease in lead totals. </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b> <i>Campaign Contribution to Lead Requests</i> </b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz. <font kerning="0"></font> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> The Inspired Performance Journey campaign continued to run in August, referring visitors to the branded microsite. Traffic from the microsite to infiniti.com.cn generated 3 eBrochure requests in August. S </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> Despite the P <font kerning="0">roduct</font> online campaign running in August, the share of P <font kerning="0">roduct</font> eBrochure requests is declining slightly m/m, down 2% pts in August. </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b> <i>Paths to the eBrochure form</i> </b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> The main source of traffic to the first step of the eBrochure form is the homepage with 77.6% of form traffic originating from this source. Around 6.7% of form traffic originates from those who directly enter the site on the form page. </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> Around 49.7% of those who visited the first page of the form exited the site from that page and 27% ventured back to the homepage without continuing to fill out the form. </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b> <i>Paths to Contact Us</i> </b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy yyyyyy. </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> <b>Recommendations</b> </font> </p> <p align="Left"> <font face="Helvetica" size="8" color="#454545" letterspacing="0" kerning="1"> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx. </font> </p> </body></html>
×
×
  • Create New...