Plain text/xml report template

Hello CUBA team!

I would like to create reports with XML and some CSV-like plain text output.
The templates for these should be editable by end users via the reporting UI.

Best would be to define a plain text template where i can reference bands and repeat arbitrary sections of text according to the band’s record count.

What would be the best approach to solve this?

Thanks for any hints!

I figured the jrxml -> CSV option would be fine, but i cannot get rid of the semicolons (and in same cases doublequotes) the system automatically inserts there.

So the template goes like
HeaderLine 1
HeaderLine 2
{field1} {field2}

and the result would be
;HeaderLine1
;HeaderLine2
field1content; field2content;

The semicolons are duplicated for each row in the dataset, so with 2 records i get
;;HeaderLine1 etc…

Is there a way to turn these off?

This is the template:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
<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" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8a56d3b2-79be-40ef-8b5c-ed489479c850">
	<field name="name" class="java.lang.String"/>
	<field name="id" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="299" splitType="Stretch">
			<staticText>
				<reportElement x="380" y="69" width="100" height="30" uuid="cad63314-51ff-4f04-b93a-8afd9028fcd3"/>
				<text><![CDATA[Static Text]]></text>
			</staticText>
			<staticText>
				<reportElement x="380" y="99" width="100" height="30"/>
				<text><![CDATA[Static Text2]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="35" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="61" splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="125" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="0" width="100" height="30"/>
				<text><![CDATA[Static Band Text1]]></text>
			</staticText>
			<textField>
				<reportElement x="0" y="30" width="300" height="30"/>
				<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="301" y="30" width="300" height="30"/>
				<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="380" y="60" width="100" height="30"/>
				<text><![CDATA[Static Band Text2]]></text>
			</staticText>
		</band>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="54" splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="42" splitType="Stretch"/>
	</summary>
</jasperReport>

Just to provide a little feedback, the XML report can be done nicely using the HTML template option.

The only downside is that the framework always uses .html extension for the output, so when executing it from the UI it will automatically open as an html doc in the default browser.
If the extension could be provided in the output field, it would look much less scary to end users.