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

sfergus1

Members
  • Posts

    10
  • 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 sfergus1

  1. I'm working on a template where, after adding a chart customizer class, which only changes the stroke type on the grid lines to solid, I've started getting a ConcurrentModificationException. I'm fairly certain this isn't possible, because I'm the only developer on my project and the only person using the system. I have nothing else running in my application while I'm testing my templates. And the other odd thing is that while the Preview pane in iReport 4.5.1. still shows my document, despite the error, the PDF generated is 0 bytes. So it seems that something in writing the PDF is where the exception is being triggered, though I have no idea what to look for. Some times shutting down iReport, deleting the associated .pdf and .jasper files, and starting the preview process over again will work. Though it seems to happen more frequently now. iReport already takes really long to start up the first time, and having to restart it repeatedly to get around this issue is proving cumbersome. Does anyone have ideas on where to start looking to get this resolved? Here's the full text of the exception: Exporting PDF (using iText) to file... C:UserssfergusonDocumentsFMSReleases12_4FMSiReportreports6 - Positive Model Predictors.pdf!Error exporting print... nulljava.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(Unknown Source) at java.util.AbstractList$Itr.next(Unknown Source) at org.jfree.chart.block.BlockContainer.draw(BlockContainer.java:219) at org.jfree.chart.title.LegendTitle.draw(LegendTitle.java:537) at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1328) at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1215) at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1114) at net.sf.jasperreports.charts.util.DrawChartRenderer.render(DrawChartRenderer.java:60) at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(JRPdfExporter.java:1435) at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:787) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:751) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:665) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:388) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:1163) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Export running time: 331[/code]
  2. I have a bar chart in iReport Designer 4.5.1 with the range grid lines enabled. My gray dashed grid line at 0, which is my lower bound, is overlaying the solid black axis line. How do I make the axis line display on top of the grid line? Thanks, Steve
  3. It looks like the problem was likely a build issue. I think the exported font jar file the report expected wasn't included in the build, and the report was falling back to Helvetica, which was causing the positioning to be off. I ran another report this morning and it appears okay.
  4. I was able to further enhance the solution as you noted, copying a slimmed down version of the JrPdfExporter.getFont() method to my own class. I made a call to element.getStyle() and copied the TextAttribute values that interested me to the attribute map getFont() expects. This way I'm able to use the iReport GUI to define different styles for my link elements and still have them apply to the resulting generic object that's included in the PDF. Thank you again for your help.
  5. Thank you very much! This was exactly the push I needed. I've gotten this working and made the solution a bit more generic to allow for any kind of Javascript code attached to the generic element using parameters, just as with the text as you indicated. The modification was trivial. We'll see if it retains formatting here: String linkText = (String)element.getParameterValue("text"); String script = (String)element.getParameterValue("script"); Phrase phrase = new Phrase(); Chunk chunk = new Chunk(linkText); chunk.setAction(PdfAction.javaScript(script, exporterContext.getPdfWriter())); phrase.add(chunk);
  6. It looks like the XML didn't get escaped. Let's try that again.
  7. I have a bar graph with labels rotated a -45 degrees to read on an upward slope, left to right. When I run it in preview mode in iReport it looks fine (see preview.pdf attachment), with all of the labels up against the bottom of the bar graph. When I run it through our Jasper server, the labels appear to be left-aligned instead of right-aligned.. They're all pulled away from the horizontal axis, apparently ragged in their alignment, and the leftmost label is getting cut off (see final.pdf attachment). I do have a chart customizer class for this document, which I use to color the positive values green and the negative ones red, keeping them all in a single series so I don't have to plot empty bars. As part of this I have a custom bar renderer subclass. However, I think I'm copying all of the relevant parameters in the constructor of my class (shown below), and I'm using the same jar file both with iReport and on the Jaspewr Reports server. public CustomBarRenderer(BarRenderer barRenderer, Paint[] colors) { this.colors = colors; // Copy settings for item labels this.setBaseItemLabelsVisible(barRenderer.getBaseItemLabelsVisible()); this.setBasePositiveItemLabelPosition(barRenderer.getBasePositiveItemLabelPosition()); this.setBaseNegativeItemLabelPosition(barRenderer.getBaseNegativeItemLabelPosition()); this.setBaseItemLabelFont(barRenderer.getBaseItemLabelFont()); this.setBaseItemLabelPaint(barRenderer.getBaseItemLabelPaint()); this.setBaseItemLabelGenerator(barRenderer.getBaseItemLabelGenerator()); // Copy other display settings this.setShadowVisible(barRenderer.getShadowsVisible()); this.setMaximumBarWidth(.02); } My JRXML for defining the category labels looks like this: I don't see any attributes I can set to change from left to right aligned in the XML schema. Any suggestions on how to correct this label alignment issue would be most appreciated. Thanks, Steve
  8. Do you happen to have any examples of such a generic element handler for PDFs? The demo library only shows HTML, and doesn't seem to be transferable. I've spent most of the day looking over the code and haven't figured out where to insert my logic. I see that JRPdfExporter.exportGenericElement() hands off control to my new handler. The other case in the code that implements GenericElementPdfHandler (MapElementPdfHandler) generates an image and then delegates back to JRPdfExporter.exportImage(). I don't think that approach is appropriate in my case. Yet to duplicate the path the logic goes through between JRPdfExporter.exportText() and JRPdfExporter.setHyperlinkInfo(), which goes from JRPdfExporter to AbstractTextRenderer to PdfTextRenderer back to JRPdfExporter, I need access to protected attributes of JRPdfExporter (tagHelper, for example). Making my class a subclass of JRPdfExporter seems like one possible way to overcome this, but I'm not sure that's the best (or even a correct) approach. Thanks, Steve.
  9. Thanks for the quick reply. I'll have to take a look into it and see what I can do.
  10. I'm trying to figure out how to embed a control in my document that, when clicked, opens the print dialog to print the currently viewed page. I can do this in Acrobat by setting the Link Properties for an element, then "Run a JavaScript" and "Execute a Menu Item". The code is "this.print(null,this.pageNum,this.pageNum)". What I haven't figured out yet is a) how to include this in a PDF generated using Jasper reports and iReport (4.5.0), or b) how to tie my specific element to trigger such code. I've found the net.sf.jasperreports.export.pdf.javascript property, which seems like it's part of the solution. However, despite weeks of searching and experimenting, I haven't been able to make this work. Is it possible? If so, can it be set up through iReport? Thanks, Steve
×
×
  • Create New...