PDF generated from JAVA is damaged using Jasper Reports - java

I am using iReport Designer 4.7 to create .jrxml. Its a very simle .jrxml which displays parameters passsed
from JAVA. The test pdf gets generated from iReport Designer and I can view it using Adobe Reader.
Now, Here is the java code
I am calling createReport(String reportName, Map params) from Servlet.
The parameters are set from Servlet. There will be always parameters passed.
public void generateReport(String fileName, String outFileName, Map paramerterMap,
String reportFormat) throws JRException{
String reportSource = "C:\\jrxml\\" + fileName;
String outFile = null;
downloadPath = "C:\\pdfs\\";
outFile = downloadPath + outFileName;
JRExporter exporter = new JRPdfExporter();
JasperPrint jasperPrint = JasperFillManager.fillReport(reportSource, paramerterMap);
exporter.setParameter(JRXlsExporterParameter.CHARACTER_ENCODING,"UTF-8");
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFile);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.exportReport();
}
public Boolean createReport(String reportName, Map params) {
try {
String jrFile = reportName + ".jasper";
String outFileName = String.valueOf(7884);
outFileName += "_" + reportName + ".pdf";
generateReport(jrFile, outFileName, params, ".pdf");
return true;
} catch (JRException e) {
e.printStackTrace();
log.error("ReportManager--generateReport--JRException: " + e);
return false;
} catch (Exception e) {
e.printStackTrace();
log.error("ReportManager--generateReport--Exception: " + e);
return false;
}
}
I am using same set of .jar which iReport Designer used.
(In fact I have copied .jar files from iReport installation directory)
Problem: The pdf generated using JAVA code is broken.
When I try to open PDF at created location, The Adobe reader says :
Adobe Reader could not open 'test.pdf' because it is either not a
supported file type or because the file has been damaged (for example,
it was sent as an email attachment and wasn't correctly decoded).
EDIT: I do not get any exception and the generated file size is around 5 KB.
EDIT2: Adding JRXML
<?xml version="1.0" encoding="UTF-8"?>
<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="Certificate" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7367a6fb-f8da-4ba3-b90d-319807f92789">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<parameter name="name" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="27" splitType="Stretch">
<textField pattern="MMMMM dd, yyyy" isBlankWhenNull="false">
<reportElement uuid="b72c0bad-3935-40ba-8d6d-3993cb5122d2" key="textField" x="413" y="0" width="140" height="20"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="21" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="22" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="141" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="cbaae0d4-53da-420e-8efa-7f4fcc6900f0" key="name" x="0" y="10" width="530" height="20"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{name}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="20" splitType="Stretch"/>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>

Hardik,
I see 2-3 things over here
1) Your outfile name in generateReport always comes as "c:\pdfs"+ NULL.
( I wonder why test.pdf is still created )
2) What does gujarati object contains parameters for reports??
EDIT
3) Just asking why keep two seperate function for report generation?
In my opinion you could achieve the objective with single function createReport.!
EDIT : 2
I think this link might offer some help : http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ29

Related

How to print/display MathML expressions?

