[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

ReportRun, add range value

Jens Strandberg

11/25/2005 1:20:00 PM

Hello there,

Is there any way - from X++ - to add a range and value, when running a
report from code ?

Let's say that I wish to run "MyReport", which is just a plain report. I
would then like to add createdBy as range and curuserid() as range value.

How would I do that ?

Thanks in advance.

/Jens


1 Answer

Khue Trinh

11/26/2005 5:07:00 PM

0

Hi Jens,
Let say you try to print a report with Sales Orders. Datasource of your
report is SalesTable. Then override method fetch.
public boolean fetch(){
Query q = element.query();
QueryRun qr;
SalesTAble salesTable;
;
q.datasourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable,
Createdby)).value(curuserId());
qr = new QueryRun(q);
while(qr.next()){
salesTAble = qr.get(tablenum(salestable));
element.send(salesTable);
}
return true;
}
--
ERP Dev.


"Jens Strandberg" wrote:

> Hello there,
>
> Is there any way - from X++ - to add a range and value, when running a
> report from code ?
>
> Let's say that I wish to run "MyReport", which is just a plain report. I
> would then like to add createdBy as range and curuserid() as range value.
>
> How would I do that ?
>
> Thanks in advance.
>
> /Jens
>
>