jeffersyuan
23rd February 2006, 15:24
Dear Sir,
Now I want to know how to do a report to display data in more than one company.
How to design it , thank you !
mark_h
23rd February 2006, 16:06
Are you planning to read the same tables from each company? If so you can always create 1 session and 1 report. Inside the session you would just have a routine to read the data, before calling the routine use the switch.to.company command to read from a different company. You can switch to each of the companies to report the data. You can search the board on the command. Also keep in mind that the user running the session will need to have authorization to each of the companies.
gguymer
23rd February 2006, 16:11
You can also make use of the psuedo-field available to every table called "_compnr". Here is a way you can use it:
select tiitm001.*
from tiitm001
where tiitm001._compnr in (100,200,300,400)
selectdo
endselect
Gilbert Guymer
Database Administrator
Lufkin Industries, Inc.
jeffersyuan
24th February 2006, 10:50
Hi, Mark & Gilbert Guymer
Yes, I want to display more than one company's data in one report , not need to switch to another company.
the report just like:
Company Total
company A 10000
company B 20000
And I had tried the way Gilbert Guymer said, but an error display while complie it .
Error SQL: SQLState 42I82: _compnr IN predicate is only allowed in parse mode 'ansi' (error 302)
So i don't know how to do it.
Thanks a lot.
Jeffers
monama
24th February 2006, 11:21
Hi,
try
select tiitm001.*
from tiitm001
where (tiitm001._compnr=:100 or tiitm001._compnr=:200)
selectdo
endselect
mark_h
24th February 2006, 15:35
And I had tried the way Gilbert Guymer said, but an error display while complie it .
Error SQL: SQLState 42I82: _compnr IN predicate is only allowed in parse mode 'ansi' (error 302)
Post your code someone might see what is wrong or maybe try the way monama suggested. Both I think should work.