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

Carrm

Members
  • Posts

    3
  • 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 Carrm

  1. My goal is to split a huge text into 3 columns (in equal proportions) using Jasper Reports v6.13. I already achieved something close to my need when the remaining space of the detail band is reduced to 1/3 of the page; I'm able to display my text on 3 columns having the same amount of text. However, when the remaining space of the page is large enough (half the page or more), the detail band will expand and thus the text will be displayed in one giant column and maybe a few lines on the second column. Here is what I've done so far: create a subreport to handle the text and include it in some detail band of my main reportsplit the subreport into 3 columns with vertical displayput a textfield on the first column with Text Adjust to StretchHeightAgain, this works well when the main report's detail band can't expand much since the textfield will overflow on the other columns. My idea was to define some sort of maximum height for the detail band and/or the textfield so that the text will be forced to split without having to reach the bottom of the page. I tried setting the height of both the detail band and the subreport this way: JasperDesign design = JRXmlLoader.load(jrXmlInputStream);JRBand[] detailBands = design.getDetailSection().getBands();JRDesignBand mentionBand = (JRDesignBand) detailBands[detailBands.length - 1];mentionBand.setHeight(110);JRDesignSubreport mentionSubreport = (JRDesignSubreport)mentionBand.getElementByKey("mentions");mentionSubreport.setHeight(100);[/code]It doesn't work. My guess is that it actually defines some sort of minimum height for the band/subreport if the content isn't big enough to overflow rather than a fixed or maximum height. I also tried playing with the "Stretch Type" property with no success. How can I manage to define a maximum or fixed height for the detail band?
  2. I created a new bar chart from scratch and everything worked fine with the same config. After some digging, I figured out that when I first created the initial chart, I put a blank string as the expression to use for labels, thinking that it was the axis label (I didn't want the Value axis' labels to show up). I fixed that, and the first bar chart worked as well. Dumb way to lose days of work.
  3. I'm struggling with Jasper to display value labels on top of the bars of my chart. What I want to generate: I use Jaspersoft Studio, and I checked the "Show Labels" box in "Chart Plot" tab. For test purpose, I use some sort of red and violet for the item label font color and background color, which should be quite visible on the bar chart. My jrxml file looks like this: <barPlot isShowLabels="true" isShowTickMarks="false"> <plot backcolor="#FFFFFF" labelRotation="0.0"> <seriesColor seriesOrder="0" color="#6D74BC"/> </plot> <itemLabel color="#E86841" backgroundColor="#C429B5"> <font fontName="Arial" size="25" isBold="true" isItalic="true" isUnderline="true" isStrikeThrough="true"/> </itemLabel> <categoryAxisFormat labelRotation="0.0"> <axisFormat labelColor="#000000" tickLabelColor="#6D74BC" verticalTickLabels="true" axisLineColor="#6D74BC"> <labelFont> <font fontName="Arial" size="8"/> </labelFont> <tickLabelFont> <font fontName="Arial" size="8"/> </tickLabelFont> </axisFormat> </categoryAxisFormat> <valueAxisLabelExpression><![CDATA[$P{unitFact}]]></valueAxisLabelExpression> <valueAxisFormat> <axisFormat labelColor="#6D74BC" tickLabelColor="#6D74BC" verticalTickLabels="false" axisLineColor="#6D74BC"> <labelFont> <font fontName="Arial" size="8"/> </labelFont> <tickLabelFont> <font fontName="Arial" size="8"/> </tickLabelFont> </axisFormat> </valueAxisFormat> </barPlot> I also tried to use a customizer: @Overridepublic void customize(JFreeChart jFreeChart, JRChart jrChart) { CategoryPlot plot = (CategoryPlot)jFreeChart.getPlot(); plot.getRenderer() .setBasePositiveItemLabelPosition(new ItemLabelPosition( ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER));} I couldn't make it work, I have the bar chart above but without the 110/760 labels. What should I do in order to show these values?
×
×
  • Create New...