Gathering info from several companys

rvalfreixo
Member Posts: 9
How can i make a report that show me, for example, the sales to a specific client from all companys on the database? I thin changecompany ca do the trick but i con't know how to use it
Thank you in advance
Vx
Thank you in advance
Vx
0
Comments
-
This is what I have for my GLOBAL reports (we have 165 companies in our db)
OnPreDataItem()
RecCount := Company.COUNT;
Table_Name := COPYSTR(Master.TABLENAME,1,30);
ReportDescription := COPYSTR(Table_Name + ' - ' +
'YourReportDescription',1,60);
Window.OPEN('#3############################################################\'+
'Processing #4################ Record#1############ @');
Window.UPDATE(3,ReportDescription);
Window.UPDATE(4,Table_Name);
OnAfterGetRecord()
RecordNo := RecordNo + 1;
Window.UPDATE(1,Company.Name);
Window.UPDATE(2,ROUND(RecordNo/RecCount * 10000,1));
YourTable.CHANGECOMPANY(Company.Name);
etc....
Good Luck!Best regards,
Denis Petrov.0 -
Can anyone help me?
I've duplicated Cronus database so i have two companys now. I need to list all the costumers from both companys on one single report. Can anyone give me a clue on how to do this please?
Vx0 -
It's not that hard.
Best thing to do it creating a temp record of table Customer. Then build a integer loop (or two) that fills this table from then customer table from both companies. Loop the integer loop as many times as there are customers in both tables. This you could do by summing 2 count statements. But nicer is to break the dataitem if no records exists to progress. (You could use two customer dataitems, but i think it's nicer to use integer dataitem in this case.)
Below a sample in short, there are missing things as you can see, but you have to do the thinking here.
OnPreDataItem()
CangeCompany(Companyname);
OnAfterGetRecord()
if number = 1 then
cust.find('-')
else
cust.next;
TempCust := Cust;
TempCust.insert;
If you will not get an double key conflict, You will have all customer of both companies in one table.
NOTE! If you really want to make something that lasts for ever, you will have to loop your companies. This way you don't have to return to your customer when They add an extra company.
Loop this temp table with an integer loop.
This is an explaintion in short, I know... You have to do the rest.
Good luck!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
The problem is that afterwards i can't know wich costumer is from wich company. So i tryed the following:
1. I've created a table with the fields i need plus one stating the company from wich the costumer is from.
2. On a codeunit, i've dreated a temp table from my costum table sub-type.
3. Then, looped trough my companys and populated the table.
4. Finaly called a report with report.runmodal, passing as argument the temprecord.
It gives me the duplicated key erroris there a obviuos mistake?
Vx0 -
Don't go creating new tables for this. Just misuse some other fields for this.
Every customer you insert in this "combined" table has to get a new No. I already warned you for a double key error in my previous post. Save the customer no. in another field, same for you company name.
It's not that nice, but who cares!?
Or you COULD create a new table. Make a table where you have company name and number in the key, then every record should be uniq. But really, I think it's a waste of a perfectly good empty table number."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Nice, i've made what i needed and i guess this problem's solved. I've made a report that gathers the info and makes the calculation on the fly.. Nice
But one thing i couldn't understand. How can i make a temporary table? When i create a record temporary it's only a record right? not a table right?
Vx0 -
Yes. A temporary table is fact a temporary record variable. I (we) just call it a temporary table."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Hi
I hope this helps. Create a report having two dataitems.
1st DataItem : Company (ID: 2000000006)
2nd DataItem : Customer (ID: 18)
2nd DataItem is indented
OnPreDataItem of Customer write following
Customer.ChangeCompany( Company.name );
In Sections
Body of company dataitem print Name of company
Body of Customer - desired fields from customer table
Thats It !!!!!
All the Best______Doubt is the father of Invension_______0 -
jyotsnas,
That is nice... But if you do it like that you are not able to sort your customers by e.g. Search Name.
You will get 2 seprate sections for your customers from different companies."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Hi
The solution that I have given will generate a report having layout like this
Company Name
Customer Details for the company
Company Name
Customer Details for the company
I am not able to able to understand the doubt that has been raised. You can sort the customers by setting DataItemTableView property. I have tested it and works fine.
Jyotsna______Doubt is the father of Invension_______0 -
yes, it is working now and i thank you for your help
i was complicatig more that i had to
Thank you again
Vx0 -
jyotsnas,
What I meant was the following output:
10000 Abraham (Company A)
86280 Bernard (Company
20000 Derk (Company A)"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Hi Eromin
Yes, you are right. If you want all - say employees from all the companies to be sorted in a particular order, then usage of a temporary table is necessary. But if you want all records classified by company, its not necessary.
Regards
Jyotsna______Doubt is the father of Invension_______0
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