Currently I'm trying to use a textField with markup="html" but it's not working.
Example
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="100" y="0" width="450" height="25" isPrintWhenDetailOverflows="true" uuid="1aeaa5e9-4136-4239-a301-2733598340d9">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement verticalAlignment="Middle" markup="html">
<paragraph lineSpacing="Single" leftIndent="5" rightIndent="3"/>
</textElement>
<textFieldExpression><![CDATA[$F{question}]]></textFieldExpression>
$F{question} contain:
"<p id="id"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi><mo>+</mo><mo> </mo><mi>B</mi><mo> </mo><mo> </mo><msqrt><mi>c</mi><mfenced><mrow><mi>d</mi><mfenced open="[" close="]"><mi>r</mi></mfenced></mrow></mfenced></msqrt><mo> </mo><mi>δ</mi><mo> </mo><mo>∞</mo><mi mathvariant="normal">π</mi><mo> </mo></math></p>"
Expected Result :
Result which I get :
The textField does not support MathML, it only support very basic html nor can you use the html component since the JEditorPane on which it's built neither does support MathML
You will need an external library as for example jeuclid, once that you have this library in classpath you can render the xml to a BufferedImage using Converter.render and then display it in jasper report.
This can be done without a java helper class as in this example, hence writting all the code directly in the jrxml on 1 line (using the builder pattern below), but for clarity of example I'm will use external helper class.
Example
java
public class MathML {
public static BufferedImage getImage(String xml, float size) throws IOException, SAXException, ParserConfigurationException {
// Load the string to a node
Element node = DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.parse(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)))
.getDocumentElement();
//Generate the layout parameter
MutableLayoutContext params = new LayoutContextImpl(
LayoutContextImpl.getDefaultLayoutContext());
params.setParameter(Parameter.MATHSIZE, size);
//Render the xml to a BufferedImage
return Converter.getInstance().render(node, params);
}
}
jrxml
<?xml version="1.0" encoding="UTF-8"?>
<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="Blank_A4_12" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8deaea2e-3739-4c4e-b2b5-8c58773ab1a0">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<title>
<band height="50" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="100" height="50" uuid="9ee17167-a91e-4725-b36e-a4bba5e24acb">
</reportElement>
<imageExpression><![CDATA[it.jdd.MathML.getImage("<math xmlns='http://www.w3.org/1998/Math/MathML'><mi>A</mi><mo>+</mo><mo> </mo><mi>B</mi><mo> </mo><mo> </mo><msqrt><mi>c</mi><mfenced><mrow><mi>d</mi><mfenced open='[' close=']'><mi>r</mi></mfenced></mrow></mfenced></msqrt><mo> </mo><mi>δ</mi><mo> </mo><mo>∞</mo><mi mathvariant='normal'>π</mi><mo> </mo></math>",70f)]]></imageExpression>
</image>
</band>
</title>
</jasperReport>
Output (export to pdf)

How to remove margin of QRCode generated with zxing?

I am using com.google.zxing version 3.3.2 to generate QRCode using jasper report.
The generated QRCode is having spaces and margin. How can I avoid those spaces.
I found solutions to add EncodeHintType.MARGIN, -1 but how to add this in image expression in jasper report.
Below is the image expression as of now I am using.
com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
$F{Code},com.google.zxing.BarcodeFormat.QR_CODE, 300, 300))
Adding EncodeHintType.MARGIN is correct but you need to put 0 (otherwise it will throw an error)
To add this you can use the second constructor of QRCodeWriter
public BitMatrix encode(String contents,BarcodeFormat format,
int width,int height,Map<EncodeHintType,?> hints)
throws WriterException
This means that you need to pass a Map which is initialize with the key and value. One way of creating and initializing maps is to use use Guava and it's ImmutableMap
com.google.common.collect.ImmutableMap.of(com.google.zxing.EncodeHintType.MARGIN,0)
Hence the resulting expression would be
com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
$F{Code},com.google.zxing.BarcodeFormat.QR_CODE, 300, 300,
com.google.common.collect.ImmutableMap.of(com.google.zxing.EncodeHintType.MARGIN,0)))
Example (I have put a border around to demonstrate margin 0)
jrxml
<?xml version="1.0" encoding="UTF-8"?>
<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="QRCode" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ee443473-56d0-44df-b5d4-ac3fe82fd9bc">
<queryString>
<![CDATA[]]>
</queryString>
<title>
<band height="200" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="200" height="200" uuid="9236a226-c581-4d35-88d3-c65181090d03"/>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
</box>
<imageExpression><![CDATA[com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
"Hello world",com.google.zxing.BarcodeFormat.QR_CODE, 300, 300,com.google.common.collect.ImmutableMap.of(com.google.zxing.EncodeHintType.MARGIN,0)))]]></imageExpression>
</image>
</band>
</title>
</jasperReport>
Result

Jasper Report PDF does not open

