Reporting Services with multiple companies

kfuglsang
Member Posts: 26
Hi all,
I'm doing a few experiments with Reporting Services. I've stumbled upon a question regarding multiple companies in one database.
How would I, dynamically, create a SELECT statement that would give me e.g. all records from T79 "Company Information"?
Something like:
SELECT * FROM [*$Company Information]
Thanks in advance.
Best regards
Kenneth Fuglsang
Denmark
I'm doing a few experiments with Reporting Services. I've stumbled upon a question regarding multiple companies in one database.
How would I, dynamically, create a SELECT statement that would give me e.g. all records from T79 "Company Information"?
Something like:
SELECT * FROM [*$Company Information]
Thanks in advance.
Best regards
Kenneth Fuglsang
Denmark
0
Comments
-
Create a View that combines (outer Join) the tables in each company and adds a new column Company Name to the column.
That way when you run the query you can set a where clause
Where CompanyName = UserFilter0 -
Hm yeah, I had that thought. I was hoping for something easier, as I have quite a lot of companies spread throughout several databases.0
-
Great Waldo. I think I should be able to get something working with the concept described on your blog \:D/0
-
Will do. Hope I'll get some time to give it a try today.0
-
-
I managed to get a test working with a stored procedure that on-the-fly created a view for my tables.
The view consisted of a SELECT string with UNION ALL in it.0 -
kfuglsang wrote:I managed to get a test working with a stored procedure that on-the-fly created a view for my tables.
The view consisted of a SELECT string with UNION ALL in it.
That's indeed the main idea that I implemented... .
But I didn't create a view to just do a SELECT on it. My view was necessary as some kind of company-related distinct.
I just build my SELECT with UNION in my Stored Procedure, and execute that SQLString at the end of the SP.0 -
Can you provide a sample SQL statement that might communicate specifically what you did?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