Jump to content

svenn

Members
  • Posts

    1,063
  • Joined

  • Last visited

  • Days Won

    1

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by svenn

  1. You could create a sub report that produces the information or use a List element in your report. You could then create the top/bottom list with SQL.
  2. The change is not to your jrxml file. You need to create a Java class that you then point to in your jrxml. This requires that you have at least a basic understanding of the Java programming language.
  3. Jasper Report uses JFreeCharts to create charts. Jasper exposes part of JFreeCharts API. To access more properties you need to create your own Java class that extends JRAbstractChartCustomizer. You can then access the chart object and modify it's properties. Looks like you need to do something like this public class MyChartCustomizer extends JRAbstractChartCustomizer public void customize(JFreeChart chart, JRChart jasperChart) { CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.getRenderer().setSeriesStroke(1, new BasicStroke(2.0f)); plot.getRenderer().setSeriesStroke(2, new BasicStroke(2.0f)); .. } Found it in JFreeChart forum http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=21625 Post Edited by svenn at 09/29/2010 15:47
  4. That's exactly what I needed. Thanks a lot. Now I need to figure out how to get the gridlines to change color based on the values./tools/fckeditor/editor/images/smiley/msn/regular_smile.gif
  5. No, iReports is a development tool for the Jasper Reports reporting engine. It could be used to reproduce a document that is like your HTML page but can not do a direct conversion of it.
  6. My new approach is to use a chart customizer. Now I’m stuck as I cannot figure out how to go about changing the color of the bars based on the bar values. I've figure out how to find the value assigned to each bar but I cannot figure out how to use the value to get each bar element and change its color. If you look at "Get values assigned to bar chart" I manage to get the value for the bars. Now I’m not sure where to go from here. I've been searching through JFreeCharts properties but cannot find any that would allow me to use these values to change the bar colors Here's my code public class MyChartCustomizer extends JRAbstractChartCustomizer { public void customize(JFreeChart chart, JRChart jasperChart) { //Chart is a bar chart if(jasperChart.getChartType() == JRChart.CHART_TYPE_BAR) { BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer(); //Removes gray line around the bar renderer.setDrawBarOutline(false); //Removes the label displayed at the top of the bar renderer.setBaseItemLabelGenerator(null); //Set maximum bar width renderer.setMaximumBarWidth(0.10); //Create no data message CategoryPlot categoryplot = (CategoryPlot) chart.getCategoryPlot(); categoryplot.setNoDataMessage("No data available"); categoryplot.setNoDataMessageFont(new Font("SansSerif",Font.BOLD,14)); categoryplot.setNoDataMessagePaint(Color.WHITE); //Set background as transparent categoryplot.setBackgroundPaint(null); CategoryDataset cd = (CategoryDataset) categoryplot.getDataset(); //Get values assigned to bar chart if(cd != null) { System.out.println("Bar Row " + cd.getRowCount()); System.out.println("Column Row " + cd.getColumnCount()); for (int row = 0; row < cd.getRowCount(); row++) { for (int col = 0; col < cd.getColumnCount(); col++) { String l_rowKey = (String)String.valueOf(cd.getRowKey(row)); String l_colKey = (String)cd.getColumnKey(col); double l_value = cd.getValue(cd.getRowKey(row), l_colKey).doubleValue(); double s_value = cd.getValue(row,col).doubleValue(); System.out.println("l_rowKey " + l_rowKey + " l_colKey " + l_colKey + " l_value " + l_value + " s_value " + s_value); } } } //Set space for labels so it does not truncate categoryAxis.setMaximumCategoryLabelWidthRatio(25.0f); categoryAxis.setMaximumCategoryLabelLines(2); //set background grid color categoryplot.setRangeGridlinePaint(Color.red); } }
  7. The only way that I'm aware of is to break up your data and create multiple charts on your report.
  8. I need help creating a bar chart The colors of the bars need to be a certain color depending on the range of the values. Example 0 -2 red 2-4 orange 4 -> green I tried setting up the bar chart with categories and series with each series representing the color. This works great if I have at least one items that fits into each of the color buckets. If I fill up less than the three color buckets my bars do not cover the right range. For example if all my bar values are greater than 4 then my bars are all red. Want I want is for all the bars to be green. Attaches is an example of what I'm trying to achieve. Post Edited by svenn at 09/21/2010 23:25
  9. ireport Profession is a paid product. If you have paid for a licence you can get it here http://support.jaspersoft.com/ Login with you use and go to the download section.
  10. Instead of using the column header put your header information in the title band. It will be created once at the begining of the report. Check out this FAQ for making an Excel friendly report http://jasperforge.org//uploads/publish/jasperreportswebsite/trunk/faq.html#FAQ9
  11. What do you mean by "'join the pages so it's continuous"?
  12. I don't have the answer but this might help you find it. Jasper uses the JFreeChart package. Many times when I've had charting questions I've Googled JFreeChart and the info I'm looking for. You may be able to figure out what you need to do.
  13. The question is why do you need to use the latest one instead of the one that is compatible with Jasper?
  14. Try asking here http://jasperforge.org/plugins/espforum/browse.php?group_id=112&forumid=107
  15. Well we can't do your home work for you but if you give us a list of your requirements I'm sure we can let you know which ones Jasper Reports can met.
  16. Yes the only constraint would be space. I expect what you actually want to know, is it possible to have three charts with different queries. This is also possible. You can add a dataset to your report and assign it to your chart .
  17. Yes it is look under iReport (classic) http://sourceforge.net/projects/ireport/files/ First thing I would do is make sure your Java application is using the proper jars that come with 3.7.4. You'll more than likely need to upgrade more than just the Jasper Report jar. When I went from 1.3.3 to 3.7.4 I replaced the following iText-2.1.7.jar jasperreports-3.7.4.jar jcommon-1.0.15.jar jfreechart-1.0.12.jar
  18. The only way to do this is to build your JRXML file dynamicly in code and set the width of the field. Then you complie and run you created file.
  19. You could place a static field or text field in the same position as your image with it's own print when expression. It would print out when your result is not "0".
  20. http://sourceforge.net/projects/ireport/files/ Look near the end of the page for iReport(classic)
  21. This forum is for Jasper Report development using iReports. Jasper Server has it's own forum. http://jasperforge.org/plugins/espforum/browse.php?group_id=112&forumid=102
  22. We've started creating report using the JRXhtmlExporter. One issue we've run into is the HTML that is created is padding the report with big chucks of white space on either side of the body of the report. When we display the report in an iFrame of our application it does not look great. Are there parameters we can apply to the exporter or properties we can manipulate within the report to reduce this white space?
  23. As far as I know there is no tool to do this. You will need to do it by hand. We went through a simular process when we converted all our report from Crystal Reports to Jasper.
×
×
  • Create New...