passing foundset to jasper not significant ?

Questions and answers on developing, deploying and using plugins and JavaBeans

passing foundset to jasper not significant ?

Postby stefanoni » Wed Jul 24, 2013 12:01 pm

I discovered with great surprise that it does not matter which foundset I hand over to Jasper.

In Jasper I print a field like this:
<textFieldExpression class="java.lang.Number"> <! [CDATA [$ F {myDetailFoundSet.myFieldName}]]> </ textField expression>

I call the report like this:
plugins.jasperPluginRMI.runReport (myDummyFoundset. cReportNam, true plugins.jasperPluginRMI.OUTPUT_FORMAT.PRINT, null, null)

This works very well !

Question:
Why is this absolutely correct looped through the Foundset myDetailFoundSet even though I have myDummyFoundset specified in the call.
Which instance makes the skip to the next record of myDetailFoundSet?

I must mention that myDummyFoundset must contain only 1 record, otherwise all the detail rows of myDetailFoundSet will be re-printed for each
record of myDummyFoundset . This makes sense to me, that the skip-to-next-record happens in the foundset I passed to the plugin.

Thanks for any enlightenment
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: passing foundset to jasper not significant ?

Postby rgansevles » Wed Jul 24, 2013 5:29 pm

Alessandro,

The foundset argument passed to runReport is what is looped over, it is the variable in your scripting that contains the foundset you want the report for.
The expression '$ F {myDetailFoundSet.myFieldName}' is a field (related foudset myDetailFoundSet, field myFieldName in selected record) that will be printed.
So there is no loooping over myDetailFoundSet.

Hope this heops,

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: passing foundset to jasper not significant ?

Postby stefanoni » Thu Jul 25, 2013 4:15 pm

Thank you rob,

In my understanding the report should work like you described above. This makes absolutely sense.

The reason why I opened this tread was , that I experience an other behaviour, then expected:

The "myDetailFoundSet" is looped true, not the passed "myDummyFoundset" !!
I never realized it since months because I seem to work fine until the passed "myDummyFoundset"
contained more then 1 Record, witch results to double output of all Records of myDetailFoundSet.

If I pass "myDetailFoundSet" it results to an output of

myDetailFoundSet.getSize() mutiplyed by myDetailFoundSet.getSize()

The world is strange sometimes....
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: passing foundset to jasper not significant ?

Postby stefanoni » Thu Jul 25, 2013 4:17 pm

by the way this is the report (containing relationfoundset filt_adpp_1 witch looped true. also its relation filt_adpp_1.adpp_pdpm. the foundset I pass can be anything )

<?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/xs ... report.xsd" name="LohnPlus_Provis" pageWidth="595" pageHeight="842" columnWidth="553" leftMargin="42" rightMargin="0" topMargin="42" bottomMargin="20">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<field name="filt_adpp_1.adpp_pdpm.praem_grp_ziel" class="java.lang.Number"/>
<field name="filt_lspm.lohn_jjmm" class="java.lang.String"/>
<field name="filt_adpp_1.adpp_pdpm.praem_grp_leitg" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.provproz_grundprov" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.provproz_rabatt" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.wir_ums_prozent" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.provproz_umsziel" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.provproz_grpziel" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.abzug_inkasso_proz" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.abzug_strafebet_proz" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.vna" class="java.lang.String"/>
<field name="filt_adpp_1.adpp_pdpm.nna" class="java.lang.String"/>
<field name="filt_adpp_1.ums_schw" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.spe_funktion" class="java.lang.String"/>
<field name="filt_adpp_1.adpp_pdpm.grundlohn" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.lohn_nach_prov" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.abzug_inkasso_gb" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.abzug_inkasso_ab" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.strafebet_gb" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.strafebet_ab" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.lohn_nach_abzug" class="java.lang.Number"/>
<field name="round_5(filt_adpp_1.adpp_pdpm.lohn_nach_abzug)" class="java.lang.Number"/>
<field name="filt_adpp_1.ausgnr" class="java.lang.String"/>
<field name="filt_adpp_1.pdpm_id" class="java.lang.Integer"/>
<field name="filt_adpp_1.adpp_adpg.err_grpziel" class="java.lang.String"/>
<field name="filt_adpp_1.ausgdat" class="java.util.Date"/>
<field name="filt_adpp_1.mandant_cd" class="java.lang.String"/>
<field name="filt_adpp_1.ninprnabkfr" class="java.lang.Number"/>
<field name="filt_adpp_1.davon_wir_fr" class="java.lang.Number"/>
<field name="filt_adpp_1.ausbbet_vert" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_grundlage" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_basis" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_grundprov" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_rabattprov" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_umsziel" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_grpziel" class="java.lang.Number"/>
<field name="filt_adpp_1.prov_wir" class="java.lang.Number"/>
<field name="filt_adpp_1.err_rab_pr_lim" class="java.lang.String"/>
<field name="filt_adpp_1.err_umsziel" class="java.lang.String"/>
<field name="filt_adpp_1.tot_ausbez_fr" class="java.lang.Number"/>
<field name="filt_adpp_1.praem_grp_ziel" class="java.lang.Number"/>
<field name="filt_adpp_1.adpp_pdpm.lohn_nach_abzug - filt_adpp_1.adpp_pdpm.lohn_nach_abzug" class="java.lang.Number"/>
<group name="GrpPdpm" isStartNewPage="true" isResetPageNumber="true" isReprintHeaderOnEachPage="true">
<groupExpression><![CDATA[$F{filt_adpp_1.pdpm_id}]]></groupExpression>
<groupHeader>
<band height="84">
<line>
<reportElement x="0" y="78" width="444" height="1" printWhenGroupChanges="GrpPdpm"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<frame>
<reportElement mode="Opaque" x="0" y="0" width="535" height="26" forecolor="#D0B48E" backcolor="#F2EBDF"/>
</frame>
<textField>
<reportElement x="7" y="8" width="299" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Provisionsberechnung für: " + $F{filt_adpp_1.adpp_pdpm.nna} + " " + $F{filt_adpp_1.adpp_pdpm.vna}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="36" width="51" height="12" printWhenGroupChanges="GrpPdpm">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}.equals( 01 )]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Grundlohn"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="419" y="36" width="90" height="12" printWhenGroupChanges="GrpPdpm">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}.equals( 01 )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.grundlohn}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="51" width="100" height="12" isRemoveLineWhenBlank="true" printWhenGroupChanges="GrpPdpm">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}.equals( 01 ) && $F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" )]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Gruppenleiterprämie"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="419" y="51" width="90" height="12" isRemoveLineWhenBlank="true" printWhenGroupChanges="GrpPdpm">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}.equals( 01 ) && $F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.praem_grp_leitg}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="314" y="8" width="210" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Monat: " + $F{filt_lspm.lohn_jjmm}.substring(02,04) +
" Jahr: 20" + $F{filt_lspm.lohn_jjmm}.substring(00,02)]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="98">
<frame>
<reportElement mode="Opaque" x="-1" y="-1" width="536" height="89" forecolor="#D0B48E" backcolor="#F2EBDF"/>
</frame>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="14" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.lohn_nach_prov}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="26" width="76" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Abzug Inkasso"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="26" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.abzug_inkasso_ab}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="187" y="26" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.abzug_inkasso_proz}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="266" y="26" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.abzug_inkasso_gb}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="187" y="38" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.abzug_strafebet_proz}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="266" y="38" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.strafebet_gb}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="38" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.strafebet_ab}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="38" width="122" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Abzug Qualitätssicherung"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="60" width="75" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Bruttosalär"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="14" width="205" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Total Provisions-Summen vor Abzügen"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="336" y="38" width="42" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["x 2"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="60" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.adpp_pdpm.lohn_nach_abzug}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="72" width="124" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Bruttosalär gerundet"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="72" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{round_5(filt_adpp_1.adpp_pdpm.lohn_nach_abzug)}]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="211" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="0" y="37" width="318" height="24" forecolor="#D5D7C6" backcolor="#EFF3F7"/>
</frame>
<frame>
<reportElement mode="Opaque" x="-1" y="171" width="423" height="12" forecolor="#D0B48E" backcolor="#F2EBDF"/>
</frame>
<textField pattern="">
<reportElement x="0" y="13" width="50" height="12"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Ausgabe: "]]></textFieldExpression>
</textField>
<textField pattern="dd MMMMM yyyy">
<reportElement x="49" y="13" width="103" height="12"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[$F{filt_adpp_1.ausgdat}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="140" width="109" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" )]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Gruppenzielprämie"]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="164" y="128" width="14" height="12" isRemoveLineWhenBlank="true" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="186" y="46" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["= Provisionsgrundlage"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="34" width="54" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Umsatz"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,#" isBlankWhenNull="false">
<reportElement x="0" y="46" width="54" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.ninprnabkfr}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="82" y="34" width="38" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["- WIR"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,#" isBlankWhenNull="false">
<reportElement x="75" y="46" width="45" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.davon_wir_fr}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="34" width="55" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["- Ausb."]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,#" isBlankWhenNull="false">
<reportElement x="124" y="46" width="55" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.ausbbet_vert}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="46" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_grundlage}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="140" width="72" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" ) && $F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.praem_grp_ziel}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="58" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.ums_schw}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="186" y="58" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["- Umsatzschwelle"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="70" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_basis}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="186" y="70" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["= Provisionsbasis"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="92" width="109" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Grund-Provision"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="92" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_basis}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="186" y="92" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.provproz_grundprov}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="92" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_grundprov}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="104" width="109" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Rabatt-Provision"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="104" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_rabattprov}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="186" y="104" width="79" height="12">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_rab_pr_lim}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.provproz_rabatt}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="104" width="50" height="12">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_rab_pr_lim}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_basis}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="116" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_umsziel}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="186" y="116" width="79" height="12">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_umsziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.provproz_umsziel}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="116" width="109" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Umsatzziel-Provision"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="116" width="50" height="12">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_umsziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_basis}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="128" width="72" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_grpziel}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="186" y="128" width="79" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.provproz_grpziel}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="128" width="109" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Gruppenziel-Provision"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="128" width="50" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_basis}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="164" y="104" width="14" height="12" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_rab_pr_lim}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.err_rab_pr_lim}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="164" y="116" width="14" height="12" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_umsziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.err_umsziel}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="124" y="104" width="40" height="12" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_rab_pr_lim}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["erreicht"]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="124" y="116" width="40" height="12" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.err_umsziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["erreicht"]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="124" y="128" width="40" height="12" isRemoveLineWhenBlank="true" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["erreicht"]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="124" y="140" width="40" height="12" isRemoveLineWhenBlank="true" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" ) && $F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["erreicht"]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement mode="Opaque" x="164" y="140" width="14" height="12" isRemoveLineWhenBlank="true" backcolor="#F2EBDF">
<printWhenExpression><![CDATA[$F{filt_adpp_1.adpp_pdpm.spe_funktion}.equals( "1" ) && $F{filt_adpp_1.adpp_adpg.err_grpziel}.equals( "x" )]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_adpg.err_grpziel}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="350" y="152" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.prov_wir}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="152" width="120" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["WIR Umsatz-Provision"]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="186" y="152" width="79" height="12"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.adpp_pdpm.wir_ums_prozent}.toString() + " % von "]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="265" y="152" width="50" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.davon_wir_fr}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="171" width="221" height="12" isRemoveLineWhenBlank="true"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Provisions-Summe für " + $F{filt_adpp_1.ausgnr}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="351" y="171" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.tot_ausbez_fr}]]></textFieldExpression>
</textField>
<line>
<reportElement stretchType="RelativeToBandHeight" x="318" y="70" width="1" height="70"/>
<graphicElement>
<pen lineWidth="0.25" lineStyle="Dotted"/>
</graphicElement>
</line>
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="437" y="172" width="72" height="12"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Number"><![CDATA[$F{filt_adpp_1.tot_ausbez_fr}]]></textFieldExpression>
</textField>
<line>
<reportElement x="2" y="171" width="421" height="1"/>
<graphicElement>
<pen lineWidth="0.25" lineStyle="Dotted"/>
</graphicElement>
</line>
<line>
<reportElement x="0" y="198" width="444" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<textField pattern="">
<reportElement x="155" y="13" width="23" height="12"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.ausgnr}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="186" y="13" width="61" height="12"/>
<textElement verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{filt_adpp_1.mandant_cd}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="16" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="12"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Seite -" + $V{PAGE_NUMBER} + "-"]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: passing foundset to jasper not significant ?

