Jump to content
Changes to the Jaspersoft community edition download ×

manuatilomb

Members
  • Posts

    18
  • 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 manuatilomb

  1. Solved. The problem was in the customizer class. Here's the final result: public void customize(JFreeChart chart, JRChart jasperChart) { XYItemRenderer areaRender=new XYAreaRenderer(); XYPlot plot=chart.getXYPlot(); XYDataset dataset=plot.getDataset(); plot.setDataset(1, dataset); plot.mapDatasetToRangeAxis(1,0); plot.setRenderer(1, areaRender); XYItemRenderer lineRender=plot.getRenderer(0); lineRender.setSeriesPaint(0, new Color(0,0,255)); lineRender.setSeriesPaint(1, new Color(0,255,0)); lineRender.setSeriesPaint(2, new Color(255,0,0)); areaRender.setBaseSeriesVisibleInLegend(false); areaRender.setSeriesPaint(0, new Color(0f,0f,1.0f,0.2f)); areaRender.setSeriesPaint(1, new Color(0f,1.0f,0f,0.2f)); areaRender.setSeriesPaint(2, new Color(1.0f,0f,0f,0.2f)); }[/code]
  2. I have a sub-report with a time series line-chart, associated with a customizer that creates a second area-chart behind the line one, to make it more visually appealing. Normally it outputs something like this: But recently it outputed this beauty: I made a test with custom data, to see if I could force a similar result, and I could in fact reproduce it; the line-chart part works fine and is faithful to the data, but the area-chart part is sort-of-faithful, but not correct. Now, I don't know if that is a problem with the area part, that simply renders in certain way under certain info, or if it's a problem with the customizer class. Also, I don't know how to make it so it always render in the expected way. Here's the customizer method: public void customize(JFreeChart chart, JRChart jasperChart) { ItemRenderer areaRender=new XYAreaRenderer(); XYPlot plot=chart.getXYPlot(); XYDataset dataset=plot.getDataset(); plot.setDataset(1, dataset); plot.mapDatasetToRangeAxis(1,1); ValueAxis axis2=new NumberAxis(); axis2.setVisible(false); lineRender.setSeriesPaint(0, new Color(0,0,255)); lineRender.setSeriesPaint(1, new Color(0,255,0)); lineRender.setSeriesPaint(2, new Color(255,0,0)); areaRender.setBaseSeriesVisibleInLegend(false); areaRender.setSeriesPaint(0, new Color(0f,0f,1.0f,0.2f)); areaRender.setSeriesPaint(1, new Color(0f,1.0f,0f,0.2f)); areaRender.setSeriesPaint(2, new Color(1.0f,0f,0f,0.2f));}[/code]
  3. Welp, seems like I was right. It was a type difference. I just made a test and proved it. If a textfield uses a date, it will format the spanish month name in lowercase, and if it is a text, it will format the first letter in uppercase. EDIT Found out that my previous answer was wrong. The text field was showing uppercase, but only because it wasn't using the report locale, so the language parsing to was the default one (english). Once the spanish locale was set on the SimpleDateFormat, it parsed it in spanish and lowercase, like before. After searching a bit, it turns out that the lowercase is the default aspect of spanish months in java, so this isn't a ireport or jasper issue whatsoever
  4. I have a report with several dates being displayed, each with the month showing as letters. But in some of them, the first letter is in lowercase, while in other ones the first letter is in uppercase, and I don't know why that happens. What's weirder is the fact that that only happens if I'm using spanish as the localization language. I think some of this may have to do with how jasper or ireport sees textfields with only a date, and textfields that happen to have a date, since in titles and the like, it's printed with uppercase, and with data fields and graphs, it's printed in lowercase. Any help is highly appreciated.
  5. I have a report that receives a dataset and prints its info in a table. If the set is empty, it prints a No Data band. The thing is, I want to print the No Data band under a certain condition, acording to the dataset. But when I apply the condition, and load the report with said condition, it still prints the detail bands and such. When I tried the reverse condition on all other bands, it wouldn't print them, so the condition in the No Data band isn't the problem. Anyone has any idea?
  6. I found a way to limit the amount of values. Just put "$V{REPORT_COUNT}<N" where N is the amount of rows into the detail band's "Print When Expression"
  7. I have a set of data gathered from a set of files that I need to display in a list in a sub-report. The thing is, the list must show only the first 5 values and do it in a bigger to smaller order. Since the information is gathered from a set of files, I can't really give the sub-report the set of data ready to print. Is there a way to configure the detail band or format the incoming data set to show only the five highest values?
  8. Nevermind. I located the problem... I was trying to set dinamic text... on a static label... It's working fine with textboxes...
  9. I'm making a report with several sub reports in it, and I'm trying to handle the localization of it. I managed to do a little test and passed a line from a resource bundle successfully to the main report, but when I try to do the same to the sub reports (using the same file), for some reason it doesn't work. I tried referring the same file in the resourse parameter, and referring the same property in both main report and one of the sub report (the main report read the parameter while the sub report didn't). I also tried with two different resource bundle files, but it didn't worked. I never got a reference problem, which would mean that it always found the files, but for some reason the sub reports are not reading them. Any suggestions? I'm looking for solutions using Java or iReport
  10. I'm in this situation: I have a subreport that has a graph that is filled with a set of values that are generated by an application. The application is configured to consume data from a database according to a period of time, and in case that a certain period doesn't have any values (for example, for a specific day or for a specific hour), it will generate a empty one, with the date only. The thing is that I have a column in one of this files that has a value that I use in the title of the subreport, and when the first date is one of this dummy dates, instead of taking the value I need from the column, what I get is the dummy value of that dummy first row. So my question: Is there anyway to look in the dataset for a specific value? The dummy value is the same always (0), and I was thinking about setting a variable with a expression that would bring the value that I need (something like "if <field> doesn't equals to 0, then print the name"
  11. I have a report with several subreports, some of which have graphs. I'm trying to implement a class to set a theme on this graphs, but i'm not seeing any changes. The class looks as follows: package chartThemes;import java.awt.Color;import org.jfree.chart.JFreeChart;import org.jfree.chart.axis.ValueAxis;import org.jfree.chart.plot.XYPlot;import net.sf.jasperreports.engine.JRChart;import net.sf.jasperreports.engine.JRChartCustomizer;public class ChartThemeTest implements JRChartCustomizer {@Override public void customize(JFreeChart chart, JRChart jasperChart) { XYPlot plot=chart.getXYPlot(); ValueAxis rangeAxis=plot.getRangeAxis(); rangeAxis.setMinorTickCount(4); rangeAxis.setMinorTickMarkOutsideLength(1.0f); rangeAxis.setMinorTickMarksVisible(true); rangeAxis.setTickMarkOutsideLength(2.5f); jasperChart.setBackcolor(new Color(150, 20, 30)); jasperChart.setForecolor(new Color(204, 0, 0)); }}[/code]I'm using iReport 5.6.0, and as far as I can see, it loads the .jar successfully (if I mess the class name in the properties editor of the graph in iReport, it gives an error while creating the chart). But when I compile and create the PDF, the chart has the same properties setted in the iReport, instead of the properties setted in the java class. Any suggestion? EDIT: I tried adding a title through chart.setTitle(<title>), and the title appeared in the final report, so I'm guessing that the class is being read, but i'm missing something to make the jasperChart changes to occur.
  12. I'm using iReport 5.6.0 to create a report with some charts, but when I try to create a new chart theme, not only the creation window where it asks for the filepath and filename doesn't go away after clicking "Accept" (it can be closed with the exit button at the top right corner, but still, i'm guessing it should close automatically). After I close the window, nothing happens. Curiously, a file DOES get created, but it doesn't load in the editor; When I try to open the file as a chart theme, iReport doesn't opens it at all. Any suggestions as what could be happening?
  13. I have a master report with 7 subreports in it. Each subreport should do a page break if it doesn't fit in the remaining of the page, and they do, in exception for the last subreport. When I put the last subreport detail band to Split Type=Prevent, and the subreport's Ignore Pagination=false, just like all the other subreports, instead of printing in a new page, it does a page break, and leaves it empty, without printing any part of the subreport. The most curious thing is that changing Split Type to anything else, will print the subreport, dividing the last line in the new page (the one line that should cause the subreport to break into a new page, in case the Split Type=Prevent). I tried all sort of combinations but i haven't been able to find a solution. Any suggestions?
  14. Solved: I was using a JRDataSource instead of a JRRewindableDataSource in my code. Once I changed it, and setted the Split Type property of the Detail bands to "Prevent", it worked just fine. Thanks!
  15. Solved: I was using a JRDataSource instead of a JRRewindableDataSource in my code. Once I changed it, and setted the Split Type property of the Detail bands to "Prevent" (as AnnMary Thomas suggested), it worked just fine
  16. I tried it, but I get an error when executing the code: net.sf.jasperreports.engine.JRException: The subreport is placed on a non-splitting band, but it does not have a rewindable data source. I'm looking now at some solution more on the code side (I use Java to load the data on the report), but I still need some help figuring this out.
  17. I have a report with 4 sub-reports in 4 different Details, with the last one spawing several pages, or none, depending of the amount of results and if they fit in the page or not. I want it to break into a new page in case it doesn't fit completely in the page it is, but I haven't had any good results yet. I've tried using different configurations of split, stretch, alignments, etc, that I've found searching through similar problems, but I can't reach a solution. Any suggestion would be completely appreciated (I'm using iReport 5.6.0, for more info). Here's an example. "Top Sellers" is part of the sub-report, but it starts printing at the end of the page, where it finds space, instead of breaking into a new page.
×
×
  • Create New...