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

rajendratambat

Members
  • Posts

    35
  • 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 rajendratambat

  1. hi, this can be acheived using cross tab report please see example on my blog http://rajendratambat.blogspot.com/2010/10/creating-crosstab-report-with-jasper.html Post Edited by rajendratambat at 11/22/2010 16:29
  2. possible, programatically as well. but from ireport try following trick create one parameter "contenttype" and create both chart and table in same report as sub report. and use printwhen expression for both depending on value of contenttype.
  3. which class decides what sheet names required? in your common class generatereport can't you override method passing addtional parameter? or assuming that you are getting names there and then simply use if condition to check if names is not null then only set property? in other case can you try using System.setProperty("net.sf.jasperreports.export.xls.sheet.names.all") ; if it works? or use JRProperties class in your generatereport class depending if value of names is not null. Hope this help
  4. I didn't get you, when you said for different report you have service classes which generate report dynamically. can't you pass the report names as a string array to service class and service class can pass that array to your exporter... as I have mentioned earlier... that was just an example for you to show... you can very well replace that (sheetname[]) with array object instead of passing static names... if possible can you let me know you is your flow is going and what are your service classes do..
  5. I feel you need to set the worksheet names in the excel. right?... if so then please check the following code that you need to add in your service classes. hope this solves your prob... Code:JRXlsExporter xx = new JRXlsExporter();String[] sheetNames = {"rSheet1","rSheet2", "Rs3"}; // depending uppon no. of worksheets you have createdxx.setParameter(JRXlsExporterParameter.SHEET_NAMES, sheetNames );xx.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);xx.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:\\report.xls");xx.exportReport();
  6. another option here it is to set it using JRProperty class proivded you can pass the property name and its value using getter and setter method. net.sf.jasperreports.engine.util.JRProperties if it do not get overridden then try to alter the properties file itself and put in jar back. (last option) Post Edited by rajendratambat at 11/19/2010 07:05
  7. how are you generating report? programatically from java code? or directly from ireport?
  8. important thing for subreport to work from main report is the dependancey of the parameters and the datasource connection does your sub report requires some parameters needs to be passed or check how are you passing datasource connection? it should use the same connection of the main report so your subreport tag in main report should have as following please note m_docid is my parameter defined in subreport which is mapped to the main report field $F{ID} and I am using same report connection which is created in main report as connectionExpression hope this helps you. Code:<subreport> <reportElement x="0" y="43" width="555" height="100"/> <subreportParameter name="m_docid"> <subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "subrpt.jasper"]]></subreportExpression></subreport>
  9. you can edit the expression with something like following and you can format this with the dateformater Code:new Date((new Date().getTime())+ (15*60000)))
  10. Hi you can see my example from my blog http://rajendratambat.blogspot.com/2010/10/creating-crosstab-report-with-jasper.html Regards, Rajendra Tambat
×
×
  • Create New...