Skip to main content

Portable database reporting using Java and XML

How to generate printable reports with Java, XML, and FOP

Return to article

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Report PUBLIC "Currencies" "http://www.maxprograms.com/MXReports.dtd">
<Report Name="Currencies" Title="List of Currencies" Version="1.0">
	<Page Height="297" Width="210">
		<ReportBand BandType="HeaderBand" Height="27" Name="header">
			<ReportElement ElementType="Label" Height="10" Left="55" Name="Title" Top="12" Width="100">
				<Label Data="Currencies by Country">
					<Font FontName="SansSerif" Style="Bold"/>
				</Label>
			</ReportElement>
		</ReportBand>
		<ReportBand BandType="DetailBand" Height="10" Name="detail">
			<ReportElement ElementType="DataField" Height="8" Left="5" Name="countryName" Top="1" Width="90">
				<DataField FieldName="country" SQLStatement="ST1 ">
					<Font FontName="Arial" Style="Regular"/>
				</DataField>
			</ReportElement>
			<ReportElement ElementType="DataField" Height="8" Left="100" Name="currencyName" Top="1" Width="90">
				<DataField FieldName="currency" SQLStatement="ST1 ">
					<Font FontName="Arial" Style="Regular"/>
				</DataField>
			</ReportElement>
		</ReportBand>
		<ReportBand BandType="FooterBand" Height="20" Name="footer">
			<ReportElement ElementType="Label" Height="8" Left="10" Name="footerLabel" Top="2" Width="50">
				<Label Data="Author: JD">
					<Font FontName="SansSerif" Style="Italics"/>
				</Label>
			</ReportElement>
		</ReportBand>
	</Page>
	<SQLSatement Driver="interbase.interclient.Driver" Name="ST1" Password="masterkey" Statement="SELECT Country, Currency FROM Country ORDER BY Country " URL="jdbc:interbase://localhost/c:\mxreports\employee.gdb" Username="SYSDBA"/>
</Report>

Return to article