#1 2020-07-07 09:12:25

sritter
Member
Registered: 2020-07-07

JXLS - Dependent Queries

Hi,
I am trying to execute a query within an each-statement, using a parameter of from the data of the current loop.
Unfortunately nothing happens: no error, no data.

Should this work with the ReportServer jxls parser? (JXLS 2, JXLS Report)
Are there any hints on what needs to be done for this to work?

regards

Steffen

Offline

#2 2020-07-07 10:49:39

unsi_2
Member
Registered: 2020-06-24

Re: JXLS - Dependent Queries

do not include quotes within the query

Offline

#3 2020-07-20 07:36:20

eduardo
Administrator
Registered: 2016-11-01
Website

Re: JXLS - Dependent Queries

Hi sritter,

can you please post a minimal example of what you are trying to achieve?

Regards,
Eduardo

Offline

#4 2020-07-20 07:45:30

sritter
Member
Registered: 2020-07-07

Re: JXLS - Dependent Queries

I want to iterate over an entity like employees or locations and fill them in  row by row (works). For each of those created rows I want retrieve an additional result set (does not work): monthly performance (returning 12) which I want to add column by column. Or in JXLS speach an jx:each direction=right within the area of an jx:each direction=down. Therefore, the identifier of the first iteration would be a parameter to the second iteration.
But I cannot get the inner iteration to be executed even without parameter.

So basically the "dependent query" sample from v1 http://jxls.sourceforge.net/1.x/samples … ample.html in v2 syntax.

Offline

#5 2020-07-20 07:46:58

eduardo
Administrator
Registered: 2016-11-01
Website

Re: JXLS - Dependent Queries

Hi sritter,

does this work with JXLS2 (without reportserver) ? Do you have the corresponding JXLS2 syntax for the JXLS1 syntax you mention ?

Regards,
Eduardo

Offline

#6 2020-07-20 07:49:25

sritter
Member
Registered: 2020-07-07

Re: JXLS - Dependent Queries

eduardo wrote:

does this work with JXLS2 (without reportserver)?

I don't know

eduardo wrote:

Do you have the corresponding JXLS2 syntax for the JXLS1 syntax you mention ?

Yes, well the only difference between the normal grouping sample and the dependent query is, that the inner each assigns another jdbc.query to items, instead of _group.items.

Offline

#7 2020-07-20 08:41:51

eduardo
Administrator
Registered: 2016-11-01
Website

Re: JXLS - Dependent Queries

Hi sritter,

Dependent Queries are working in my testcase:

Bildschirmfoto-2020-07-20-um-10-38-03.png
Bildschirmfoto-2020-07-20-um-10-38-56.png

jx:area(lastCell="B3")
jx:each(items="jdbc.query('select OR_CUSTOMERNUMBER as customernr FROM T_AGG_ORDER')" var="order" lastCell="B3")
${order.customernr}
jx:each(items="jdbc.query('select CUS_CUSTOMERNAME name, CUS_PHONE phone FROM T_AGG_CUSTOMER where CUS_CUSTOMERNUMBER = ' +order.customernr )" var="customer" lastCell="B3")
${customer.name}

tested with the ReportServer Demo data.

Regards,
Eduardo

Offline

#8 2020-07-20 11:46:01

sritter
Member
Registered: 2020-07-07

Re: JXLS - Dependent Queries

OK, works, if I include the parameters with ' + + ' instead of ? and additional options to jdbc.query.

Offline

#9 2020-07-20 11:53:47

eduardo
Administrator
Registered: 2016-11-01
Website

Re: JXLS - Dependent Queries

sritter wrote:

OK, works, if I include the parameters with ' + + ' instead of ? and additional options to jdbc.query.

I didn't get this. What did you replace with + + ? and how does it work now in your case ?

Regards,
Eduardo

Offline

#10 2020-07-20 11:54:40

sritter
Member
Registered: 2020-07-07

Re: JXLS - Dependent Queries

"jdbc.query('select CUS_CUSTOMERNAME name, CUS_PHONE phone FROM T_AGG_CUSTOMER where CUS_CUSTOMERNUMBER = ' +order.customernr )"

instead of

"jdbc.query('select CUS_CUSTOMERNAME name, CUS_PHONE phone FROM T_AGG_CUSTOMER where CUS_CUSTOMERNUMBER = ?', order.customernr)"

Offline

#11 2020-07-20 12:24:36

eduardo
Administrator
Registered: 2016-11-01
Website

Re: JXLS - Dependent Queries

Hi sritter,

this seems not to work with the "?" syntax, this is correct. I raised RS-4284. I think this is not yet supported in JXLS2 or it is a bug. In the meanwhile, please use the "+" syntax.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB