SSRS Report date parameter values using SSAS Cube as datasource - Grey out unavailable values - reporting-services

i m building an SSRS report using SSAS cube as the data source. The report contains shared data-sets which provide the required data. below is the set up.
Sql server version : Sql server 2008R2
Report builder 3.0
I have, Report A, powered by Dataset D, running on Cube C. The dataset has 3 parameters out of which one of them is a date parameter- P1. I have it set up such that on the report there is another parameter - P2 which contains the type as Date ( to ensure the user is exposed to a date picker), the input from this, P2 is then manipulated to required format before fed into the dataset parameter P1 (hidden). I have two questions regarding this parameter.
Currently, when the user pick's a date (P2) which has no values, the report errors out as it doesn't find that corresponding member on the cube. Can it be made such that if the member doesn't exists, a simple error message like "date not found" pops up as opposed to report failing?
Secondly, can i manipulate the date picker (P2) exposed to the user such that the unavailable dates are grey'ed out on the date parameter (P2)?
Please let me know if there is any more info required on each of the questions.
Thanks

Related

In SSRS, a Date Time parameter on Preview is not matching the deployed report

In SSRS, a Date Time parameter on Preview is not matching the deployed report. Is this something someone else has encountered? The RDL code is identical. Is it the fact that, sometimes, a local preview is just a simulation of functionality? Is it because the display in preview sometimes uses cached data?
I have a SSRS report that, when I preview it in Visual Studio locally, the date shows as 2/10/2019 but when the RDL code is deployed on the server, the date shows as 2/7/2019.
The date time variable is based on a parameter on the report, called rundate, and it has a Default Value of 2/10/2019.
So I think the same thing should happen on the Report Server that happens locally in preview mode.
The report has four datasets and, as a test, I have set each four to have the SQL line that sets the rundate value like so:
SET #rundate = '2019-02-10'
but on the report server, when I load the report, it throws this error:
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
It is in a cascading tabbed error message that looks like this:
An error occurred during client rendering.
An error has occurred during report processing.
Query execution failed for dataset 'ThirdDataset.
Must declare the scalar variable "#rundate". Must declare the scalar variable "#rundate".
So, why does it run locally and not on the server? The "ThirdDataset" is a false name I have given here. The actual name is redacted. But, I have noticed that this would be the first dataset run if they are run alphabetically. So this leads me to the question: why doesn't the report recognize this as a parameter and why does it complain that it is not declared?
============
UPDATE:
I have set the rundate to be part of a data-driven subscription in a report like so:
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Which is two days ago. Since it is 2/11/2019 today, the rundate parameter passed to the SSRS report on the server should be 2/9/2019.
For fun, to test this out, I set the Default Value rundate parameter to be 8/8/2018 in hopes that the data-driven report would set it properly.
In preview mode locally on Visual Studio, a textbox that set to show the [#rundate] Expression shows 8/8/2018 which is what I would expect, but the Datasets are designed to run off this parameter. Since there is nothing that the sql should retrieve from the database that is that old, the graphs and charts in preview mode should turn up completely empty. Why do they show data?!
Next, let's see what the emailed subscription alert says. It had the date of 2/11/2019 12:00:00 AM. If the data-driven subscription ran like it shouold ahve run, it should of had the date of 2/9/2019 from
SELECT convert (date, DATEADD (DAY, -2 , SYSDATETIME())) as rundate
Why did this not work?
On the SSRS server, the RDL file has a parameter default value of 2/11/2019 12:00:00 AM but why did the report get THIS default value? What am I doing wrong and how can I fix this?
As a test, I set this default date/time parameter to 12:12:34 for its time to see what would happen. It reveiled that, yes, this is the date time stamp that is being sent to the report. So I unchecked the "Has Default" box
Then, I noticed in the Step 5 of the data-driven subscription I could not advance to Next > without making a small change:
So, what should happen? Will it show the wacky 8/8/2018 value? Will it show the date from two days ago?
Default values for report parameters are deployed only once to the report server, and then they keep their default value after subsequent deployments. This is so that default parameter values used in development don't overwrite the desired parameter defaults on the production server.
So it looks like when the report was first deployed, #rundate had the default value 2/7/2019 but has since been changed on the local report to 2/10/2019. Go into your report server, find the report and go into the Report Parameters section to edit the parameters and change the default value to what you want it to be (deleting the report from the report server and re-deploying it with the updated parameter will have the same effect, but note that the parameter will maintain that default value going forwards). Alternatively, set the report parameter using an expression so that it is continually up to date.
Regarding updating your parameter value in the Sql statement using the SET statement, you can't actually do it that way - you need to set it in the report's parameter list so that SSRS can set the parameter value. Consequently, your databse server is complaining that you are trying to set the value of a local variable that hasn't been defined in your Sql statement, and thus throws an error message.
So you need to set up the Report Parameters in the report parameters section in the report designer. Your Sql can then reference your parameters like so:
SELECT * FROM MyTable WHERE SomeDate >= #rundate
The parameters normally get mapped into your dataset automatically but you might want to check this by going into the Parameters settings on your dataset to make sure. If the parameter doesn't exist there, set it up.
After lengthy trial and error, I found that the answer was to NOT have the parameter set to have a default value on the SSRS Report Server.

SSRS 2012: Cannot add multi value parameter '?' for dataset XYZ because it is not supported by the data extension

Scenario: I am working with a Firebird database (somewhat similar to MySQL) connected to Microsoft SSRS 2012 via ODBC connection manager.
I have a huge stored procedure (which I am not supposed to modify at all) given by our client. The stored procedure has a parameter - Parameter X filtering Column X (integer datatype); when I pass values to Parameter X - say 1,2,3,4... individually, I am able to run the report correctly in SSRS.
However, when I try to pass a string of values - (1,2,3,4...) - i.e. (by checking) 'Allow multiple values' for this Parameter X (text datatype) in SSRS Report Parameter Properties box, I get this error -
'Cannot add multi value parameter '?' for dataset XYZ because it is
not supported by the data extension. (XYZ is the main dataset for this report)
The values 1,2,3 are passed as input from another dataset (PQR).
How can I pass multiple input values (1,2,3,...) to Parameter X from this PQR dataset ?
As I have mentioned, I cannot modify the PSQL Firebird stored procedure (main dataset XYZ) at all. The procedure reads something like this for filtering Column_X:
WHERE :Parameter_X CONTAINING Column_X
Now if :Parameter_X = 1 or 2 or 3 individually passed from dataset PQR, SSRS report works fine.
If :Parameter_X = (1 ,2, 3, ....) multi values passed from dataset PQR, SSRS report throws the above error.
I can modify the dataset PQR, but not the main dataset XYZ.
Any suggestions ?
Join(Parameters!ParameterX.Value,",") still works. In my case it was using OLE DB connection type instead of regular ORACLE in Report Manager.
It seems OLE DB could not parse Join(Parameters!ParameterX.Value,",") .

SSRS 2008 won't let me override User!UserID with a data driven subscription

I have one SSRS report with two linked reports pointing at it.
One is for users to click and view their data. Behind the scenes, I need it to pass User!UserID as a parameter and hide it.
On the other report, I need to set up a data driven subscription that passes the UserID as a value from the database.
If I publish the report with the parameter defaulted to a value of User!UserID, it will not let me save the subscription and gives an error of
"The '/Admin/Subscriptions/Recruiting Sign Ups' report or shared dataset has user profile dependencies and cannot be run unattended. (rsHasUserProfileDependencies) Get Online Help"
If I remove the default value from the report definition, the subscription works but I cannot get the other linked report to pass UserID as a hidden parameter using the Parameters tab on the SSRS interface (rather than in the RDL definition).
Is there a workaround to this that does not involve VB?
So to rephrase you have report A which you use as a subreport in reports B and C. to be able to make a subsciption to report A you need to remove the default value for the user parameter. the user parameter in report A is hidden and with a default value because you don't want users to be able to set it to someone else.
so there are two ways to solve the issue: get data driven subscriptions accept a default value, or find a way to pass parameters from reports B and C
pass parameters from report B and C:
the interface won't allow you to set hidden parameters, but it works. just open report A, change the parameter to visible, open report B and C, map the parameter, go back to A, set the parameter to hidden again.
get data driven subscriptions to accept a default value:
SSRS tries to be smart by finding out that the parameter has a default value set, but it shouldn't be too hard to fool. try getting the default value from a dataset which uses a sql username function, or something in this direction..

ssrs - Forward pointing dependencies are not valid

In an existing SSRS 2008 r2, report, I am attempting to add a parameter called 'Customer_Category'. I am getting the following error message:
The report paramter 'CustomerNumber' has a DefaultValue or a ValidVaue that depends on the report parameter 'Customer_Category'. Forward pointing dependencies are not valid.
I am trying to determine how to fix this error. The 'CustomerNumber' is a parameter value that is obtained by reading from a dataset. In this dataset there are existing other parameters called 'Customer_Type' and 'Customer_Preference'. Both of these parameters obtain there values from selections that the user makes when the SSRS report is executing. There are no default values.
I am trying to have the 'Customer_Category' be the same way where there are no default values and the user must select the parameter value when the report is executing. There should only be one value that the user can select from.
The new parameter called 'Customer_Category' is the last parameter in the list of parameters. Does the order of parameters make a difference? If so, how can I move the 'Customer_Category' parameter in front of the customer_number parameter?
Here is the sql that is used from obtaining a list of customers from the dataset for customer_number:-
SELECT Distinct CustomerNumber
FROM BridgeUserCustomer
WHERE
Type = #Customer_Type
AND Preference = #Customer_Preference
AND Category = #Customer_Category
GROUP BY CustomerNumber
Would you tell me what is wrong and what I can do to solve the problem?
Summary
The order of parameters in your IDE (Report Designer or Report Builder) matters.
If you have a hierarchy of parameters (one level dependent on the other), the top-level parameter must appear first in the parameter list.
In SSRS these are referred to as cascading parameters.
Solution
Open the Report Data tab
Expand the Parameters folder
Select a parameter and use the up/down arrows to adjust order
Report Designer
Report Builder

Reporting services, textbox message

I'm working with SQL Server Reporting Services 2005.
I have a report with a dataset that gets data from a SQL Server database. Also, I have two report parameters of type DateTime (StartDate_param and EndDate_param) which the user selects on the report.
I have set a restriction if the user picks dates with different months, for example june 1 and may 3, the process stops:
I have this code on the Report Properties-----Code section to manage the restriction:
Public Function ValidateDate(StartDate As DateTime, EndDate As DateTime) As DateTime
If (DateDiff(DateInterval.Month, StartDate, EndDate) <> 0) Then
Err.Raise(6,Report)
End If
End Function
and I have set a hidden parameter CheckDateRange which calls the ValidateDate function with this expression:
= Code.ValidateDate(Parameters!StartDate_param .Value, Parameters!EndDate_param .Value)
This stops the SQL processing and i get this error when entering dates with different months:
Error during processing of 'CheckDateRange' report parameter
But I would like to show a message on a Textbox instead of the message that's showing now, how can I do that?
if that is not possible, what could I do in that case?.
thanks..
What about instead of stopping the process, just show a different 'report' to the user. This error report would have the error message that you would want to show the user. You would then just set the conditional visibility of the reports depending on the evaluation of the parameters, you could also alter the SQL of your 'actual' report so that it doesn't even run when the error parameters are given by the user (this would prevent making a now useless query because this data won't be shown).
So if your report now is a tablix set the tablix's visibility condiiton to hide when the error parameters are given. Then create a text box outside that tablix that will store your error message and give it the opposite visibility condition logic. Then alter the SQL query so that it just returns a null row when the error params are given.