Jump to content
Changes to the Jaspersoft community edition download ×

andrey_nado

Members
  • Posts

    55
  • 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 andrey_nado

  1. Sometimes I see following error when generating PDF report with time series chart: java.lang.ClassCastException: net.sf.jasperreports.charts.fill.JRFillBarPlot cannot be cast to net.sf.jasperreports.charts.JRTimeSeriesPlot at net.sf.jasperreports.engine.fill.DefaultChartTheme.createTimeSeriesChart(DefaultChartTheme.java:1595) at com.myapp.MyCustomTheme.createTimeSeriesChart(MyCustomTheme.java:346) ...What is JRFillBarPlot and how coult it substitute the expected JRTimeSeriesPlot? I'm using JasperReports 6.2.0. Thanks
  2. This bug (unwanted Helvetica in PDF) occurs when my default style has conditional font selection. Here is a sample: <style name="def" isPdfEmbedded="true" pdfEncoding="utf-8" isDefault="true"> <conditionalStyle> <conditionExpression><![CDATA[boolean.TRUE]]></conditionExpression><style fontName="Arial" pdfFontName="Courier" /></conditionalStyle><conditionalStyle><conditionExpression><![CDATA[boolean.FALSE]]></conditionExpression><style fontName="Times" pdfFontName="Times" /></conditionalStyle></style> After PDF report is built I notice "Helvetca" in the font list.
  3. I embed HTML content into my report using htmlcomponent demo. My content is big and does not fit on one page. I need my <componentElement> to be rendered on several pages, and rather it isrendered on a single page and scaled. I tried different scaleType's with no success. Questions: 1) Can this demo be simply modified to support multi-page components? 2) What another solution can help me? I am aware about iText PdfCopy functionality, but I'd like to integrate HTML into reports (with default footers and headers). Thank you.
  4. I have a text element with HTML markup. I know that JasperReport supports very limited subset of HTML tags in such a elements, and "font" tag is supported. Question: is it possible to make size of the font smaller that base size? For example, what markup should be used to display "Smaller text" in reduced font size? The "-1" size does not work as expected, the "1" size makes font larger. <staticText> <reportElement x="0" y="0" width="100" height="100"/> <textElement markup="html"/> <text><![CDATA[ Base Text <font size="-1">Smaller Text</font> ]]></text> </staticText>
  5. Hi! I know that JFreeCharts library is used when generating charts for reports in PDF format. Is there a way to use any other charting library for PDF format? Thanks
  6. In my case I need MultiplePiePlot charts and only legal way is to use chart themes. It would be great if I have a possibility to customize JFreeChart instantiation not by using themes. Finer grained extension points would be great too.
  7. Hi, JasperReports team! Thanks for great library. I need my custom chart theme, but my only goal is to create special pie charts. Other functionality should be pretty standard. I decided to extend standard class net.sf.jasperreports.engine.fill.DefaultChartTheme and override createPie3DChart and createPieChart methods. They both are protected, thanks! My question: are these two methods the part of contract of DefaultChartTheme class? Will this class be dramatically changed in the future versions of JasperReports and createPie3DChart and createPieChart methods disappear or change their signatures? Is my approach safe and correct enough? Regards, Andrey
  8. Hi! My xyAreaChart looks not good due to very sharp edges. I have 1000 (one thousand) data points and this does not help. I export my reports to PDF format, and sharpness does not disappear,all "squares" on the curve are scaled with PDF document. Please look attached image - the sample of the problem. I also attached JRXML fragment which builds the chart. I checked values I pass to the chart, they all are of Double type and have good precision. I even plotted the chart in the Excel using my numbers, and the Excel chart looks good. So this is not a number precision issue. Thanks! Code:<xyAreaChart> <chart isShowLegend="false" customizerClass="my.customizer" renderType="draw"> <reportElement x="0" y="0" width="256" height="172"/> </chart> <xyDataset> <xySeries> <seriesExpression><![CDATA[$F{seriesName}]]></seriesExpression> <xValueExpression><![CDATA[$F{first}]]></xValueExpression> <yValueExpression><![CDATA[$F{second}]]></yValueExpression> </xySeries> </xyDataset> <areaPlot> <plot/> <categoryAxisLabelExpression><![CDATA["Return"]]></categoryAxisLabelExpression> <categoryAxisFormat> <axisFormat tickLabelMask="#0.0%"> </axisFormat> </categoryAxisFormat> <valueAxisLabelExpression><![CDATA[]]></valueAxisLabelExpression> <valueAxisFormat> <axisFormat> </axisFormat> </valueAxisFormat> </areaPlot></xyAreaChart>
  9. Hi! I have two workstations with the same versions of JasperReports, JFreeChart and iText. They both work under Sun's version 1.6 of Java. All fonts required in reports are installled on both workstations. I'm generating reports in PDF format. The first workstation is RedHat i386 and it works perfectly, all report's charts have labels and titles. The second workstation is Debian amd64 and everything works but text in charts: no labels and titles. I undestand that this seems to be JFreeChart issue, but could you recommend something to solve it or at least localize error? Thanks.
  10. Hi! I'm working with crosstabs and I have met following problem. My text fields in crosstab cells are using backcolor attribute together with mode="Opaque". I just want to colorize my data cells. In row header text field may contain long pieces of text which may be wrapped into several lines. Text field is stretched accordingly as well as corresponding crosstab rows. Now the problem: text fields in data cells are not stretched! I see it because only part of cell is filled by expected color. Code fragment is attached. Is there any workaround? Is this a bug and should I create issue in bugtracker? Regards, Andrey Code:<crosstab> <reportElement x="0" y="0" width="522" height="600"/> <crosstabParameter name="src" class="com.myproject.DataSource"> <parameterValueExpression><![CDATA[$P{src}]]></parameterValueExpression> </crosstabParameter> <crosstabDataset isDataPreSorted="true"> <dataset> <datasetRun subDataset="dataset1"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{src}.getData())]]></dataSourceExpression> </datasetRun> </dataset> </crosstabDataset> <rowGroup name="orderNo" width="102"> <bucket> <bucketExpression class="java.lang.Integer"><![CDATA[$F{orderNo}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents> <textField isStretchWithOverflow="true"> <reportElement x="0" y="0" width="102" height="10" /> <textFieldExpression class="java.lang.String"><![CDATA[$P{src}.getEntryName($V{orderNo})]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents/> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="field" height="10"> <bucket> <bucketExpression class="java.lang.String"><![CDATA[$F{field}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents> <textField> <reportElement x="0" y="0" width="30" height="10"/> <textFieldExpression class="java.lang.String"><![CDATA[$V{field}]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents/> </crosstabTotalColumnHeader> </columnGroup> <measure name="valueMeasure" class="java.lang.Double"> <measureExpression><![CDATA[$F{value}]]></measureExpression> </measure> <crosstabCell width="30" height="10"> <cellContents> <textField pattern="#0.00%" isBlankWhenNull="true"> <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="30" height="10" mode="Opaque" backcolor="#F0F0F0" /> <textFieldExpression class="java.lang.Double"><![CDATA[$V{valueMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell></crosstab>
  11. I reviewed JR manual and found solution: headerPosition="Stretch". Thank you, Lucian! I would be great if iReport could edit this property too.
  12. Any ideas? My only idea is to put behind the text an box with dynamically created image of desired size & color. I'm afraid resulting documents may become too heavy for their viewers.
  13. Hi! I need to create text elements with background color specified in runtime. I'm trying to use styled text elements and specify "backcolor" attribute in "style" element within text expression (see sample code). Unfortunately backcolor is only displayed under text, entire element box is not filled by desired color. How can I make JasperReports to fill entire box? Thanks Code:<textField> <reportElement x="0" y="0" width="100" height="20" /> <textElement isStyledText="true" /> <textFieldExpression class="java.lang.String"> <![CDATA["<style forecolor=\"red\" backcolor=\"blue\">Sample Text</style>"]]> </textFieldExpression></textField>
  14. Hi! I'm using crosstab with two column groups - "kind" and "columnId", which use two data columns respectively. Data cells are narrow - 24 points. Width of the second level header cells ("columnId") is the same - obviously. Width of the first level header cells ("kind") depends on how many cells it contains - great! Now I have to put long test into first level headers (there is a lot of space within them). I'm trying to place text element with width=96 points. This makes my JRXML invalid! Is it possible to get what I need? Thanks. 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="myreport" pageWidth="522" pageHeight="300" columnWidth="522" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <template><![CDATA[msg("{0}styles.jrtx", $P{template_path})]]></template> <parameter name="template_path" class="java.lang.String" isForPrompting="false"/> <field name="name" class="java.lang.String"/> <field name="columnName" class="java.lang.String"/> <field name="value" class="java.math.BigDecimal"/> <field name="columnId" class="java.lang.Object"/> <field name="kind" class="java.lang.Integer"/> <background> <band/> </background> <title> <band/> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band/> </columnHeader> <detail> <band/> </detail> <columnFooter> <band height="78"> <crosstab> <reportElement x="210" y="0" width="312" height="78"/> <rowGroup name="name" width="0"> <bucket> <bucketExpression class="java.lang.String"><![CDATA[null]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents/> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="colKind" height="30"> <bucket> <bucketExpression class="java.lang.Integer"><![CDATA[$F{kind}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="normal" x="0" y="0" width="96" height="30"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[ $V{colKind}.intValue() == 0 ? "Very Long Text 1" : $V{colKind}.intValue() == 1 ? "Very Long Text 2" : "Very Long Text 3" ]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents/> </crosstabTotalColumnHeader> </columnGroup> <columnGroup name="colName" height="30"> <bucket> <bucketExpression class="java.lang.Integer"><![CDATA[$F{columnId}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="normal" x="0" y="0" width="24" height="30"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{colName}]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents/> </crosstabTotalColumnHeader> </columnGroup> <measure name="valueMeasure" class="java.math.BigDecimal"> <measureExpression><![CDATA[$F{value}]]></measureExpression> </measure> <crosstabCell width="24" height="10"> <cellContents> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField pattern="#0.00" isBlankWhenNull="true"> <reportElement style="normal" x="0" y="0" width="24" height="10"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{valueMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell height="10" rowTotalGroup="name"> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="0" y="0" width="24" height="10"/> <textElement/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{valueMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="24" columnTotalGroup="colName"> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="0" y="0" width="24" height="10"/> <textElement/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{valueMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell rowTotalGroup="name" columnTotalGroup="colName"> <cellContents backcolor="#FFFFFF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="0" y="0" width="24" height="10"/> <textElement/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{valueMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> </crosstab> </band> </columnFooter> <pageFooter> <band/> </pageFooter> <summary> <band/> </summary></jasperReport>
  15. I switched to v3.6, this helps, thanks. BTW is v3.7 working with fonts via some different way? It sees no my fonts (so I have to use v3.6)?
  16. Is JasperReports library free for any use? If yes, where can I download latest versions or JR?
  17. Hi! I'm feeding my pie chart with sorted data (sorted by value rather than key). But chart pies are displayed randomly, not by correct order. How to order by pies? Thank you.
  18. Hello! I'm trying to set borders of text field (of static text). 1) I'm right-clicking on field, choose "padding and borders", fialog is open, borders are not specified. 2) I click border placeholder (say top), then select its width, style and color. 3) I click "OK". 4) Now I open this dialog again on the same text field, borders are not set again, JRXML source has no border declarations too. Thank you.
  19. Hello! My scatter chart displays percent values. In my test case X axis range is (12%, 16%), and X axis range is (2%, 7%) (range is calculated automatically upon data). Now I'd like to make chart axises to start from 0% values, e.g. X range is (0%, 16%), Y range is (0%, 7%). I've added xxxAxisMinValueExpression tags (see code below) to <scatterPlot> tag, but now axis ranges become( -100%, 0%). How can I make it work properly? Thanks. Code:<domainAxisMinValueExpression><![CDATA[bigDecimal.valueOf(0.0)]]></domainAxisMinValueExpression><rangeAxisMinValueExpression><![CDATA[bigDecimal.valueOf(0.0)]]></rangeAxisMinValueExpression>
×
×
  • Create New...