Luegisdorf
12/16/2005 3:47:00 PM
Hi Elton
This one works (as you've described):
queryrun.query().dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable,SalesID)).value("00001");
queryrun.query().dataSourceTable(tablenum(SalesLine)).addRange(fieldnum(SalesLine,ItemID)).value("Item1");
In this way you get one SalesTable (00001) AND all SaleLines for sales order
00001 which has ItemId = Item1.
But do you want to get all SalesTable with order num 00001 and theirs sales
Lines and in addition all SalesTables and SalesLines where the SalesLInes
ItemId = Item1?
Or do you want just make one Query with 2 data Sources by x++?
Please be patience with me, I think I didn't see again what you mean, but
may be I've found a trace?
Best regards and a nice weekend
Patrick
"elton" wrote:
> hi Patrick,
>
> In summary, my datasource in report contains 2 tables, you
> showed me use only 1 queryrun to get each table by using:
>
> while (queryRun.next())
> {
> if (queryRun.changed(tablenum(SalesTable)))
> {
> element.send(queryrRun.get(tablenum(SalesTable)));
> }
> else if (queryRun.changed(tablenum(SalesLine)))
> {
> element.send(queryrRun.get(tablenum(SalesLine)));
> }
> }
>
> Now, I want to know the way to addrange on each table without set "Yes" in
> "relations" properties. Because the value in field range is got from dialog
> report but not in relation fields.
>
> queryrun.query().dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable,SalesID)).value("00001");
>
> queryrun.query().dataSourceTable(tablenum(SalesLine)).addRange(fieldnum(SalesLine,ItemID)).value("Item1");
>
> can I addrange 2 tables in datasource with only 1 queryrun? How?
> Help me again, please.
> Thank you.
>
>
> "Luegisdorf" wrote:
>
> > Hi Elton
> >
> > Don't know exactly what you want to see, your phrase end "... or this tables
> > have no relations together." confuses me a little bit with the phrase middle
> > ".. usually filter values get from dialog". Between these both parts I can't
> > see nor relation too .. ;-)
> >
> > Here's an example how to link a main entity and an entity like salesTable
> > and salesLine:
> >
> > queryRun.query().dataSourceTable(tablenum(SalesLine)).relations(true);
> >
> > Was this what you want to see? If it's not, just let me know what else you
> > desire.
> >
> > Best regards
> > Patrick
> >
> > "elton" wrote:
> >
> > > Thanks you so much, Patrick.
> > > Apart from the relationship beetween tables I usually filter values get from
> > > dialog or this tables have no relation together .
> > > as:
> > >
> > > queryrun.query().dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable,SalesID)).value("00001");
> > >
> > >
> > > queryrun.query().dataSourceTable(tablenum(SalesLine)).addRange(fieldnum(SalesLine,ItemID)).value("Item1");
> > >
> > > "00001" and "Item1" get from dialog.
> > >
> > > Can you show me set this by code ?
> > > Thanks :)).
> > >
> > >