I am trying to build a sample web application which loads a pdf report generated through jasper reports (.jasper file). However the report does not open as a pdf with the message "This PDF document might not be displayed correctly".
The code snippets are as below. There is no exception log coming in the server log. Any help would be great. Thanks.
Servlet Controller Class
#WebServlet("/generateReport")
public class JasperReportsExample extends HttpServlet{
final String deviceJasper = "SampleReport.jasper";
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("application/pdf");
response.setCharacterEncoding("UTF-8");
try{
List<SampleReportBean> sampleReportBeanList = new ArrayList<SampleReportBean>();
SampleReportBean bean = new SampleReportBean();
bean.setName("Hello");
sampleReportBeanList.add(bean);
InputStream is = this.getClass().getClassLoader().getResourceAsStream(deviceJasper);
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(is);
JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(sampleReportBeanList);
Map<String, Object> parameters = new HashMap<String, Object>();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, beanCollectionDataSource);
JasperExportManager.exportReportToPdfFile(jasperPrint, deviceJasper);
}catch(Exception e) {
System.out.println("Error:while creating jasper report....");
e.printStackTrace();
}
}
}
html page
<form action="/samplejasperreport/generateReport" method="get">
<div>
<input type="submit" name="Generate Report" value="Generate Report">
</div>
</form>
SampleReport.jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
<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="SampleReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="038b20ef-43f5-4f05-8318-627e403a7110">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="JavaBean Adapter"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band splitType="Stretch"/>
</columnHeader>
<detail>
<band height="31" splitType="Stretch">
<textField>
<reportElement x="150" y="0" width="140" height="30" isPrintWhenDetailOverflows="true" uuid="f6eec303-affe-4804-bb6a-e5c07516a46f"/>
<textElement textAlignment="Center">
<font size="22"/>
</textElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="1" splitType="Stretch"/>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
Directory structure image
Error screen:
Thanks to AlexK:
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());//send the pdfstream to the browser

Jasper report blank page

My jrxml and java code below . I am trying to create report with some text and values . However blank report is generated . I am pasing map to fill the report as parameter . I have to add 4-5 static lines and then one dynamic variable . I have added these thing in detailed band .whats wrong
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="Untitled_report_2"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="595"
pageHeight="842"
columnWidth="535"
columnSpacing="0"
leftMargin="30"
rightMargin="30"
topMargin="20"
bottomMargin="20"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false">
<property name="ireport.scriptlethandling" value="0" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />
<field name="Field" class="java.lang.String"/>
<background>
<band height="0" isSplitAllowed="true" >
</band>
</background>
<title>
<band height="50" isSplitAllowed="true" >
</band>
</title>
<pageHeader>
<band height="50" isSplitAllowed="true" >
</band>
</pageHeader>
<columnHeader>
<band height="30" isSplitAllowed="true" >
</band>
</columnHeader>
<detail>
<band height="100" isSplitAllowed="true" >
<staticText>
<reportElement
x="20"
y="10"
width="180"
height="30"
key="staticText-1"/>
<box></box>
<textElement>
<font/>
</textElement>
<text><![CDATA[4-5 lines text]]></text>
</staticText>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="20"
y="40"
width="60"
height="20"
key="textField-1"/>
<box></box>
<textElement>
<font/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{Field}]]></textFieldExpression>
</textField>
<staticText>
<reportElement
x="20"
y="70"
width="160"
height="30"
key="staticText-2"/>
<box></box>
<textElement>
<font/>
</textElement>
<text><![CDATA[4-5 lines text]]></text>
</staticText>
</band>
</detail>
<columnFooter>
<band height="30" isSplitAllowed="true" >
</band>
</columnFooter>
<pageFooter>
<band height="50" isSplitAllowed="true" >
</band>
</pageFooter>
<lastPageFooter>
<band height="50" isSplitAllowed="true" >
</band>
</lastPageFooter>
<summary>
<band height="50" isSplitAllowed="true" >
</band>
</summary>
</jasperReport>
Java code :
InputStream fileInput = getApplicationContext().getResource("/WEB-INF/reports/myjrxml.jrxml").getInputStream();
JasperReport jasperReport = JasperCompileManager.compileReport(fileInput);
HashMap map = new HashMap();
map.put("Field", "test");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, map);
byte[] output1 = JasperExportManager.exportReportToPdf(jasperPrint);
String filename = "d:/test.pdf";
FileOutputStream fo = new FileOutputStream(filename);
fo.write(output1);
fo.close();
You are confusing the report data with parameters. I don't see that you have any report data, which is why you are getting an empty report. Further, you are filling a parameter named "Field" instead of the actual report data. So you either need to create a parameter called "Field" in your report, and then refer to it in the detail band, OR you need to pass the report data into your report something like
JRBeanCollectionDataSource data = new JRBeanCollectionDataSource(dataSet);
jasperPrint = JasperFillManager.fillReport(jasperReport, parameterMap, data);
where dataSet is a collection, such as List<?>. Within the List, you would have an object where one of the properties is Field.
I had also blank page (pdf). Even for the simplest report.Until I sent empty datasource (new JREmptyDataSource())!
This solved my problem:
Map<String, Object> param = new HashMap<>();
param.put("SOME_PARAM","something");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, new JREmptyDataSource());
Explanation here.
By default, when no datasource info is present in a report, JR generates no pages.

