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

neozerabbit

Members
  • Posts

    66
  • 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 neozerabbit

  1. Your problem il here : $F{Titre} It is a parameter, not a field (field is a datasource field) Correction : $P{Titre}
  2. I am working on it but i do no manage in setting annotation where i want in the graphe. I can set y value of annotations but not x value. I use Bar chart ; Category Annotation. I would like something like | Cat1 Cat2 | ---- | | | |-------|--|------- |---|---------------------------------- |---| (with a 45 degres orientation angle) I am thinkg about base item label generator Post Edited by neozerabbit at 11/09/2011 09:59
  3. Nobody Post Edited by neozerabbit at 10/12/2011 12:52
  4. I do not use swap file virtualize. I virtualize by report. Perhaps you should not set virtualizer to read only. I am not sure. I DO : virtualizer = new JRFileVirtualizer(1, tmpDirectory); ... reportParameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); ... JasperPrint reportPrint = reportGenerationBusinessService.fillReport(reportObj, reportParameters, new JREmptyDataSource()); .... export to XLS I made test with more than 20 000 lines of data I do not use the JExcel exporter because it is low. I use POI exporter (like you, it seems) Here my params : logger.debug("Start Export XLS POI"); long nanoTime = System.nanoTime(); File reportOutputFile = createExportFile(reportFileName, ".xls"); JRXlsExporter exporterJRX = new JRXlsExporter(); exporterJRX.setParameter(JRExporterParameter.OUTPUT_FILE, reportOutputFile); exporterJRX.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporterJRX.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF8"); exporterJRX.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, true); exporterJRX.setParameter(JRXlsExporterParameter.SHEET_NAMES, sheetsName); exporterJRX.setParameter(JRXlsExporterParameter.MAXIMUM_ROWS_PER_SHEET, 65000); exporterJRX.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true); exporterJRX.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BACKGROUND, false); exporterJRX.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER, false); exporterJRX.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, true); exporterJRX.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, false); exporterJRX.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, false); exporterJRX.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, false); Map<String, String> numberFormats = new HashMap<String, String>(); numberFormats.put("#,##0.0000000000", "#,##0.00;-#,##0.00"); numberFormats.put("#,##0.0000000000 %", "#,##0.00;-#,##0.00" ); exporterJRX.setParameter(JRXlsExporterParameter.FORMAT_PATTERNS_MAP, numberFormats); exporterJRX.exportReport(); logger.info("End Export XLS POI " + (System.nanoTime()-nanoTime)/MILLIS + "ms" ); return reportOutputFile; HOPE it'll help you Post Edited by neozerabbit at 10/07/2011 14:56
  5. Is it possible, and how, to embbed legends in a chart, not on the top, bottom, left or right ?
  6. I haven't been here for a certain time. I never set directly a file with a path to jasper compile. I prefer to retreive a file and get an input stream on, and compile. EX : inputStream = new FileInputStream(reportsRootDir + DIRECTORY + ReportFile.POST_TRADE_OVERVIEW.value()); JasperReport reportOverview = JasperCompileManager.compileReport(inputStream); With that you can see directly if the problem is the input stream (retreive the file) or in the jasper file (compilation problem). You should also add a catch EXCEPTION block and log errors to have more information on you problem. For me it's blank spaces. Remember thar between systems it can be "/" or "\" for file path separator. It's why i prefer not to use hard coded path by as constant using java File seperator" (when report files are on the user computer). In some cases my jrxml file are delivered (ex : Maven deploy) in the a java source path ; so I can access them without specifying a path with "/" or "\" separators.
  7. Thanks. My error was to return "" instead of null. Now it's fine.
  8. Is there a way to hide one or several label links ? Explanation : I was asked in a pie chart to explode slices and display a label when it's >30% I make my own label generator extending StandardPieSectionLabelGenerator. So I am able to hide some of my labels but not hiide the label link. With "plot.setLabelLinksVisible(false);" we can hide all label links but I want to choose with label link to hide. I am searching on plot customization but with no sucess.
  9. I think you have a mal formed exception or file not found exception but you do not catch it so you do not see it. Add a catch(Exception) to see what happend. You'll delete it once you've solved you problem. You seem to have a class path problem. when I see you file expression I notice there are spaces in your string. I think your problem is there. You should rather use a file path like "c:\conf\reports\..."
  10. It depends of your needs. In some case report fragmentation can be usefull. For exemple I have a report with a daily and a monthly report. One of my report pages is different. I though it was to complicated to make one jrxml for daily and monthly sub report. So I created a daily sub report and a monthly sub report. I have a master page who choose the correct sub report at runtime. In some other case I change the report design at runtime. For exemple, before running user can select if he want 4 ou 5 tabs for his report. At runtime I modify my master report to delete the 5th tab when it's not requested. There are some good practices but design stays yours ;-). One pratice I like is to separate report from data. I request and prepare all my datasources before filling the report. My report does not have SQL or any other code request. I pass reports and datasources as parameter of a master report.
  11. I think it's something you must do before the fillReport and set a parameter that give you a specific repot
  12. Thanks. I missed something. I had to cas my renderer and set some properties to obtain border on bars of my chart I has to set outline bar on true BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(true); // Bars border ..... // Bars border renderer.setSeriesOutlinePaint(i, Color.BLACK); renderer.setSeriesOutlineStroke(i, new BasicStroke(0.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
  13. I think you have a path / classpath problem. I prefer usually use relative path to my java main class than absolute. sub reports can have their path relative to the main report that call them. In some case I put the my reports files in a directory on wich I set in the class path even if is outside my jar distribution. In my case I compile main & sub reports at runtime. But I use JRXML file and not .jasper because it allows me to redeliver report without regenering a complet application (data, properties, xml file are outside my distribution) To do that : // - Load & compile reports // Master Report InputStream inputStream = new FileInputStream(reportsRootDir + DIRECTORY + xxxx.jrxml); JasperReport postTradeReport = JasperCompileManager.compileReport(inputStream); inputStreams.add(inputStream); // Title inputStream = new FileInputStream(reportsRootDir + DIRECTORY + xxx.jrxml); JasperReport reportTitle = JasperCompileManager.compileReport(inputStream); inputStreams.add(inputStream); ......... The input stream is only in my "Finaly" to close properly all my streams My sub reports are parameters passed to my master report. So I can inject in my master report what ever sub report I want at runtime //-------------------------------------- // - Report parameters Map<String, Object> reportParameters = new HashMap<String, Object>(); .... // Title reportParameters.put(ReportFieldNames.REPORT_TITLE, reportTitle); // Overview reportParameters.put(ReportFieldNames.REPORT_OVERVIEW, reportOverview); ...... After I have just to process report. My master report is only a template containing sub report. In future I think I can generate dynamically the master report and set my predefined jrxml files. // Fill report JasperPrint reportPrint = JasperFillManager.fillReport(postTradeReport, reportParameters, new JREmptyDataSource()); ...... This was for java coding. In your master report you must defined you subreport by jrxml file and sub reports are parameters of your master report. <parameter name="report-title" class="net.sf.jasperreports.engine.JasperReport" isForPrompting="false"> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter> and define sub reports like this <subreport isUsingCache="true"> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{report-title}]]></subreportExpression> <subreportParameter .....> ....... </subreportParameter> </subreport> Post Edited by neozerabbit at 09/15/2011 12:17
  14. JasperReports 4.1.2 here : http://sourceforge.net/projects/jasperreports/files/jasperreports/ Jar dependant are in the distribution (in "lib" directory of the dezipped archive)
  15. Is is possible to have border on the bars of the chart ? How ?
  16. I've just seen an answer. I thought there won't be. Sorry for that. The purpose is to have in the report to charts using the same series and down a legend chart for the two charts.
  17. You spoke about precompiled reports. I do something like that. - I get a stream from the "jrxml" file (it allows me to set my jrxml file out of my jars and modify / deliver them at on runtime) - I edit and modify the report design if necessary (move, hide field, add or remove sections) - I compile my reports at runtime - I pass my reports as parameter to Jasper (Allows me to inject what ever report I want) Here a small sample // Load and compile inputStreamTitle = new FileInputStream(workingDir+ReportFile.POST_TRADE_TITLE.value()); JasperReport reportTitle = JasperCompileManager.compileReport(inputStreamTitle); ..... JRDataSource titleDataSource = ....... .... // - Report parameters Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("titleReport", reportTitle); parameters.put("titleDataSourcet", titleDatasource); ....... JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, new JREmptyDataSource); IN FACT : my master report is only a heavy container for all sub reports. JRXMLfiles are passed to the master report as JasperReport Object. Same for data souces, execution parameters. You just have to define theese parameters in your master report and use them in your sub reports definition One more tip : My report does not execute any SQL. Data retreive is done in java. Data Sources are build and set (as parameters) before calling the report.
  18. Map<String, Object> parameters= new HashMap<String, Object>() You can put in the map any object (List, Dates, Beans, etc.) Do no forget in your report to define the parameters you set in the map and their type. Run your report : JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, dataSource);
  19. As you said you can hide a column using the propery "Print when expression" but it will let you a blanc column ( no automatics resizing, it's a lack of Jasper, I confim) There a re several ways to solve you problem : - make all the sub reports combination you need and depending the case, use the one you need (heavy and bad way I think) - superpose field in you template and use print expression to display fields you want - generate dynamically your template in Java Like you i use IReport + Jasper reports, but I use IReport for first desing and the main things are done dynamically in Java : A mix between the second and the third proposition. Japser Soft propose a tool (to buy) which can deal with table columns : "Column Manager" I've never tried it. Post Edited by neozerabbit at 06/23/2011 08:06
  20. Is it possible to make a chart with only legend (not the chart) ? How
×
×
  • Create New...