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

Muyerina

Members
  • Posts

    10
  • Joined

  • Last visited

Muyerina's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Of course, patobarrientos, I send my 2 reports and the xml that reads the first one.... I really dont know what happens....
  2. Hello everybody, I'm a little desesperate... I'm trying to create a report with a subreport inside and I can't, it appears empty. First I have "report1" with a datasource that obtains data from an xml. If I preview it shows the information correctly. Second I have "report2" with a label and "report1" added as a subreport. When I preview it only shows the label. What I'm doing wrong? I tried and tried and I can't make the report2 show report1.... The report2 label appears 3 times, and report 1 has 3 records to show, so I think it's not the datasource.... Anybody has an idea? I'm sure it's very simple, but I cant see the solution.
  3. When you try to open your old version of proyect with a newer version of iReport I think it update your proyect automaticaly, doesn't it? If it doesnt do that maybe you have to copy the xml into a jrxml like you say. About your error in Java (cannot load the jasper file) Are you sure it doesn't work due to the version? Maybe the code cannot find the jasper file because it is in a diferent part of your code or something. In iReport you can execute your report with the active conection, so you can check the jasper libraries and the data base conector works fine. If the report looks well you should check the java code and the Eclipse proyect. If you change your version of report you have to update the libraries of your proyect too, maybe you still have the old ones. To write 2 separate sqls you have to use subreports in your report. To use parameters in your querys you have to create it in your report, and then use it in your querys like this: $P{parameter_name}
  4. Hello Weihuo: iReport works with files .jrxml, wich are documents in xml format that uses the JasperReports libraries. You can work with iReport without touching Eclipse. When you have your report template you can generate it and you obtain the .jasper file. With that kind of file (.jasper) generated in iReport you go to your proyect in Eclipse. You also have to include the JasperReports libraries to execute the reports and fill the template with the correct data. If you want you can include the .jrxml file in Eclipse and generate the .jasper file with java code.
  5. Hello again I have solved my problem, thank you very much. The solution was in the version of the libraries that i was using. Later, i had the following error: net.sf.jasperreports.engine.JRRuntimeException: Could not create chart customizer instance. I solved it including a new jar in the Eclipse folder "lib" with the customizer class that i was using. Before that i was working with the customizer class in the same folder that the .jasper file. I hope this helps you!
  6. Hello everybody: I have a problem in my Java application and i dont have any idea how can solutionate it. I have 2 kind of reports in my application. One kind works with a mysql database and the other kind with SQL Server 2005. The reports that works with mysql are OK, but the other reports have a problem. When i execute it with iReport they works correctly, but in my Java Application they dont run, the application gives me the following exception: error: java.lang.ClassCastException: cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseLineBox.boxContainer of type net.sf.jasperreports.engine.JRBoxContainer in instance of net.sf.jasperreports.engine.base.JRBaseLineBox This exception appears in the method that tries to create the .jrprint file. In my application I'm using the same driver and data conection than iReport, so i dont know what im doing wrong... any idea? Thank you very much
  7. I've found it!!! This is the code of my Customize class that modify the item label of a rectangle in a StackedBarChart. Code: import net.sf.jasperreports.engine.JRChartCustomizer; import net.sf.jasperreports.engine.JRChart; import org.jfree.chart.JFreeChart; import org.jfree.chart.renderer.category.StackedBarRenderer; import java.awt.*; import org.jfree.chart.plot.CategoryPlot; public class GraficoChartCustomizer implements JRChartCustomizer { protected static final java.awt.Font ITEM_FONT = new java.awt.Font("Arial", Font.ITALIC, 6); public void customize(final JFreeChart chart, final JRChart jasperChart) { CategoryPlot plot = chart.getCategoryPlot(); StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer(); renderer.setBaseItemLabelFont(ITEM_FONT); } } I hope this help you.
  8. greylimbo, thanks a lot for your customizer class. Now it seems that the iReport do the changes of my customizer class, but the label of the rectangles has disapeared. Why? i dont know :dry: my new code: Code:StackedBarRenderer renderer = new StackedBarRenderer(); renderer.setItemMargin(0.9); renderer.setBaseItemLabelFont(new Font("Sans", Font.PLAIN, 6)); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRenderer(renderer); I tried a lot of methods (setBaseItemLabelFont, setSeriesItemLabelFont, setFixedLegendItems...) but no one works. Anyone can help me?
  9. All the items, of course, i have round the 11 to point what label is, not in the axis or out of the graphic. I want to change the font of all the numbers that are in the rectangles. Anyone knows how can i do that?
  10. Hello everybody: I'm having problems with my chart customizer using i-Report. My class 'GraficoChartCustomizer' compile and i-Report can recognise it when i specify it in the chart properties, but i-Report ignore the changes i do in the class, the graphic seems equal. Anyone can help me? All i want to do is change the font of the rectangle's label. size=300]http://i22.photobucket.com/albums/b320/Muyerina/untitled.jpg My customize class is the following: Code:Thank you
×
×
  • Create New...