Sending SSRS report to each and every agent for their next day schedule every day at 4 pm - sql

I need a help in deciding how to get this task finish.
I created SSRS report. which is taking 4 parameters. They are as follows.
Date(By default is Today's Date)
Site (Different Office Location)
Service Provider's Name ( Agent's name who will do the service)
Type of service (Air conditioning repair, Furnace Repair,
Window Repair etc)
I am able to run the report via selecting each parameter since they all are single value parameters.
Now I want to email this report as an email attachment for each Provider(Agent) for their daily schedule(Next Day).
So I am hoping that I have to run the report and select each and every Site then each and every associated provider's name to the selected site and then each and every associated service to the selected providers. Here I don't have to select the day since Date will be by default Tomorrow's date which report will take as parameter.
How can I do this via some kind of SQL or SSRS tool or is there any functionality that BIDS has?
Please let me know.
Thanks.

This can be done with a data-driven subscription. To configure this, start by going to your Report Manager or SharePoint, wherever you're hosting the report. Next, you'll need to write a small query that returns the parameters you want to run the report with. In other words, it should return one row for each version of the report you want to send out. Next, it will ask you to fill out your email settings. You can set fields like the "To" address and your parameters to be populated by a column from your query. The last step is to set up the scheduling.

Related

SSRS 2008 not passing multiple values to report run from button click

