rayc.arc Posted January 18, 2017 Share Posted January 18, 2017 We are using Jaspersoft 6.1 for generating reports in csv and pdf formats. We have different queries for charts (within subdataset). The charts are only available for PDF format and not for csv format, but still the queries for charts are being invoked for csv even if its not being used.Is there any way to prevent the chart queries getting invoked for csv.Snapshot of the jrxml which we are using<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Applications" columnCount="10" pageWidth="1060" pageHeight="1000" whenNoDataType="AllSectionsNoDetail" columnWidth="100" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="net.sf.jasperreports.export.csv.exclude.origin.band.1" value="pageHeader"/> <subDataset name="xyz"> <parameter name="something" class="java.lang.Long"/> <queryString> <![CDATA]> </queryString> <field name="something" class="java.lang.String"/> </subDataset><pageHeader> <band height="482" splitType="Stretch"> <frame> <pieChart> <chart evaluationTime="Report"> </chart> <pieDataset> <dataset> <datasetRun subDataset="xyz"> </datasetRun> </dataset> </pieDataset> </pieChart> </frame> </band> </pageHeader> Link to comment Share on other sites More sharing options...
peter.w Posted January 19, 2017 Share Posted January 19, 2017 from my experience you have the following options.1)Make a separate report for the cvs data2)Pass a parameter to the report that is evaluated for the detail orsummary band. Using print when expression under: Band -> Properties -> Advanced in Jasper Studioor in jrxml<band><printWhenExpression> </printWhenExpression></band> Link to comment Share on other sites More sharing options...
rayc.arc Posted January 20, 2017 Author Share Posted January 20, 2017 Actually we don't want to have different jrxml for different report types, it would introduce more problem with maintenance.Regarding the other approach, actually I am not clear. Let me tell you whatever I had tried so far.The chart section is already within a band which is being disabled for csv format. Since the query for chart is different from the main query it is part of "subdataSet" element tag. The particular subdataSet is invoked for the chart using "datasetRun". Now the problem is even if the band where chart is present is disabled the query within the dataset is run. I had tried pulling the subdataSet section within the chart band which is actually not possible since its not a valid schema. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now