Display Report For All Companies

Hii,

i want to display the report from Purchase header in which i get the data from All Companies.Whatever Companies from we login…i have to display report from All the companies.

kindly Give me the Suggestion for that.

Check CHANGECOMPANY function available in NAV.

Hi [mention:d37e849211a549bdb70a00b394567ad1:e9ed411860ed4f2ba0265705b8793d05] ,

You can create a new table for storing data before running report which is a save as of purchase header, with a additional field -

Company Name.
The New field will also be part of primary key. So the New Key will be - Doc Type, Doc No and Company Name.

Once done - you can create a Report with source table as the new table and with property Temporary Set to TRUE.

OnPreReport - Using Code with Transferfields & ChangeCompany insert data in new table.

Then your report will be easy for development.

But i don’t know how to use Change Company Function in report…

Take an example of two companies. Suppose you are in company 1 and you need to insert the item of company 2 in one table called “My Temp Item” so you need to take data Item of “ITEM” table and need to write the below mentioned code-

MytempItem.CHANGECOMPANY(‘Company 2’);

MytempItem.INIT;
MytempItem.TRANSFERFIELD(Item);
MytempItem.INSERT;

Hope this helps!

Use changecompany propery to check and read data .
Take a look at this link
msdn.microsoft.com/…/dd338929(v=nav.90).aspx

Ok. Thanks for your suggetion…i will try with this

hii,
i tried with that code but i can’t get the different data…
i doing the code on onaftergetgetrecord of purchase header

IF Company.FINDSET THEN
REPEAT
purchase header .CHANGECOMPANY(Company.Name);
UNTIL Company.NEXT = 0;

but still i get only one company data…