Postby rgansevles » Fri Jul 26, 2013 9:08 am

Alessandro,

I remember now again how it works, slightly different from my post above.

Jasper reports asks for the next data, the plugin will loop over the main foundset and all related foundsets that are used.
So if you use a related foundset in your report, that will be looped over as well.

Compare the behaviour to sql-based report.
When you do a report on the orders table: 'select orderid from orders where customerid = ?' all orders are shown once.
If you add related info via a join: 'select orders.orderid, order_detail.product_name from orders join order_detail on orders.orderid = order_detail.orderid where customerid = ?', the orderdetails will be looped over as well.

If you do the same thing foundset-based you would use fields orderid and orders_to_order_details.product_name in your report and get the same results.

Hope this makes it clear.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: passing foundset to jasper not significant ?

Postby stefanoni » Fri Aug 16, 2013 12:26 pm

Thank you Rob, this makes really sense for me, but as I wrote in earlier posts,
I experience an other behaviour in my case.

I created a little Test-Solution for demonstration purpose. It prints a view records
of the bug_db.

One button passes the Dummy-Foundset with 1 record, and the other button passes
the Dummy-Foundset with more then 1 record.
In both cases, the real printed detail-records are from the same foundset (a Relation).

You can see, that depending on the Record-Count of the passed (but unused ) Dummy-
Foundset, the detail records are printed multiple time.