I have a simple query that I am running within a report on SSRS 2008, this query simply takes a date from the user of the report and a user code which is a simple md5 hashed code based on their local user id.
and this filters down the report to a subset of data relative to the period and the user selected. This report takes the below parameters:
select * from
ops
where [Late Flag] = 'Late Start'
and [Planned Session Start Time] >= #start
and [Planned Session Start Time] < #end
and [Hashed Surgeon 1 Code] IN (#UserCode)
The problem starts to appear when this data-set is filtered down using these parameters and then the user wishes to see the charts, which again is a simple button click, the action of which runs another report showing the charts for the same period.
I am passing the session ID's of all of the sessions relating to the user as a parameter to the charts report. The charts report is only based on the below:
select * from
ops
where [Session ID] in (#SessionID)
I expect to see multiple sessions here if a user has more than one in the period. but the report is only displaying one of these even though I have allow multiple values checked and I am using an IN as can be seen above.
Question is, has anyone had this problem before if so what can I do about it, I need to see all sessions in the same period selected for that particular user. It is very frustrating I have thought of everything I can am I missing something?
After reviewing the suggested approaches kindly provided by #Lukasz Szozda I realised that the best approach for me in this situation would be to create a max and min of each session date that could be passed to the charts report.
This removed the need to parameterise the IN statement. Obviously not a solution for everyone where passing multi values to multi values is required but worked nicely for me.
I must also state that this will only work for passing a single userCode in my setup, if I wanted to see more than one UserCode activity for the same period then I would need to follow the suggested approach and commit to parameterising the IN statement.

Is there any way let SSRS show the result that NOT included in the last run?

For example:
I preview the report now at 3:00 pm, I want SSRS to show the result that does not show up when I previewed at 2:00pm(last run), and only those records. Thanks
If your dataset is stored procedure based AND your data is time based you could save the last report run time every time it is called in a table. You could then use that value to determine when to start for the next report run. You may need to take into account the user running the report if more than one person will be running it and store a separate last run time for each user.

Database mining, Auto Graph and email at certain time of the day

I have some automated machines running a Pasteurization process, sensors register values such as Temperature, time, pressure etc...
Our main control software does offers us a historic graph for such values, however its not possible to mail them. The software is able to log all the data into an Microsoft Access/ SQL database. For the company, our days start at 6am so a 24/hr period is meant to start again at 6 everyday.
Now the question:
Is there a way to mine the database (can choose either) to graph all the values from 6am last day to 6am current day (X,Y plot) Automatically in Excel, and have it Automatically sent to some mail recipients EVERY day at 6 AM?
If so, how can I do this?
You could get Excel to query the Access database (if the email recipients are in your LAN), so when you refresh the query (or you can get it do refresh automatically when you open the spreadsheet) it fetches the relevant information for the day only. So no emails would be necessary, as you always use the same spreadsheet.
To do this, first open your access database and create a view (query) to fetch the data you need (use this as a reference to get today's or yesterday's data: https://support.office.com/en-us/article/Examples-of-using-dates-as-criteria-in-Access-queries-aea83b3b-46eb-43dd-8689-5fc961f21762).
Then follow this tutorial to fetch the data from your view into excel: http://www.excel-easy.com/examples/import-access-data.html

SSRS Data-Driven Subscription [based on static Subscription table] Not Picking Up Changes Made to Subscription Table

I have a .RDL report which I designed in BIDS and have deployed to my report server. The report asks for three parameters before viewing report: Year, Month and Customer ID. The report works great and does exactly what it is supposed to.
While I used to run each report individually because there were 2-3 customers, now there are 30+ customers who receive the report, so I wanted to switch to a more automated fulfillment method to get the reports generated. After doing some research it appears that a using Report Manager to create a "Data Driven Subscription" (DDS) using the "Windows File Share" option gives me the capabilities I need.
As part of creating the DDS, I created a table called [Subscription] which is a table containing one row for each customer receiving the report and has the following columns:
Year
Month
CustomerID
FileName
FileLocation
Overwrite
Format
...so through using the DDS Wizard in Report Manager, I was able to successfully set up a Data Driven Subscription (which is linked to various columns in the [Subscription] table) which creates a new report for each customer in the [Subscription] table, saves [and overwrites, if necessary] it in a location of my choosing as a PDF (specified in [Subscription].[FileLocation], or the FileLocation column of my table for each row), and runs every minute (I plan on changing frequency to once a week, eventually).
This works flawlessly, giving me a new set of 30 reports in the directory of my choosing, with each report having a name I assigned in the FileName column of my table. Exactly what I was looking for.
HERE'S THE PROBLEM: When I update the FileLocation or FileName (or anything, really) in the [Subscription] table - it doesn't pick up the changes right away. Sometimes it doesn't even pick it up at all (for example I updated the [ReportName] column for one customer from Report_711622 to SpecialReport_711622, so that the output file for that customer should be named SpecialReport_711622 while all of the other reports should be called Report_XXXXX [no Special prefix]. But the file name of report for Customer 711622 remains the same!
It's almost like the job only see's what it needs to do once a day, and then does not go back and reference the [Subscription] table until I leave for the night, then when I come back in the morning it picks up the change.
Since I am about to scale this process out to a large customer-base using a different report, I need to be able to make edits to the [Subscription] table and have them get picked up by the Data Driven Subscription immediately (and if not immediately, at least a fixed interval of time that I can adjust, so that I can know 100% when the change will get picked up).
Does anyone know what's causing my lag? How do I change it so that updates to the Subscription table get picked up regularly? I'm also having issues with creating new DDS on other reports (following the exact process outlined above) - I've created the subscriptions, for every minute, and it says they are running and the number of outputs match the number of customers with 0 errors, but there are no files in the drive I specified (or anywhere else I've looked, for that matter).
Any help would be greatly appreciated!
I think the answer lies in the mechanism SSRS uses. There are a few places "lag" can occur.
The subscription is in fact an SQL Agent job which creates a record in the Event table. This table is a queue that SSRS checks to do scheduled tasks.
There is a small amount of time between the moment the subscription creates the Event record and the moment SQL reads it and starts creating the dataset for your DDS. The creation of the DDS dataset takes some time, too. In this time, the subscription will be in the Pending state. If you change anything in the data during this time, The subscription will still use the old data as report parameters. So obviously you will not notice your change until the next scheduled run.
Which brings me to the following: if a subscription is still being run and the next schedule kicks in (chances are, because yours runs every minute), the engine will not execute it, but wait for the next subscription schedule, and so on. So that's another possibility of lag - and cause of missing reports for a certain schedule minute. The subscription processes reports sequentially, one row from your DDS recordset at a time. Again, this takes some time. You can also see that in the subscription window when it says: # of # processed.
I suggest you look at the Event table in the database ReportServer during an execution. Also the ExecutionHistory views (there are 3) may be interesting. A scheduled run shows up as a RequestType = 1 and generates one record for each report. You can see the exact timing and parameters of each report that is run in the subscription. You may be able to extract the data you need to resolve your other issues.
EDIT: Here is a more elaborate guide to DDS data and events
http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx
http://blogs.msdn.com/b/deanka/archive/2010/02/16/troubleshooting-subscriptions-part-ii-using-the-report-services-trace-log-file.aspx
Could this "Double-Hop" problem be the source of my issues? I'm so stuck on this one!
The Double-Hop Problem - MSDN Knowledgecast

simple average calculation in Access XP report

i have a database used at work for evaluating calls, the database is somewhat dated and originally created on Access XP. Once evaluated these calls are given a score out of 5 which is entered along with other data (such as date, employee name, etc) on a form. I have the reports set up so they generate when you enter the employee name and then the start of a date period and the end of a date period, the report will then generate and show the entries made between those 2 dates. i am trying to include a section on the report which shows an average of the call score for the employee for the period chosen. I understand this may be pretty simple but i'm struggling! cheers, Kris
If you want to work out group calculations on reports, you can either put them in the group header/footer, or report header/footer (for calculations over the whole report).
In this case, placing a textbox with something like =AVG([CallScore]) as the control source in the Report Footer should work.
This page should explain more about using aggregate functions in reports: http://office.microsoft.com/en-gb/access-help/summing-in-reports-HA001122444.aspx