JasperReports: Error creating table trying to use CrossTab without column group

I'm wondering if there is a way to make a table like this using the JapserReports CrossTab or in any other way where the row group is the field value7.
The DataSet used is a JRBeanCollectionDataSource(list of SubViews).
Where SubView is:
public class SubView{
//...
private String value1;
private String value2;
private String value3;
private String value4;
private String value5;
private String value6;
private String value7;
//...getters and setters...
}
Note that there is no need of a column group, but jasper doesn't compile successfully if I don't configure a column group (error message: Crosstab should have at least one column group).
This to me does not seem like a crosstab problem. Crosstab's are used when the columns are dynamic, hence your error message
Crosstab should have at least one column group.
since there is "no need of a column group" the result is achived using the normal detail band and grouping on value7.
So after you put the labels in the columnHeader and the values 1-6 in the detail band you add a grouping on value7 with a groupHeader band
Example (I have only included until value 3 in detail band to sorten the answer
<?xml version="1.0" encoding="UTF-8"?>
<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="report2" printOrder="Horizontal" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="8944f542-2955-4224-933c-5a87fd36f527">
<queryString>
<![CDATA[]]>
</queryString>
<field name="value1" class="java.lang.String"/>
<field name="value2" class="java.lang.String"/>
<field name="value3" class="java.lang.String"/>
<field name="value7" class="java.lang.String"/>
<group name="Value7">
<groupExpression><![CDATA[$F{value7}]]></groupExpression>
<groupHeader>
<band height="21">
<textField>
<reportElement x="0" y="0" width="300" height="20" uuid="208ca6e5-b396-47cb-858b-71039f5bdf7a"/>
<textFieldExpression><![CDATA["Value 7: " + $F{value7}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
<background>
<band/>
</background>
<columnHeader>
<band height="50">
<staticText>
<reportElement x="0" y="30" width="100" height="20" uuid="edf0f0f1-c979-4d20-987e-e8decb0b584a"/>
<text><![CDATA[value1]]></text>
</staticText>
<staticText>
<reportElement x="100" y="30" width="100" height="20" uuid="4287323f-e6d3-40d8-a2d4-44981bfa5c59"/>
<text><![CDATA[value2]]></text>
</staticText>
<staticText>
<reportElement x="200" y="30" width="100" height="20" uuid="b9aa7dfd-edd8-439b-b4c7-12916a740da8"/>
<text><![CDATA[value3]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="24">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="2bcc436d-4c3a-4db1-a2ea-87edf92af98f"/>
<textFieldExpression><![CDATA[$F{value1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="100" height="20" uuid="f893721e-1aa6-44ca-9a9a-ac795ff63a0a"/>
<textFieldExpression><![CDATA[$F{value2}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="0" width="100" height="20" uuid="36ad9612-620b-4eec-9608-f26b5306b01a"/>
<textFieldExpression><![CDATA[$F{value3}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
If you like to use crosstab anyway, you need to setup your dataset differently (since also columns become dynamic) check out this for examples: crosstab example

Categories

Resources