I'm using an xml datasource and passing the xml data to a table in ireport. I have a requirement where the values of the xml tag "amount" needs to be formatted and passed to the table. I have created "amount" as a parameter and passed it from a java class, but all the rows of the table under the amount column is printing the same value.
What I have done is:
1. Created a parameter in the subdataset
2. Edited the table datasource and added amount in the parameters tab
Please refer the .jrxml file:
<?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="DCU_New_template" language="groovy" pageWidth="612" pageHeight="792" columnWidth="540" leftMargin="36" rightMargin="36" topMargin="36" bottomMargin="36" uuid="af5e4276-6e2e-4357-8845-dc8f7d22f777">
<subDataset name="datasetOne" uuid="ea5d2d96-84ca-46ca-a811-d75e3935428f">
<parameter name="amount" class="net.sf.jasperreports.engine.JREmptyDataSource" isForPrompting="false"/>
<queryString language="xPath">
<![CDATA[/sendDetail/results/]]>
</queryString>
<field name="results" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
<field name="effDate" class="java.lang.String">
<fieldDescription><![CDATA[effDate]]></fieldDescription>
</field>
<field name="period" class="java.lang.String">
<fieldDescription><![CDATA[period]]></fieldDescription>
</field>
<field name="amount" class="java.lang.String">
<fieldDescription><![CDATA[amount]]></fieldDescription>
</field>
<field name="totalAmount" class="java.lang.String">
<fieldDescription><![CDATA[totalAmount]]></fieldDescription>
</field>
<field name="description" class="java.lang.String">
<fieldDescription><![CDATA[description]]></fieldDescription>
</field>
<field name="policyNbr" class="java.lang.String"/>
<field name="accountId" class="java.lang.String"/>
<field name="frequency" class="java.lang.String">
<fieldDescription><![CDATA[frequency]]></fieldDescription>
</field>
<field name="lastName" class="java.lang.String">
<fieldDescription><![CDATA[lastName]]></fieldDescription>
</field>
<field name="firstName" class="java.lang.String">
<fieldDescription><![CDATA[firstName]]></fieldDescription>
</field>
</subDataset>
<parameter name="path" class="java.lang.String" isForPrompting="false"/>
<parameter name="policyNbr" class="java.lang.String" isForPrompting="false"/>
<parameter name="accountId" class="java.lang.String" isForPrompting="false"/>
<parameter name="firstName" class="java.lang.String" isForPrompting="false"/>
<parameter name="lastName" class="java.lang.String" isForPrompting="false"/>
<parameter name="frequency" class="java.lang.String" isForPrompting="false"/>
<parameter name="effDate" class="java.lang.String" isForPrompting="false"/>
<parameter name="amount" class="java.lang.String" isForPrompting="false"/>
<queryString language="xPath">
<![CDATA[/]]>
</queryString>
<field name="effDate" class="java.lang.String">
<fieldDescription><![CDATA[effDate]]></fieldDescription>
</field>
<field name="period" class="java.lang.String">
<fieldDescription><![CDATA[period]]></fieldDescription>
</field>
<field name="amount" class="java.lang.String">
<fieldDescription><![CDATA[amount]]></fieldDescription>
</field>
<field name="totalAmount" class="java.lang.String">
<fieldDescription><![CDATA[totalAmount]]></fieldDescription>
</field>
<field name="description" class="java.lang.String">
<fieldDescription><![CDATA[description]]></fieldDescription>
</field>
<field name="firstName" class="java.lang.String">
<fieldDescription><![CDATA[firstName]]></fieldDescription>
</field>
<field name="lastName" class="java.lang.String">
<fieldDescription><![CDATA[lastName]]></fieldDescription>
</field>
<field name="accountId" class="java.lang.String"/>
<field name="policyNbr" class="java.lang.String"/>
<field name="frequency" class="java.lang.String">
<fieldDescription><![CDATA[frequency]]></fieldDescription>
</field>
<title>
<band height="285">
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="381" y="98" width="130" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="true"/>
</textElement>
<text><![CDATA[Enrollee Address]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="224" y="98" width="125" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="true"/>
</textElement>
<text><![CDATA[Current Amount Due:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="99" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="true"/>
</textElement>
<text><![CDATA[Billing Information:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="414" y="48" width="126" height="15"/>
<textElement>
<font fontName="Calibri" size="9" isBold="false"/>
</textElement>
<text><![CDATA[deltadentalins.com/aarp]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="222" width="157" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="true"/>
</textElement>
<text><![CDATA[Recent Transaction History]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="182" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Billing Frequency:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="144" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Account Number:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="157" y="254" width="38" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[From:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="224" y="125" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Amount Due]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="381" y="163" width="159" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Clearwater,FL 337564115]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="224" y="143" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Due Date]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="311" y="254" width="23" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[To:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="163" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Name:]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="381" y="125" width="159" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[1243 S Martin Luther King Jr]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="381" y="144" width="159" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Ave Unit C201]]></text>
</staticText>
<staticText>
<reportElement uuid="68f99313-089f-4856-9b3b-1de9b8141c8e" x="0" y="125" width="119" height="16"/>
<textElement verticalAlignment="Middle">
<font fontName="Calibri" size="13" isBold="false"/>
</textElement>
<text><![CDATA[Enrollee ID:]]></text>
</staticText>
<image>
<reportElement uuid="a647e2c1-3f18-47ed-8bb6-0940492843e2" x="0" y="0" width="334" height="63"/>
<imageExpression><![CDATA[$P{path}+"aarp_logo.png"]]></imageExpression>
</image>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="108" y="125" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{policyNbr}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="107" y="143" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{accountId}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="107" y="163" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{firstName}+" "+$P{lastName}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="107" y="182" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{frequency}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="301" y="143" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{effDate}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1600e59d-be63-48cf-a53d-34d663928d09" x="301" y="125" width="100" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$P{amount}]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="98">
<componentElement>
<reportElement uuid="80fd2c41-8337-450e-ac79-99a19fcfdc73" key="table 2" style="table 2" x="1" y="0" width="540" height="98"/>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="datasetOne" uuid="e9aa6c17-781e-41e9-8eb8-79526d0bddb0">
<datasetParameter name="amount">
<datasetParameterExpression><![CDATA[$P{amount}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/sendDetail/results")]]></dataSourceExpression>
</datasetRun>
<jr:column uuid="66d5e38d-7d0c-4eb6-85f8-52cfd7f240a0" width="82">
<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="92cfb518-38e4-484e-9a41-a1e5d53927e9" x="0" y="0" width="82" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Invoice Number]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
<textField>
<reportElement uuid="78fb6f48-1cd5-4692-817d-f811dd59a570" x="0" y="0" width="82" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{accountId}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="ff61e14f-5e24-48f4-841c-e8af679fae6c" width="82">
<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="1933c38d-4a06-4496-8f18-3feec9655960" x="0" y="0" width="82" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Effective Date]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="f0412d18-6093-483f-86d3-aacbd2d47a6f" x="0" y="0" width="82" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{effDate}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="4d483cce-1bfe-44ed-9533-123f5c01d955" width="137">
<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="6a1bfbb1-f538-484b-b7ca-dcdb01685b75" x="0" y="0" width="137" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Description]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="275b32d5-ce4b-4ef6-b7e3-229b103feadf" x="0" y="0" width="137" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="3448ad87-41d0-4d8e-b760-c9f68c7c9892" width="160">
<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="44e5026f-aba1-43a5-b357-621e56fdd239" x="0" y="0" width="160" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Billing Period]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="5b71dcac-1142-43ee-90c8-e4ea4a156c1f" x="0" y="0" width="160" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{period}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="31c4232c-9a4f-47cd-a54b-8ce5f870f783" width="77">
<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
<staticText>
<reportElement uuid="a787230a-809e-4681-92c0-622b2c3021a1" x="0" y="0" width="77" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Current Amount]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="08a96cb3-dade-496c-884d-f92fc590104e" x="0" y="0" width="77" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{amount}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
XML File:
<sendDetail>
<results>
<effDate>2015-10-20</effDate>
<period>DEC 1;2015 TO FEB 29;2016</period>
<amount>100.25</amount>
<totalAmount>184.54</totalAmount>
<description>Premium</description>
</results>
<results>
<effDate>2015-10-20</effDate>
<period>DEC 1;2015 TO FEB 29;2016</period>
<amount>132.41</amount>
<totalAmount>0</totalAmount>
<description>Premium Cancellation</description>
</results>
<results>
<effDate>2015-07-20</effDate>
<period>SEP 1;2015 TO NOV 30;2015</period>
<amount>154.21</amount>
<totalAmount>0</totalAmount>
<description>Premium Cancellation</description>
</results>
<results>
<effDate>2015-07-20</effDate>
<period>SEP 1;2015 TO NOV 30;2015</period>
<amount>165.46</amount>
<totalAmount>177.48</totalAmount>
<description>Premium</description>
</results>
</sendDetail>
Result PDF:
Related
I want to add an hyperlink in my custom dialog in WIx, but currently I am able to add only message not hyperlink. Internet I saw from installer 5.0 onwards hyperlink adding is supported, mine is "Windows ® Installer. V 5.0.18362.1"
Wix I am using is "WiX Toolset v3.11"
My custome dialog
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="SetupDialogUI">
<Dialog Id="MyNewDlg" Width="370" Height="270" Title="Waygate Technologies">
<Control Id="background" Type="Bitmap" Text="bgPic" Width="370" Height="234" X="0" Y="0" TabSkip="no" />
<Control Id="introText" Type="Text" X="130" Y="50" Width="350" Height="22" Transparent="yes" Text="{\WixUI_Font_Title}CUDA Toolkit Installation" />
<Control Id="explanationText" X="130" Y="100" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="250" Height="100" Text=**"Before installing please install dependencies**." />
<Control Id="installButton" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Ok">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
</Dialog>
<InstallUISequence>
<Show Dialog="MyNewDlg" Before="ExecuteAction" />
</InstallUISequence>
</UI>
</Fragment>
</Wix>
You simply need a Control Element of the Type "Hyperlink" that contains a formated text, look here.
<Control Id="Link1" Type="Hyperlink" X="135" Y="250" Width="220" Height="60" >
<Text><![CDATA[Click here!]]></Text>
</Control>
I have created main and sub jasper report using ireport tool.
Below are details of report which I have created
Main Report:
<?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="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c378ac54-562d-4302-8bac-8afca44b5089">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\hitesh\\JasperDemo2\\resource\\"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[custominfo/multiplerecord]]>
</queryString>
<field name="ADATE" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#ADATE]]></fieldDescription>
</field>
<field name="AMOUNT" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#AMOUNT]]></fieldDescription>
</field>
<field name="BANK" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#BANK]]></fieldDescription>
</field>
<field name="BRANCH" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#BRANCH]]></fieldDescription>
</field>
<field name="RDATE" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#RDATE]]></fieldDescription>
</field>
<field name="REFNO" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#REFNO]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="168">
<staticText>
<reportElement x="1" y="1" width="552" height="20" uuid="ea996077-bb25-4940-bf74-4c8e1d443faa"/>
<textElement textAlignment="Center">
<font size="14" isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Due Diligence Report For Housing & Mortgage Loan Process]]></text>
</staticText>
<staticText>
<reportElement x="1" y="35" width="189" height="21" uuid="69d14272-90dd-4de2-8120-03add35e81a6"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Reporting bank]]></text>
</staticText>
<staticText>
<reportElement x="1" y="57" width="189" height="21" uuid="0447487b-8478-4e1e-9b7a-92b745a36a22"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Branch]]></text>
</staticText>
<staticText>
<reportElement x="1" y="79" width="189" height="21" uuid="931c958d-13ef-4387-951d-bb1a0dcbcb08"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Loan Application Amount]]></text>
</staticText>
<staticText>
<reportElement x="1" y="101" width="189" height="21" uuid="395dbcf2-b0a2-4611-80d0-a47fc1533853"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Assignment Date]]></text>
</staticText>
<staticText>
<reportElement x="1" y="123" width="189" height="21" uuid="31ea40ba-f128-48cd-943a-a5c3e962056f"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Report Date]]></text>
</staticText>
<staticText>
<reportElement x="1" y="145" width="189" height="21" uuid="d129f4f0-1c89-4815-9c33-514453b2385a"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Report Ref. Sr. No.]]></text>
</staticText>
<line>
<reportElement x="0" y="56" width="555" height="1" uuid="88408577-afee-4e4d-b60b-789b3c2ffeec"/>
</line>
<line>
<reportElement x="0" y="78" width="555" height="1" uuid="4bed497d-24d9-4801-b270-02fd98410a1c"/>
</line>
<line>
<reportElement x="0" y="100" width="555" height="1" uuid="93223947-5c1e-46ea-9a85-6eab5ff6da56"/>
</line>
<line>
<reportElement x="0" y="122" width="555" height="1" uuid="5a5e5c45-dd3d-423e-92ea-16b1ec1e7e46"/>
</line>
<line>
<reportElement x="0" y="144" width="555" height="1" uuid="0e50dcad-5f16-4d24-8ef0-b9e690d633b4"/>
</line>
<line>
<reportElement x="0" y="167" width="555" height="1" uuid="e80968e3-b1f8-4a23-8f0d-944da30db585"/>
</line>
<textField>
<reportElement x="191" y="36" width="364" height="20" uuid="8e763775-e917-476b-a48d-59e43339840f"/>
<textFieldExpression><![CDATA[$F{BANK}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="191" y="58" width="364" height="20" uuid="4ebda466-ee22-4a77-b81f-8c8c0c42648d"/>
<textFieldExpression><![CDATA[$F{BRANCH}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="191" y="79" width="364" height="20" uuid="3039c063-1613-4e54-9731-253335c00472"/>
<textFieldExpression><![CDATA[$F{AMOUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="191" y="101" width="364" height="20" uuid="7b3e5d63-bdd4-4b45-af23-fcc6b11f3c37"/>
<textFieldExpression><![CDATA[$F{ADATE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="191" y="124" width="364" height="20" uuid="e290e21a-26de-4e81-9e9d-1f5e2f8e3920"/>
<textFieldExpression><![CDATA[$F{RDATE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="191" y="146" width="364" height="20" uuid="de142a3d-45c8-4990-aca9-4ca74e9aa702"/>
<textFieldExpression><![CDATA[$F{REFNO}]]></textFieldExpression>
</textField>
<line>
<reportElement x="190" y="35" width="1" height="21" uuid="3af51f75-0611-494f-aee2-f30179824a23"/>
</line>
<line>
<reportElement x="190" y="57" width="1" height="21" uuid="ff227276-d6d0-4b41-93b0-bc2f2438bb0e"/>
</line>
<line>
<reportElement x="190" y="79" width="1" height="21" uuid="96408275-181f-4d55-bab5-218769ac9e08"/>
</line>
<line>
<reportElement x="190" y="101" width="1" height="21" uuid="609961b0-b127-48bc-82f1-224ae7437359"/>
</line>
<line>
<reportElement x="190" y="123" width="1" height="21" uuid="45e26d7e-6b63-4dbc-b390-c265d82bf9d1"/>
</line>
<line>
<reportElement x="190" y="145" width="1" height="21" uuid="418cd970-ae35-48ff-aa1f-656b969bbf2e"/>
</line>
<line>
<reportElement x="0" y="35" width="1" height="21" uuid="97d6df92-411c-4c2d-ab40-99ea10222702"/>
</line>
<line>
<reportElement x="0" y="57" width="1" height="21" uuid="a1c65914-1293-4986-96e1-0542d425f7ec"/>
</line>
<line>
<reportElement x="0" y="101" width="1" height="21" uuid="98050f8c-8909-4910-9c08-5a4957da8ae1"/>
</line>
<line>
<reportElement x="0" y="123" width="1" height="21" uuid="b49e491b-593f-4786-b94d-7ba8b8b7ac0f"/>
</line>
<line>
<reportElement x="0" y="146" width="1" height="21" uuid="53ec9718-4e23-4815-a527-4612ced3d68d"/>
</line>
<line>
<reportElement x="0" y="34" width="555" height="1" uuid="2de5a889-dd1a-45ce-8dc9-133a22e035e3"/>
</line>
<line>
<reportElement x="0" y="79" width="1" height="21" uuid="d713b5a2-2b60-48fb-8eb8-ecef6fe558cc"/>
</line>
<line>
<reportElement x="555" y="34" width="1" height="21" uuid="374b13b5-8b5c-482e-8df7-17872df35e52"/>
</line>
<line>
<reportElement x="555" y="56" width="1" height="21" uuid="8bddc232-2194-4ea9-8d27-7292b81c2338"/>
</line>
<line>
<reportElement x="555" y="77" width="1" height="22" uuid="258c96a2-f5ea-4277-9dba-eb420697772f"/>
</line>
<line>
<reportElement x="555" y="101" width="1" height="21" uuid="82966cec-d564-4d72-a30a-d87d8054b59a"/>
</line>
<line>
<reportElement x="555" y="122" width="1" height="21" uuid="15b0edb9-5f43-452c-a511-5d574cf05e98"/>
</line>
<line>
<reportElement x="555" y="144" width="1" height="22" uuid="cc394272-7b66-403e-8f04-e7ff982b79d5"/>
</line>
</band>
</columnHeader>
<detail>
<band height="100" splitType="Stretch">
<subreport>
<reportElement isPrintRepeatedValues="false" x="0" y="0" width="551" height="100" uuid="3e117990-7e70-4224-858b-d7bc43057c3d"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//summary/record")]]></dataSourceExpression>
<subreportExpression><![CDATA["report1_subreport1.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
Sub-Report
<?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="report1_subreport1" language="groovy" pageWidth="555" pageHeight="802" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="ac2acac4-505d-41e0-a715-851795c6a6d1">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString language="xPath">
<![CDATA[/custominfo/multiplerecord/summary/record]]>
</queryString>
<field name="BRANCH" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#BRANCH]]></fieldDescription>
</field>
<field name="ADATE" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#ADATE]]></fieldDescription>
</field>
<field name="AMOUNT" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#AMOUNT]]></fieldDescription>
</field>
<field name="BANK" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#BANK]]></fieldDescription>
</field>
<field name="RDATE" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#RDATE]]></fieldDescription>
</field>
<field name="REFNO" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/singlerecord/#REFNO]]></fieldDescription>
</field>
<field name="ANO" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/multiplerecord/summary/record/#ANO]]></fieldDescription>
</field>
<field name="CONTENT" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/multiplerecord/summary/record/#CONTENT]]></fieldDescription>
</field>
<field name="REMARKS" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/multiplerecord/summary/record/#REMARKS]]></fieldDescription>
</field>
<field name="SECTION" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/multiplerecord/summary/record/#SECTION]]></fieldDescription>
</field>
<field name="SRNO" class="java.lang.String">
<fieldDescription><![CDATA[/custominfo/multiplerecord/summary/record/#SRNO]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="21" splitType="Stretch">
<staticText>
<reportElement x="3" y="0" width="552" height="20" uuid="8b2b2894-fc50-442c-8ab8-8e46fa55053e"/>
<textElement textAlignment="Center">
<font size="14" isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Summary of the report]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band splitType="Stretch"/>
<band height="22">
<textField>
<reportElement x="0" y="2" width="100" height="20" uuid="4838078b-55c8-4b87-9a86-2d193d4f63bf"/>
<textFieldExpression><![CDATA[$F{SRNO}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<custominfo>
<singlerecord BANK="ABC" BRANCH="XYZ" AMOUNT="Rs. 20,50,000/-" ADATE="27th February-2018" RDATE="3rd March -2018" REFNO="ABC12121" />
<multiplerecord>
<summary>
<record SECTION="1" SRNO="1" CONTENT="Test1" ANO="A" REMARKS="Test3" />
<record SECTION="1" SRNO="2" CONTENT="Test2" ANO="B" REMARKS="Test4" />
</summary>
<oberservation>
<record SECTION="2" OBSERVATION="No Observation"></record>
</oberservation>
</multiplerecord>
</custominfo>
I am using XML datasource; when I am previewed main report, sub-report fields are getting displayed as null inside main report, but when I directly previewed sub-report it working fine.
please help me to understand why this is happening
Field mappings should be relative to the nodes selected by the data source, so what you need in the subreport is
<field name="SRNO" class="java.lang.String">
<fieldDescription><![CDATA[#SRNO]]></fieldDescription>
</field>
The same thing applies to the master report, you should use #ADATE, #AMOUNT and so on as field mappings.
This question already has answers here:
How to insert images from database?
(2 answers)
Show image from database. Getting net.sf.jasperreports.engine.JRException: Image read failed
(2 answers)
BLOB image not displayed in jasper report pdf
(1 answer)
Closed 5 years ago.
<?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="null" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0a01e24e-d4df-490e-8b8c-c9c06a7e21b1">
<parameter name="HEADER_SERIAL" class="java.lang.String">
<defaultValueExpression><![CDATA[Integer.valueOf($P{HEADER_SUB_SERIAL})]]></defaultValueExpression>
</parameter>
<parameter name="HEADER_SUB_SERIAL" class="java.lang.Integer" isForPrompting="false"/>
<queryString>
<![CDATA[SELECT * FROM (SELECT * FROM company_details) cd]]>
</queryString>
<field name="company_name" class="java.lang.String"/>
<field name="address_1" class="java.lang.String"/>
<field name="postal_code" class="java.lang.String"/>
<field name="website" class="java.lang.String"/>
<field name="banner" class="java.lang.Object"/>
<field name="town" class="java.lang.String"/>
<field name="province" class="java.lang.String"/>
<field name="country" class="java.lang.String"/>
<field name="telephone_1" class="java.lang.String"/>
<field name="logo" class="java.lang.Object"/>
<field name="email" class="java.lang.String"/>
<columnHeader>
<band height="79" splitType="Stretch">
<staticText>
<reportElement x="366" y="48" width="59" height="16" uuid="5114943c-a544-4c53-9173-fa4d4ef13eab"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[P.O BOX]]></text>
</staticText>
<staticText>
<reportElement x="366" y="17" width="59" height="16" uuid="6e8af721-752a-4d09-8bf1-60c06a8a282d"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Website ]]></text>
</staticText>
<staticText>
<reportElement x="366" y="32" width="59" height="16" uuid="81c74b97-4910-4dce-bd2b-a5f83e827e84"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Email]]></text>
</staticText>
<textField>
<reportElement x="366" y="2" width="189" height="15" uuid="3ef09040-0f8e-4542-ac48-3b08efa6f383"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{company_name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="441" y="17" width="114" height="15" uuid="1a8d5ba4-2837-450c-9552-01e7e6ded58c"/>
<textFieldExpression><![CDATA[$F{website}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="441" y="33" width="114" height="15" uuid="bea94c57-63de-469c-8993-3cb25bd66dfb"/>
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="366" y="63" width="59" height="16" uuid="b8797b80-b8a6-4d5c-8225-91f89960fe80"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Country]]></text>
</staticText>
<textField>
<reportElement x="441" y="48" width="62" height="15" uuid="f2d6ddbb-0c94-4ce8-b96e-213762d8a591"/>
<textFieldExpression><![CDATA[$F{address_1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="441" y="63" width="114" height="15" uuid="0926bdda-3fcb-4d15-b5fb-bd812e39279b"/>
<textFieldExpression><![CDATA[$F{country}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="503" y="48" width="52" height="15" uuid="8f8acd7b-1fea-4fcb-a17e-db1d70bb4e30"/>
<textFieldExpression><![CDATA[$F{postal_code}]]></textFieldExpression>
</textField>
<image scaleImage="RetainShape" hAlign="Center">
<reportElement x="0" y="2" width="159" height="76" uuid="5033480f-8a9b-400a-8c95-8bbb79101452"/>
<imageExpression><![CDATA[$F{logo}]]></imageExpression>
</image>
</band>
</columnHeader>
</jasperReport>
Am using jasper plugin in netbeans and i have a problem when displaying an image.I get the following errors :
Error filling print... Unknown image source class [B
net.sf.jasperreports.engine.JRException: Unknown image source class [B
at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:559)
at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:472)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259)
So the goal here is to have a 2 color diagonal hatch pattern that can be rotated to arbitrary angles dynamically (fyi it's being applied to a D3 map w/zooming).
I found the "SVG Pattern Contains Whitespace Between Repetitions in Firefox(1) question, however the solution is not very flexible rotation-wise and I couldn't make it work with the 2 colors bars.
Here's a jsfiddle test case.. The first 4 are my technique rotated differently. The last one is an attempt to adapt follow the previously mentioned answer's advice.
Chrome renders it fine(2) (as does Safari and IE).
But Firefox has these nasty lines where it tiles, but only when the pattern is rotated to something other than 90deg increments.
Any ideas?
Here's the contents of the Jsfiddle:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd">
<svg xml:space="preserve" width="925" height="810" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<pattern id="hatch" width="10" height="10" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:black; stroke-width:16" />
<line x1="13" y1="0" x2="13" y2="10" style="stroke:gray; stroke-width:16" />
</pattern>
<pattern id="hatch45" width="10" height="10" patternTransform="rotate(5 0 0)" patternUnits="userSpaceOnUse">
<line x1="-2" y1="-2" x2="-2" y2="12" style="stroke:black; stroke-width:16" overflow="visible" />
<line x1="12" y1="-2" x2="12" y2="12" style="stroke:gray; stroke-width:16" overflow="visible" />
</pattern>
<pattern id="hatch80" width="10" height="10" patternTransform="rotate(80 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:black; stroke-width:16" />
<line x1="13" y1="0" x2="13" y2="10" style="stroke:gray; stroke-width:16" />
</pattern>
<pattern id="hatch90" width="10" height="10" patternTransform="rotate(90 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:black; stroke-width:16" />
<line x1="13" y1="0" x2="13" y2="10" style="stroke:gray; stroke-width:16" />
</pattern>
<pattern x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse" id="line-fill" viewBox="0 0 20 20" overflow="visible" patternTransform="rotate(80 0 0)">
<g stroke-width="20">
<line x1="0" y1="-10" x2="0" y2="30" stroke="black" />
<line x1="20" y1="-10" x2="20" y2="30" stroke="gray" />
</g>
</pattern>
</defs>
<g>
<rect style="fill:url(#hatch45);" x="10" y="0" width="200" height="130" />
<rect style="fill:url(#hatch80);" x="10" y="150" width="200" height="130" />
<rect style="fill:url(#hatch90);" x="10" y="300" width="200" height="130" />
<rect style="fill:url(#hatch);" x="10" y="450" width="200" height="130" />
<rect style="fill:url(#line-fill);" x="10" y="600" width="200" height="130" />
</g>
</svg>
1: stackoverflow.com/questions/19391071/svg-pattern-contains-whitespace-between-repetitions-in-firefox
2: imgur.com/c8SxdGG
Is it possible, and if so how can I create a single value from multiple properties within a WiX installation project?
Specifically, I have some dialog like this...
<Dialog Id="ConnectionStringDlg" Width="370"
Height="270" Title="Database Settings - [ProductName]" NoMinimize="yes">
<!-- Connection String -->
<Control Id="TitleLabel" Type="Text" X="45" Y="60" Width="100" Height="15" TabSkip="yes" Text="Connection String" />
<Control Id="DSLabel" Type="Text" X="45" Y="77"
Width="100" Height="15" TabSkip="no" Text="&Data Source: " />
<Control Id="DSEdit" Type="Edit" X="45" Y="92"
Width="220" Height="18" Property="CONNECTION_STRING_DS" Text="{200}" />
<Control Id="ICLabel" Type="Text" X="45" Y="107"
Width="100" Height="15" TabSkip="no" Text="&Initial Catalog: " />
<Control Id="ICEdit" Type="Edit" X="45" Y="122"
Width="220" Height="18" Property="CONNECTION_STRING_IC" Text="{200}" />
<Control Id="UIDLabel" Type="Text" X="45" Y="137"
Width="100" Height="15" TabSkip="no" Text="&User ID: " />
<Control Id="UIDEdit" Type="Edit" X="45" Y="152"
Width="220" Height="18" Property="CONNECTION_STRING_UI" Text="{200}" />
<Control Id="PassLabel" Type="Text" X="45" Y="167"
Width="100" Height="15" TabSkip="no" Text="&Password: " />
<Control Id="PassEdit" Type="Edit" X="45" Y="182" Password="yes"
Width="220" Height="18" Property="CONNECTION_STRING_PASS" Text="{200}" />
<!-- Back button -->
<!--<Control Id="Back" Type="PushButton" X="180" Y="243"
Width="56" Height="17" Text="&Back">
<Publish Event="NewDialog" Value="PoolSettingsDlg">1</Publish>
</Control>-->
<Control Id="Next" Type="PushButton" X="236" Y="243"
Width="56" Height="17" Default="yes" Text="&Next">
<Publish Event="NewDialog" Value="CustomizeDlg">
<!--if settings are correct, allow next dialog-->
<![CDATA[CONNECTION_STRING <> ""]]>
</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243"
Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0"
Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="Description" Type="Text" X="25" Y="23"
Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Please enter database configuration</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="15" Y="6"
Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\WixUI_Font_Title}Database Settings</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
Which I am using to get connection string information from the end user in a user friendly way. I then set this value in a web.config file at install time using...
<Component Id="cmp623DDF82F0F7645ADAAF0E7573713162" Guid="{8CFDC325-BC71-4A2F-AB22-68B0AE56C98B}">
<File Id="fil5B0B918C0DAF7B2ECC5EB9C7CC0B9FFC" KeyPath="yes" Source="Publish\Web.config" />
<util:XmlFile Id="ModifyConnectionString"
Action="setValue"
Permanent="yes"
ElementPath="//configuration/connectionStrings/add[\[]#name='RawConnection'[\]]"
Name="connectionString"
File="[#fil5B0B918C0DAF7B2ECC5EB9C7CC0B9FFC]"
Value="[CONNECTION_STRING]"
SelectionLanguage="XSLPattern"
Sequence="1"/>
</Component>
My question is, how can I set the connection string value by making a composite from multiple properties set in the dialog?
You could use the MSI Community extensions for this as it provides you with a nice interface and will format the string for you.
However if you want to build it up manually you can just do the string building in the Value attribute:
<util:XmlFile Id="ModifyConnectionString"
Action="setValue"
Permanent="yes"
ElementPath="//configuration/connectionStrings/add[\[]#name='RawConnection'[\]]"
Name="connectionString"
File="[#fil5B0B918C0DAF7B2ECC5EB9C7CC0B9FFC]"
Value='Server=[CONNECTION_STRING_DS];Database=[CONNECTION_STRING_IC];User Id=[CONNECTION_STRING_UI];Password=[CONNECTION_STRING_PASS];'
SelectionLanguage="XSLPattern"
Sequence="1"/>
Alternatively if you need to set a single property to use in multiple places you can either use the CustomAction or the SetProperty elements (they both do the same thing):
<CustomAction Id='SetConnectionString'
Property='CONNECTION_STRING'
Before='ExecXmlFile'
Value='Server=[CONNECTION_STRING_DS];Database=[CONNECTION_STRING_IC];User Id=[CONNECTION_STRING_UI];Password=[CONNECTION_STRING_PASS];' />
<SetProperty Id='CONNECTION_STRING'
Before='ExecXmlFile'
Value='Server=[CONNECTION_STRING_DS];Database=[CONNECTION_STRING_IC];User Id=[CONNECTION_STRING_UI];Password=[CONNECTION_STRING_PASS];' />