This is the Demo-Video: http://youtu.be/r0pfGZs7xq8
The Solution and the Report is attached hier:
testSolutionAndReport.zip
(6.13 KiB) Downloaded 269 times


Thank you, for making this more sense to me.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: passing foundset to jasper not significant ?

Postby sbutler » Fri Aug 16, 2013 5:30 pm

Looking at your video, that behavior seems correct. When you use FoundSet reporting, you need to be very careful with which fields/relations you use in your report. When Servoy passes the data to jasper, it creates the equivalent of a cartesian product between all of the related record. Its also always in the context of the foundset you pass. So if your foundset has 2 records in it, and you use a related foundset, your going to get 2 times however many records in your related foundset.

I think you should take a step back and see exactly what you are trying to accomplish. If your end goal is a report based on the tbl_people table, then you should be passing a foundset based on tbl_people. Then use a relation to go from people to company.

Looking at the sample code you posted, you don't seem to be using any columns from the base foundset there either. All of your field names are relationname.columnname. So why not just pass in the relation as the base foundset? I do see your using several relations:
filt_adpp_1
filt_adpp_1.adpp_pdp
filt_lspm

So your going to end up with 1 record for each tuple from the base foundset you pass in, plus all those relations.

If your goal here is dynamic foundset, do you realize you can pass in foundsets as parameters in your report, and use subreports for displaying the data from those different foundsets?


Some additional thoughts after I downloaded your sample...
stefanoni wrote:You can see, that depending on the Record-Count of the passed (but unused ) Dummy-
Foundset, the detail records are printed multiple time.

Why do you think its unused? The data from the report is always in the context of the foundset you pass in! so if you pass in myDummyFoundset in the jaser plugin call and that foundset has 2 records, your going to get at least 2 records in your jasper report. Just because you use the global relation in your report (test_relation_as_filter) doesn't mean that's all jasper will use. If your myDummyFoundset has 2 records, and your test_relation_as_filter has 2 records, your going to end up with a report of 4 records. Generally using an unrelated/global relation in a Jasper report isn't advised because of this.
From your sample, the better approach would be to pass in the relation into the report...
Code: Select all
plugins.jasperPluginRMI.runReport(test_relation_as_filter, ...)

Then in your Jasper report your fields that you add are the columns in test_relation_as_filter (ixtenant, name_full, etc) without the relation name prefix (so they come from the foundset you pass in)
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: passing foundset to jasper not significant ?

Postby stefanoni » Wed Oct 02, 2013 10:58 am

Scott,

For me it's crucial to understand, that a "Cartesian product between all of the related record" is created.

Also was too much to understand, that if I specify in the report a prefix (relation-Foundsetname), it leads to another tuple, respectively, this can be prevented by omitting the prefix, using directly the field-names of the passed foundset.

I have tried this with the test solution, and ultimately with the real report and eliminate any confusions.

Thank you for your rich and insightful response !

Best regards
Alessandro Stefanoni
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 12 guests