Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Consolidating sub-report to single grouped report?

Author  Topic 

misscrf
Starting Member

10 Posts

Posted - 2009-03-19 : 12:43:10
I have learned from other posts on the web that using sub-reports is not best practices. I am a complete newbie. I watched a tutorial I found on making a report. I made one, and a subreport that ties in the data with a variable. I also set up a report server. Among the many things I am trying to accomplish, one is to use best practices and get this report together as 1 single report, rather than a report with a subreport.

Trying to make all this one datasource is hard! I have 3 tables. This is a list of files in one table called tblDoc. It ties the Custodian field to a custodian table with a custodian ID, and a third table for sessions, tying the session id.

What I want in the output of the report is to have each session (grouping on the created date/time of the session) then each custodian within that session, and a count off all the documents by doc extension. So here are the table layouts, specifying the fields used:

tblEDSessions
ID
Created - date/time
ItemCount - number
ItemTotal - number
RecordsWritten - number
Size - number

tblCustodians
ID
Name - Text name of custodian

tblDoc
ID
CustodianID
SessionID
DocExt
(otherStuff)

So I my sql query shows this:
SELECT tblEDSessions.Created, tblEDSessions.ItemCount, tblEDSessions.ItemTotal, tblEDSessions.RecordsWritten, tblEDSessions.Size, tblCustodians.Name AS Custodian, tblDoc.DocExt, tblDoc.ID
FROM (tblDoc LEFT JOIN tblCustodians ON tblDoc.CustodianID = tblCustodians.ID) LEFT JOIN tblEDSessions ON tblDoc.EDSessionID = tblEDSessions.ID;

The session counts and numbers would list at the top, then by custodian, count the ID from tblDoc by DocExt. Make sense? I have this all looking the way I want when I use a sub-report, but in trying to construct one report on one table, I am getting totally lost. I am looking around for articles on grouping and such to see what I can find. Then and I might try to make an access report and upload that to see if that will show me how I need to set it up.

Can anyone point me in the right direction as to how I group these right, so that I can get the layout I am looking for? I have it in my solution that uses a summary report and a detail report, but I am getting so stuck trying to make this in 1 report. :-(

Any guidance is greatly appreciated. :-)

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-19 : 13:19:42
can you post your final report structure?
Go to Top of Page

misscrf
Starting Member

10 Posts

Posted - 2009-03-19 : 13:27:41
how do you mean? A picture? the layout or the preview? I'm not sure what you mean.

It would be kind of like this:

Created
1/1/09
Custodian
John Doe
File Type / File Count
Doc / 25
Xls / 20
Ppt/ 15
John Doe 60 Docs total
Custodian
Jane Smith
File Type / File Count
html / 35
vsd / 22
msg / 10
Jane Smith 67 Docs total
Session / Total Docs
1/1/09 / 127

Thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-19 : 14:04:37
yup... a picture would be fine. put it in some shared server and post the path
Go to Top of Page

misscrf
Starting Member

10 Posts

Posted - 2009-03-19 : 15:12:52
The layout : http://www.geocities.com/misscrf/reportLayout.bmp
The preview of the results (but wrong information): http://www.geocities.com/misscrf/reportpreviewresultswrong.JPG
The results by custodian for the session on 3/17 should be as follows:
Custodian1 34,681
Custodian2 622
Custodian3 112,490
Custodian4 38,626
Custodian5 31,828

I also have my query limited to the top 40,000 I did that because it takes forever to render the whole report just for testing. There are over 1,000,000 records to group and total in this dataset.

Thanks!

Thanks!
Go to Top of Page
   

- Advertisement -