Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Replicating a MS Access report in SSRS Expand / Collapse
Posted Tuesday, July 2, 2013 10:49 AM


Group: General Forum Members
Last Login: 2 days ago @ 6:46 AM
Points: 112, Visits: 1,482
I am trying to replicate a report a user uses in MS Access.

In MS Access a user can enter a Group Code and view the sales for that particular group over a 12 month period on one page as a print preview. Behind this report appears In print preview the sales of each particular shop within this group appear. So for instance there might be 8 shops within a Group.

In SQL Server reporting services i have created two queries where. One where the user enter a groupname and the consolidated sales of shops appear. In another report the user can enter the individual shops in a text box and the sales appear.

In SSRS I would like the user to be able to enter the group name and then after that report page i would like the user to be able to view the individual shops. So in effect, the user would click next and would be able to view shop sales. The shops within that Group.

I have two queries that actually do the above which are:

SELECT GroupCodes.GroupCode, Sales_TrackingSheets.Period, Sales_TrackingSheets.Year, SUM(Sales_TrackingSheets.Ethical) AS Ethical, SUM(Sales_TrackingSheets.Drug) AS Drug, SUM(Sales_TrackingSheets.Glaxo) AS Glaxo, SUM(Sales_TrackingSheets.Generic)
AS Generic, SUM(Sales_TrackingSheets.Surgical) AS Surgical, SUM(Sales_TrackingSheets.General) AS General, SUM(Sales_TrackingSheets.PI) AS PI, SUM(Sales_TrackingSheets.Misc) AS Misc, SUM(Sales_TrackingSheets.CaseSales) AS Totals,
GroupCustomers.Chain, GroupCodes.GroupName, SUM(Sales_TrackingSheets.Numark) AS Specials
FROM GroupCustomers INNER JOIN
GroupCodes ON GroupCustomers.Chain = GroupCodes.GroupCode INNER JOIN
Sales_TrackingSheets ON GroupCustomers.Account = Sales_TrackingSheets.Account
GROUP BY GroupCodes.GroupCode, Sales_TrackingSheets.Period, Sales_TrackingSheets.Year, GroupCustomers.Chain, GroupCodes.GroupName
HAVING (GroupCodes.GroupCode = @GroupCode)
ORDER BY Sales_TrackingSheets.Year, Sales_TrackingSheets.Period

SELECT Sales_TrackingSheets.Company, Sales_TrackingSheets.Depot, Sales_TrackingSheets.Account, Sales_TrackingSheets.Year, Sales_TrackingSheets.Period, Sales_TrackingSheets.Ethical, Sales_TrackingSheets.Glaxo, Sales_TrackingSheets.Drug, Sales_TrackingSheets.Generic, Sales_TrackingSheets.Surgical, Sales_TrackingSheets.General,
Sales_TrackingSheets.PI, Sales_TrackingSheets.Numark, Sales_TrackingSheets.Misc, Sales_TrackingSheets.CaseSales, GroupCustomers.Salesman, GroupCustomers.Phone, GroupCustomers.PostCode, BDMs.Name, GroupCustomers.CustomerName,
Depots.Depot AS DepotName, GroupCustomers.[Group], StatusDescription.StatusDescription, BDMs.SalesManNumber
FROM Sales_TrackingSheets INNER JOIN
GroupCustomers ON Sales_TrackingSheets.Account = GroupCustomers.Account INNER JOIN
BDMs ON GroupCustomers.Salesman = BDMs.SalesManNumber INNER JOIN
Depots ON Sales_TrackingSheets.Depot = Depots.DepotNo INNER JOIN
StatusDescription ON GroupCustomers.Status = StatusDescription.Status
WHERE GroupCustomers.Chain = @Chain
ORDER BY Sales_TrackingSheets.Account,Sales_TrackingSheets.Year, Sales_TrackingSheets.Period

I would like my report to first show the Group Sales on page 1 and then on page two, page three etc i would like the
report to show the respective shop sales.

Does anyone know how i can achieve this in SSRS?
Post #1469667
Posted Wednesday, July 3, 2013 4:37 AM


Group: General Forum Members
Last Login: 2 days ago @ 6:46 AM
Points: 112, Visits: 1,482
Any ideas anyone?
Post #1469978
Posted Monday, July 8, 2013 10:59 AM


Group: General Forum Members
Last Login: Yesterday @ 2:22 PM
Points: 481, Visits: 1,076
If I were you, I would start by making one dataset that has all the appropriate parameters and conditions on it, and then put it into Table 1 (Summary) and Table 2 (Details).

Your one dataset will have all the details, so you'll let SSRS do the summarizing in Table 1 via SUM and COUNT functions in the table, at least at first (it's slower, but simpler so you're just working with the one dataset). You can break them up into seperate datasets later if you so choose, depending on performancy.

In Table 2 just list all the values from the dataset you wish to display.

In the Properties for Table 1 you can add a page break after it, which will always cause Table 2 to start on a new page.

Play around with it, it sounds like you're most of the way there, but you just need to get familiar with SSRS. Good luck!

Post #1471287
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse