Jump to content
Changes to the Jaspersoft community edition download ×

dima_toxsoft

Members
  • Posts

    13
  • Joined

  • Last visited

dima_toxsoft's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Hi dragnet! Sorry, i don't know how post my codes to your. Please, let me know. I get the sample from this topic: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=24070#24070
  2. Hi! Sorry for my poor English. When i faced the same ptoblem (dynamical column) i generateв reports on fly. Here java sample: private JasperDesign getSubreportDesign( int aSubreportNumber, List<String> aColumnNames ) throws JRException { JasperDesign jasperDesign = new JasperDesign(); ... // Dynamic columns int dynamicColumnWidth = (DEFAULT_COLUMN_WIDTH - (DATE_COLUMN_WIDTH + REGISTER_COLUMN_WIDTH + PARALLEL_COLUMN_WIDTH)) / columnQtty; int start_x = DATE_COLUMN_WIDTH + REGISTER_COLUMN_WIDTH + PARALLEL_COLUMN_WIDTH; for( int i = 0; i < columnQtty; i++ ) { staticText = new JRDesignStaticText(); staticText.setX( start_x ); staticText.setY( 0 ); staticText.setWidth( dynamicColumnWidth ); staticText.setHeight( SUBREPORT_COLUMN_HEADER_HEIGHT ); staticText.setHorizontalAlignment( JRAlignment.HORIZONTAL_ALIGN_CENTER ); staticText.setVerticalAlignment( JRAlignment.VERTICAL_ALIGN_MIDDLE ); staticText.setText( convert2HTML(aColumnNames.get( i )) ); setBox( staticText, (i == (columnQtty - 1)) ); staticText.setStyledText( true ); band.addElement( staticText ); start_x += dynamicColumnWidth; } jasperDesign.setColumnHeader( band ); The same manner make detail fields
  3. Could your, please, show code where passing parameters to subsubreport. I break my head, but can't correctly do it. To the first level subreport work fine, second level show nothing. My code look like: String subreportDataSetName = SUBREPORT+ "_" + DS; //$NON-NLS-1$ // here i send the datasource for the subreport as parameter to the masterreport parameters.put( getReportDataSource() ); String subreportJasperReportName = SUBREPORT + "_" + JR; //$NON-NLS-1$ JasperReport sub = JasperCompileManager.compileReport( getSubreportDesign() ); parameters.put( subreportJasperReportName, sub ); // Set subsub parameters JasperReport subsub = JasperCompileManager.compileReport( SubSubreportDesign() ); String subsubreportJasperReportName = SUBSUBREPORT + "_" + JR; //$NON-NLS-1$ parameters.put( subsubreportJasperReportName, subsub ); String subsubreportDataSetName = SUBSUBREPORT + "_" + DS; //$NON-NLS-1$ parameters.put( subsubreportDataSetName, new JRCustomDataSource() ); Show only first level subreport. If subsubreport insert in first level it shows fine, but in second level nothig :-( What wrong. Thanks Post edited by: dima_toxsoft, at: 2008/04/25 12:03
  4. Hi! We solve this, problem was in two JFreeChart libraries (different versions) in one project (in Jasper old version). Thanks.
  5. Hi, everybody! Excuse me for poor English RCP application, in JasperReport JFreeChart object call my ChartCustomizer. Very simple code from Jasper samples: public void customize( JFreeChart aChart, JRChart aJasperChart ) { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("Java", new Double(43.2)); dataset.setValue("Visual Basic", new Double(10.0)); dataset.setValue("C/C++", new Double(17.5)); dataset.setValue("PHP", new Double(32.5)); dataset.setValue("Perl", new Double(1.0)); PiePlot3D plot = (PiePlot3D) aChart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); plot.setDataset( dataset ); } Program execution fail on code PiePlot3D plot = (PiePlot3D)aChart.getPlot(); Exception detail message: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "org/jfree/chart/JFreeChart" To find out solution i use max codes from samples (my origin codes more complicated, but fails with the same error), any ideas?
  6. Hi, everybody! I use scriptlet (extends JRDefaultScriptlet) in my report. On Java runtime, call JasperCompileManager.compileReport("path_to_my_report") throw exception:"Report design not valid : nt 1. java.lang.ClassNotFoundException: ru.toxsoft.lims.client.production.defect.view.JFreeChartScriptlet" JFreeChartScriptlet scriptlet java class (example from JasperReports folder). Report creating from RCP aplication. I copy this file to class path, to root no result. Please, can have any idea.
  7. I found solution. If use for each SubReport an own DataSource then it work.
  8. I find out here: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=6495#6495
  9. I create report with several subreports in code. Can't find correct way to pass data set to subreport in code. Code: // In master report parameter = new JRDesignParameter(); parameter.setName("datasource"); parameter.setValueClass(JRDataSource.class); jasperDesign.addParameter(parameter); ... group = new JRDesignGroup(); group.setName("subreport"); groupHeader = new JRDesignBand(); groupHeader.setHeight(350); // Create subreport on fly JRDesignSubreport subreport = getSubreport(); // ???Pass data to subreport // This code is bad, but to illustrate idea expression = new JRDesignExpression(); expression.setValueClass(JRDataSource.class); expression.setText("$P{datasource}"); subreport.setDataSourceExpression(expression); // ... I see people in this forum do the same task (create/insert several subreports on fly) Please, give me working example...
  10. Teodord thanks, it works! For others: 1. Mark checkbox "Is styled text" 2. In static text wrote: "H<sub>2</sub>0"
  11. Hi, how to display in report chemical formula e.g. H20 (water)? Thanks in advance. Dima.
×
×
  • Create New...