how to get all users info in different companies in a report

dilla
Member Posts: 31
Hi All,
I have a requirement to get all ADusers information in a database from all companies in the same database.
Now I am getting ADusers information from the current company from which I'm running a customozed report.
How can I get all ADusers iinformation in all companies in a single report.(all users information from all companies)
how can I use CHANGECOMPANY function in report.
Please help me.
Thanks in advance.
Regards,
Dilla
I have a requirement to get all ADusers information in a database from all companies in the same database.
Now I am getting ADusers information from the current company from which I'm running a customozed report.
How can I get all ADusers iinformation in all companies in a single report.(all users information from all companies)
how can I use CHANGECOMPANY function in report.
Please help me.
Thanks in advance.
Regards,
Dilla
0
Comments
-
Here is what I would do (and I am unfamiliar with the ADUsers functionality, but I will assume it is a custom table).
//Loop through all of the companies, in each one add the ADUsers data to a temporary record. This is on the PreDataItem of the Integer dataitem.
Company.RESET;
IF Company.FINDFIRST THEN REPEAT
ADUsers.RESET:
ADUsers.CHANGECOMPANY(Company.Name);
//if there are filters to be applied through a request form apply them here
if ADUsers.FINDFIRST THEN REPEAT
tmpADUsers := ADUsers;
tmpADUsers.INSERT;
UNTIL ADUsers.NEXT = 0;
UNTIL Company.NEXT = 0;
//One dataitem in the report
OnPreDataItem (after the above)
tmpADUsers.RESET;
SETRANGE(Number,1,tmpADUsers.COUNT);
bfirst := TRUE;
OnAfterGetRecord
IF bfirst THEN BEGIN
bfirst := FALSE;
tmpADUsers.FINDFIRST;
END ELSE
tmpADUsers.NEXT;
//and on the sections, just have the data display using the tmpADUsers variable
//NOTE - you may have to create a copy of the ADUsers table, and add a Company field to it which becomes part of the primay key. This table does not need to be in the license range. Use this record as the temporary record. This would ensure that if the same user is in more than one company that you can insert it. This requires a change in the code that inserts the temporary record.
tmpADUsers.TRANSFERFIELDS(ADUsers);
tmpADUsers.Company := Company.Name;
tmpADUsers.INSERT;
Hope this helps.
-a0 -
If you mean Active Directory users, that that table is Company independent. It means that you will see same informations for all companies.0
-
HI Awarn,
Thank you for your reply,
I am getting data from "Change Log Entry" table and I have one customized table called "Power Users".now I have to generate a report from all all companies in database.
In "Power Users" table users may differ for each company. Now I am getting "power users" cheanges in report but I am getting only current company "Power users" changes.
how can I get all "Power Users" changes from all companies in a single report.
Kindly help me.
Thanks in advance.
Regards,
Dilla0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions