July 2, 2013 at 10:49 am
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?
July 3, 2013 at 4:37 am
Any ideas anyone?
July 8, 2013 at 10:59 am
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!
Cheers,
EJM
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply