Passing a MDX Parameter to an URL in SSRS - reporting-services

I have a (very simple) report that load yearly data from an SSAS Cube for any given customer number. The report is linked in our CRM and I want to load the report within the CRM by passing the customer number into the URL.
I know how to do it with a relational dataset, but I'm at a loss here.
I thought the URL was:
http://reportserver/CRM/Salesreport&Customer=[customer].[fields!id.value]="1234"
Where 1234 is being passed on by the CRM.
Edit: This is for SSAS-datasets, not relational datasets!

When working with MDX, you have to be mindful of the syntax of the parameter values. The value of "1234" doesn't exist in your SSAS cube. There are several ways to go about applying parameters and filters, but I'll give you one example.
Change the URL to be in this format:
http://reportserver/CRM/Salesreport&Customer=1234
Add a Filter to your dataset where Fields!id.Value = Parameters!Customer.Value
By using a dataset filter, you are avoiding the complications of MDX syntax and using the data after the query has been run. A more efficient approach would be to convert the parameter to MDX syntax and pass it into the query, but that requires more work.
Also, if you check the Parameter box while in the Query Designer, it will automatically add a parameter along with a hidden dataset to populate it. That can be very useful because it converts the values into MDX syntax for you.

Related

building Power BI report using SSAS Cube as Source

Requirement: We are trying to build PowerBI report using SSAS Cube as a source.
Currently we already have the same report in SSRS which is using the same cube as source.
so we are upgrading to Power BI as per the user's need and the SSRS report will be decommissioned after successful implementation of this.
The SSAS cube also has some complex calculations (calculations tab of the Cube) which are used in the SSRS report.
There are many columns which have been hidden too but are called into the SSRS Dataset.
The current SSRS report dataset has an MDX query(including some of the hidden columns) which serves as the Main query for report (Matrix type report with row groups and column groups), along with other smaller datasets which supply values to parameters
The MDX query in the SSRS report has around 6 parameters(which user can choose the values from the SSRS parameters prompts)
We are trying to find all the possible ways so that we can build the report in PowerBI
Our findings and what we have tried so far :
1)We have tried live connection after unhiding the columns (only those ones which are called in the MDX query) but we could not perform any transformations or calculations due to Live connection limitation. We thought about creating possible calculations with in the Cube level but don't know if it would actually give us the desired results correctly which would match with existing SSRS report as a comparison.
2)We tried Import mode using the same MDX query which is used in SSRS report by supplying values to the parameters(for example we passed [Report ID].[Report ID].&['a specific City name'] replaced with [Report ID].[Report ID].Children, so that we get data for all the cities instead of just 1 city) but the results are coming out incorrect.
Please if someone can provide us a valid approach on the architecture part, it would be really helpful as it will help us to get started.
Please let me know if something is not clear, so I can add more to this

Ssrs tablix filtering

I have filtering implemented at tablix level in an ssrs report.
The tablix is using a dataset which is getting lots of records from database using a stored procedure.
The report has parameters whose values are used to filter the tablix data.
First time when the report executes it gets all the data from stored procedure and bind it to tablix with all the details as parameters default value is set to select all.
I want to know when user enters parameter values and click on view report , does the report executes the procedure again , get the entire set of data and then filter based on input parameters?
Or the ssrs report is smart enough to know that already the data which was fetched the first time will be used to filter the data in the tablix
First let's talk about the difference between query parameters and report filters. Parameters are passed into the query so that it can run faster and return targeted results. Filters are applied after the fact so the full query has to run and then the report has to go through the records and check criteria row-by-row.
In addition to those options, SSRS offers caching. This allows you to save the query results so that the query is only re-run when needed. This is configured on the report server, not in the report properties.
The best optimization will vary by report. As a general rule it's best to pass parameters into the query/procedure and just get the data you need. If that is too slow, let the query get all the data, cache it, and just use filters at the report level.

How to pass a record from ssrs main report dataset to subreport

I have a customer dataset from a main report which I bind to a list. In this list I have a subreport. How do I pass the each row of data to the subreport? I don't want to pass an id from main report to subreport then call a stored procedure to fetch the record based on the id. I already have all the details flattened out in the dataset which i fetched from the main report.
The fact is that you can't pass a set of rows as a parameter to a subreport. The most common approach is to have a shared dataset so you can execute it again based on the same parameters or a store procedure for exactly the same purpose. Only other thing can be done, and it's to convert a dataset's field into a string containing all the values, and then split it again. This is done with SSRS built-in functions join and split (if I'm not wrong), but to be honest I don't know if that solves your problem and it's a really nightmare to get it working properly.
My standard approach is to have efficient stored procedures that can be executed any times within a set of SSRS reports. I understand that you want to retrieve each datataset only once, but SSRS is not meant to make that easy.
And even more important, if you queries or procedures are efficient, data retrieval time is just a tiny porting of all SSRS report build and presentation time. Usually rendering the report is what takes longer and some repeated data extraction won't be noticed in the overall execution.
If you what to be really efficient in data retrieving, you can explore the options provided to cache data in datasets, but stills seems to be too complex to solve something that doesn't really need a solution.
Hope this helps.

How to use parameters in report when using SSRS matrix and table wizard

I would like my users to be able to create their own quick and easy reports from a cube on the fly, and that is most simply done using the "Table or Matrix Wizard" in Report Builder.
However they need to filter by date--and it wont work.
I have tried:
1) Creating a dataset with parameters imbedded. When you run the report, it asks for a parameter but there are no values in the drop down -- and an analysis of the "Parameter Properties" shows no available values. (Even though I chose values when creating the dataset)
2)Creating two datasets, one with all the data and one with only the date field. However the matrix wizard will not allow you to use 2 datasets.
Is there any simple way to add a filter to the report so that my users can just load a dataset/two and then use the Matrix wizard?
Thank you!
If the user running the report needs to define a date parameter, they need to create a date parameter with the same name as the parameter in the stored procedure that is called by the report. They should then set the Data Type to Date/Time, and make sure the parameter is visible.
When the user runs the report, they will be able to use the calendar feature to pass the date value to the report procedure.

How to pass parameters to report model in Reporting Services

I'm developing report in RS that show top N customers based on some criteria. It also allows to select number of customers and period of time.
Is it possible to do it by using report model? Thing that it seems to be difficult is how to pass parameters determined by user.
Another thing that in my oppinion is very disappointing is that i cannot use SQL query as dataset query, because it uses odd and elaborate XML. Although report model items seem to map its fields to query or table fields.
I m concerning using report models because i need to provide uniform data model (the same tables and fields) for more or less different database schemas.
It would be very nice if somebody would explain what can be done with report models and what can not.
Maybe what you're looking for is to use the result of a Stored Procedure as the data source for your report. You would need to define parameters at a Dataset level to pass to the SP
You can create report model based paramaterized filters through the query designer by adding a filter, drag the field you want to filter on into the filter area, then right click on it and select "Prompt". This will automatically create a report parameter which you can then edit via the parameter properties dialog to set the data type, allow multiple values, etc.