Why my report can't display parameter?

0
<?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="Collateral" pageWidth="842" pageHeight="595" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="03ee4307-b70d-43bc-b3aa-8d3970231003">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <property name="com.jaspersoft.studio.report.description" value=""/>
    <parameter name="Username" class="java.lang.String"/>
    <parameter name="Officer" class="java.lang.String"/>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band height="555" splitType="Stretch">
            <image scaleImage="FillFrame" hAlign="Center" vAlign="Top" evaluationTime="Report">
                <reportElement positionType="Float" x="0" y="-90" width="800" height="395" uuid="d5d7a19d-060a-4875-954b-e176ab96898a"/>
                <imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"765\" height=\"590\"><text y=\"550\" x=\"-230\"  transform=\"matrix(.8,-.5,.6,.8,0,0)\" style=\"font-size:30px;font-weight:bold;fill:#d8d8d8\">$P{Username}</text></svg>")]]></imageExpression>
            </image>
            <image scaleImage="FillFrame" hAlign="Center" vAlign="Top" evaluationTime="Report">
                <reportElement positionType="Float" x="0" y="130" width="800" height="420" uuid="d5d7a19d-060a-4875-954b-e176ab96898a"/>
                <imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"765\" height=\"590\"><text y=\"550\" x=\"-230\"  transform=\"matrix(.8,-.5,.6,.8,0,0)\" style=\"font-size:30px;font-weight:bold;fill:#d8d8d8\">$P{Officer}</text></svg>")]]></imageExpression>
            </image>
        </band>
    </background>
    <columnHeader>
        <band height="50"/>
    </columnHeader>
    <detail>
        <band height="50"/>
    </detail>
</jasperReport>


Hello anyone i have problem about values of my parameter in my jrxml code above and my watermark show like image above
First Question : Why myparameter $P{Username} and $P{Officer} not display?

What i want to do about my report ?
answer i want to create my report with watemark that can rotation 45 degree and display parameter values but i dont know my code not work
you have any idea for it ?
**This is my first post**
sorry first i am bad for English language and Beginner for jasper report.

Thank you for help :)

oatza753's picture
Joined: Feb 22 2019 - 12:22am
Last seen: 3 months 2 weeks ago

2 Answers:

1

Hi,

shouldn't it be (see colored):

 <imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"765\" height=\"590\"><text y=\"550\" x=\"-230\"  transform=\"matrix(.8,-.5,.6,.8,0,0)\" style=\"font-size:30px;font-weight:bold;fill:#d8d8d8\">$P{Username} "</text></svg>")]]></imageExpression>

that should work.

hth + regards from Dresden/Germany

C-Box

C-Box's picture
1436
Joined: Jul 19 2006 - 5:58pm
Last seen: 14 hours 22 min ago
0

Thank you very much C-Box :) 
you help me alot , i still need to learn more about Coding. 

oatza753's picture
Joined: Feb 22 2019 - 12:22am
Last seen: 3 months 2 weeks ago
Feedback