PDA

View Full Version : Linking subreports with XML



jlabuelo
07-18-2013, 09:05 AM
Hi again

Sorry but we are finding more issues (sure due to our lack of experience using XML in pentaho reporting). Ihave here this simple XML file

<Service>


<Number_id>698137757</Number_id>


<UI>111636</UI>


<IVA>21</IVA>


<TipoIVA>1</TipoIVA>


<Cuota>


<Descripcion>consumo mínimo</Descripcion>


<Importe>6,000000</Importe>


</Cuota>


<Cuota>


<Descripcion>cota mensual TipoB</Descripcion>


<Importe>3,000000</Importe>


</Cuota>


</Service>


<Service>


<Number_id>687063413</Number_id>


<UI>111636</UI>


<IVA>21</IVA>


<TipoIVA>1</TipoIVA>


<Cuota>


<Descripcion>cuota mensual ocio</Descripcion>


<Importe>6,000000</Importe>


</Cuota>


</Service>

So I need to appear in my report a table like this

ServiceId Descripcion Importe

698137757 consumo mínimo 6,00
698137757 cota mensual TipoB 3,00
687063413 cuota mensual ocio 6,00


We are using a set subreports hanging from a parent report.

In the parent report we have more information, and we call the subreport1 where we get to the <service> level of the xml file

Next step is to create a subreport2 which is into the subreport1 to get to the <cuota> level. To get this we try to filter the values for each "number_id" value using this xquery in the DataSource. First we import the parameter from the fields returned in the query used in the subreport1 and we call it "Number_id_Parent"

/Service[Number_id=${Number_id_Parent}]/Cuota

But this is not returning anything. Any ideas please???

If we change the query by this

/Service[Number_id='698137757']/Cuota

It works fine but for this number_id only.

I think the problem is in the call to the "imported" parameter from the "parent report of subreport2 (subreport1) called "Number_id_Parent", but I am not sure how to call it correctly to filter the values as we need .

Thanks a lot

jlabuelo
07-19-2013, 06:06 AM
Hi all

Can anyone let me know if it is possible to link a parent report which has a parameter P1, with a subreport so the subreport only shows the info filtered by the value of the parent paremeter P1?. Is this possible in Pentaho Reporting?

We are getting mad trying to identify how to filter the subreport info to be shown depending on the parent report info, using XML as datasource. Do you know if this is possible in Pentaho Reporting?

Thanks a lot