alexlz
alexlz

Reputation: 666

Can't set data to a queryRun object

I'm creating a report and have problem with using this line of code:

this.queryRun().setCursor(tmpTable);

tempTable filled with records before and I just want to pass the data to the queryRun object. But I got a runtime error that an argument have a wrong type.

What am I doing wrong? Is there any other way to copy data from table to queryRun?

Upvotes: 0

Views: 1534

Answers (1)

alexlz
alexlz

Reputation: 666

Ehh, my bad. The datasource of Query in the Report was empty. That's why I got an error. But That's really wierd that error is not some kind of NullReference but just wrong argument type which is not clear.

So solution is just init the queryRun by yourself:

Query                   q;
QueryRun                qr;

q = new Query();
q.addDataSource(TableNum(TempTable));

qr = new QueryRun(q);
qr.setCursor(tempTable); // Works fine!

Upvotes: 1

Related Questions