SSRS Subscription Paramter for Second dataset not updating - reporting-services

I'm running into an issue with an SSRS subscription report that I built. Basically I have 2 datasets and 1 parameter that gets fed to both of them called #ReportDate.
#ReportDate has a default value =Today(). When the report runs every morning and gets emailed out by the subscription, dataset1 always gets updated information with today's date and works fine, however dataset2 always returns data for the previous date that the report successfully ran. So it's like the parameter isn't feeding the updated value through to that dataset, which is odd because both datasets use the same parameter. When I go to troubleshoot the problem and run the report dataset2 will then come back with data for todays date so I can't replicate the issue. Am I doing something wrong? I'm using SSRS 2008 r2. Thanks for your help.
Edit: Found the problem. Both datasets shared the same datasource which means the datasets run in parallel, not in the order which I see in report builder. Dataset2's data is dependent on a table which get's populated during the execution of dataset1. Dataset2 was finishing before dataset1, thus it wasn't picking up current days data. I updated a setting on the datasource to make it so that the datasets run 1 at a time in the order in which they're shown in report builder. The setting I changed was checking a check box in the datasource properties called "Use single transaction when processing the queries".

Found the problem. Both datasets shared the same datasource which means the datasets run in parallel, not in the order which I see in report builder. Dataset2's data is dependent on a table which get's populated during the execution of dataset1. Dataset2 was finishing before dataset1, thus it wasn't picking up current days data. I updated a setting on the datasource to make it so that the datasets run 1 at a time in the order in which they're shown in report builder. The setting I changed was checking a check box in the datasource properties called "Use single transaction when processing the queries".
Updating DataSource

Related

Using User!UserID in SSRS to access data in SSAS Cube

I am running SQL 2012 and I have a SSAS multidimensional cube that holds measures for our retail business. I have created an SSRS report that pulls the data from the SSAS cube. I want the user to be able to run the report and only pass the users specific store revenue, customer count, ect, on the SSRS report that they are viewing.
I have created a parameter from the cube. Under the report parameter that was created from the cube I put in under default values, specific values, this expression for the value ="[DimUserTable].[Username].[UserID].&[" + User!UserID + "]", the report will not run. It gives the error;
For more information about this error navigate to the report server on the local server machine, or enable remote errors
Query execution failed for dataset 'Revenue'. (rsErrorExecutingCommand)
Does anyone have any idea how I can accomplish getting only the users store information to show on the report they are viewing?
You only need to pass the user id to the parameter.. your query should take care of the filtering using the parameter. Something like
where [DimUserTable].[Username] = #userid
I would use the following as the default value for the userid parameter
=User!UserID.Substring(User!UserID.LastIndexOf("\")+1)
Of course, this depends on what your cube holds for userid value. If it does NOT include the domain or machine name.. use the above.. else just use =user!userid

Out of memory exception Error when generating a SSRS report

I'm creating an SSRS report using report builder that generated large amount of data based on from to dates parameters.
If I run the report up to 3 months the report works fine, however when generating the report for a longer period generating larger amount of data an system out of memory exception error is thrown.
Note that if I run the query for the same period but from inside the data set it will be generated in seconds.
Also when generating the report from
http://servername/Reports/Pages/Folder.aspx it will keep loading without generating any data, I've tried to modify the rsreportserver.config file with the following with no success
<MemorySafetyMargin>80</MemorySafetyMargin>
<MemoryThreshold>90</MemoryThreshold>
<WorkingSetMaximum>4000000</WorkingSetMaximum>
<WorkingSetMinimum>2400000</WorkingSetMinimum>
it has been a while like 11 month, but did you check The timeout in your dataset properties? Timeoutsetting

Taking snapshots of reports

I've created a snapshot of my report in order to improve the performance. However, it appears that it's only using the snapshot on the default values for the report. If I change the values, it appears that it's calling the procedure again (?) or rendering the report again.
The report has a dataset which calls a procedure (no input parameters), which can be filtered using the input parameters.
The snapshot has been created using the Snapshot Options and Processing Options. Any ideas what I need to do in order for the report to use the snapshot all the time?
That is basically how snapshots work - they are a point-in-time copy of the report results taken with the default parameter values. If you change the parameters on the report then SSRS will not use the snapshot because the report results could be different.
It sounds like your report is always returning all data from the procedure, which is then filtered at report rendering time based on the parameter values. This is not a good design and is probably the reason for your report performance problems. Try modifying the procedure to accept parameters and passing these from the report - this way the procedure only returns as much data as is necessary to display in the report and the report server does not have to do filtering when rendering the report.

SSRS: Caching a shared Oracle Dataset with date parameter

I am using SSRS (2008R2) to create a large report against an Oracle
database.
Because of the size of the report I wanted to cache the shared
dataset overnight.
The dataset has a single parameter which should default to today's
date but be changeable in the report (although this would trigger
another cache).
I have struggled with this for 3 days and wanted to document how I got it to work, as well as get feedback on my approach.
1. Oracle Datasource:
I found that passing parameters to the dataset only worked well for me using the native Oracle drivers, not the OLE DB drivers.
2. Shared Dataset:
I was never able to get SSRS to pass a date parameter to Oracle. In my Oracle query I therefore used the conversion TO_DATE(:EffectiveDate,'YYYY-MM-DD"T"HH24:MI:SS') (you'll see why I had to use ISO 8601 format later).
When adding the variable :EffectiveDate to my SQL query a parameter was automatically added to by shared dataset. This initially caused the Oracle error ORA-01008: not all variables bound. This was resolved by deleting the dataset parameter and then clicking "refresh fields" on the dataset query screen to re-create it. The only difference apparently being that now the parameter name has a colon.
I have set the dataset parameter up as shown below in the screenshot:
The parameter is of type "text" and defaults to today at midnight in ISO 8601 format (=Format(Today(),"yyyy-MM-dd\T\0\0:\0\0:\0\0"))
3. Report Dataset:
The Report Dataset uses the Shared Dataset above and also has a dataset parameter. In this case I want the report dataset parameter to take a date from a report parameter but pass a string to the shared dataset parameter as below:
The Dataset Parameter is set to the value =Format(Parameters!EffectiveDate.Value,"yyyy-MM-dd\T\0\0:\0\0:\0\0")
4. Report Parameter:
The Report Parameter is set to "date" type as below with a default of =Today():
5. Shared Dataset Caching:
First I set the Shared Dataset to use cached data (on the report server via your browser):
Then I set up a "Cache Refresh Plan":
The Cache Refresh Plan seems very picky about Parameter format and it was this last step that only seems to work if passing dates as ISO 8601 compliant strings.
6. Notes:
:EffectiveDate is the name of my Oracle string bind variable and EffectiveDate is the name of my Report parameter. Change your code appropriately.
I was only interested in the date (i.e. not the time). If you need time as well you may need to make some changes.
In order to let the end user know how old the data was, I added an extra column ,SYSDATE AS DATA_AGE to my SQL Query. I was then able to reference the age of the data in my report header with First(Fields!Report_Date.Value, "<report_dataset_name")
I am able to create snapshots of the report but all of the prompts are greyed out, even though all the other prompts only effect report filtering.
To have different prompt defaults in my snapshots I used the test IsNothing(User!UserID). I'd love to know if there was a better way.
My example isn't necessarily in the order in which I set things up (i.e. I reference the Report Parameter before showing its setup).

How do I generate daily reports in Microsoft Reporting Services 2008 R2?

I have the database in sql 2008. In this database daily some data is being inserted. I have to generate the report automatically without giving date i.e today is 10-10-2012. I have to view the report of 10-10-2012 on 11-10-2012 daily. It should happen automatically i.e Previous date entry should generate on current date without changing dates daily. Whether it is possible in SSRS report or we have to change in stored procedures please give the solution.
Yes, it is possible. I just did it.
Two options:
1 Specify the report parameters (dates) and give them default parameters. (Use a formula - hint, look for DateAdd in the formula editor)
2 set the query using DateAdd in SQL
When you've got the report, create a subscription.
How to do all this is covered in the documentation, available from Help on the SSRS website, or by pushing F1 in the Report builder.