SSAS/SSRS remove parameter from cube report destroys report - reporting-services

Group,
We built a data cube using SSAS and are now building SSRS reports off of that cube. Not sure if anyone has come across this, but when you build the report using the wizard and include parameters all looks fine. However if you are in the report after the wizard is compete, and you decide you want to remove one of the parameters you created it debunks the report and the only way to get it back is to re-create the whole report.
Any way you can remove or add parameters after the initial build without destroying your report?
Thanks in advance for the help! I love this forumn!

I had the same problem and this is how I solved it:
Go to the data report tab.
Expand the Parameter button, Here you get a list of parameters.
Delete the unwanted ones.

If you look at the hidden datasets created for each parameter, each one has a query which depends on some of the other parameters, in a cascading fashion. Unless you delete the very last parameter, the other parameters won't work.
You can fix this by manually editing the parameter dataset queries can updating them not to use the parameter you want to delete.
The main query also uses the parameters in a nested FROM (... (... (... fashion. You need to update that so that it doesn't constrain itself to that parameter. Then there is a parameters button on top of the query builder which allows you to remove the reference to that parameter in the query.
I think if you remove the parameters from the wizard, it should update all the other parameters and the query to work correctly. This is probably the easiest route. All of your report objects should remain functional.

Related

SSRS - Delay Dataset queries

So, I have my report written and all is well. However now I have deployed to my live environment I have a problem; when the report is initially opened it runs all the dataset queries, as I have a large database the report is taking an age to display.
Is there a way to prevent all queries running when the report is initially opened? Would like to run just a single dataset query the populates my first parameter, so the user can begin to filter the data before selecting "View Report" to run the main dataset query with the parameters applied rather than getting everything the instant the report is opened?
I have tried setting default values in the parameters to reduce the initial data load but this seems to have confused the users, so think a blank report with nothing selected in the parameters to start with would be better.
Thanks
FTD
I assume you have some form of following.
QueryLookupState -- Used to fill dropdownlist etc.
QueryLookupCity -- Used to fill dropdownlist etc.
QueryMain , your main query which uses parameters from above.
You gave default parameters to your report therefore SSRS is using that defaults and running your main query to generate report. Change your main query and default parameters so that your main query bring empty result or main query needs parameters from lookups.
You can look following question and answer for same problem. You need at least one non-default parameter, otherwise SSRS will execute your report when it first opened.

Report structure from table

I have a large project with a lot of reports, but the items in the reports are quite standard, reusable with parameters. So I've made subreports, that's OK. Now I assemble the reports by adding subreports to them by hand, plus setting the parameters, also by hand.
I think that this is not flexible enough, I'd like to have a table that defines the structure of the report: like one row per subreport, specifying the name and its parameter values. Then the report would be assembled together runtime in a list or something like that, by calling and inserting the subreport by name.
Is it possible somehow?
I can't think of a way to dynamically assemble a report like that without coding something that would generate the required RDL, upload it to the report server and then execute the report.
Another option might be to create one master report with all possible subreports in it. You could then use a table to control the visibility of each subreport, to simulate generating different reports. Obviously you don't want to execute long running queries for subreports that are hidden, so you would have to add a parameter to all your subreports so that if the subreport is hidden the dataset returns no data, e.g.
WHERE
(....) OR (#SubReportHidden = 'Hidden' AND 1=0)

SSRS -> Using code function to create my query dynamically, how do I get at my data (put data into table)?

I am not a seasoned SSRS veteran. I have made quite a few but they were pretty simple.
Today, I am attempting to use the Code tab of the Report Properties to perform some vb functions that will return my query in a string. I am passing in date parameter that is used to create my dynamic query.
My problem/issue is that I do not know how to pull this information into my table.
I have seen instances where a developer calls from each individual field and it calls the code to get a specific field. I was under the impression that I could somehow use a dataset to do this and have some documentation on this, but can't seem to find anything on the web regarding how to do this.
This is probably a pretty poorly written question, but does anyone know how to do this?
I was thinking in the Dataset Properties, I would code something like this in the expression field.
=Code.GetReportDetail(Parameter!InputDate.Value)
GetReportDetail being the starting function within my code window.
I am having difficulties how I can then pull that dataset into my table from that point though.
Any advice on this is greatly appreciated....Thanks.
After further review, I was creating this in VS2010 for RC0 2012 SQL Server, which I should have noted above.
All you have to do is create your report by adding new item (Report). Add your code by right clicking in the pink area and going to Report Properties and pasting your code into the code tab.
Next when you pull a table into your "add item to the report / white space" It allows you to create your dataset.
I chose use dataset embedded in my report. Datasource of OLE DB because I am doing MDX. Query Type Text then in the function I pasted this. (omitting parameters for now) :
=Code.GetReportDetail()
I then filled in fields manually because it seems that dynamic query running does not pull in fields.
I was then able to reference these manually created fields via my table detail row.

Passing parameters between reports in SSRS 2005

I'm relatively new to SSRS 2005. I've built simple reports, and spreadsheets but I'm just beginning to delve into the world of fun that is SSRS/RDL. I'm trying to pass one (custom/non-query) parameter from one report (*.rdl) to another. While logically I would like to add a global variable, there doesn't seem to be any straightforward method/technique for doing what I want. It seems each page/report has its own parameters and reports aren't allowed to share each other's info.
I'm trying to simply hide objects/items based on an option that the user selects. Should a user select option A or B, I want to simply hide certain objects on multiple reports (within the same project) based on their selection. I simply check for the parameter value within an expression for the visibility property in any given object. Nothing complicated really. I've tested it out and on just one report by itself, it works. But try to get one report to read that value on another report, and there's no clear path in doing so.
Now as I've grown accustomed to SSRS, I believe there's the "normal" programmer's way and then there's the "SSRS" way. Both are mutually exclusive. So either I'm trying to do something that will never be allowed, it's a "built-by-design" feature and/or I'm going about it the wrong way.
Ideas? Suggestions? Maybe I'm going about this the wrong way.
Ok, so there's a only a few ways to pass parameters from one page to the next. I (eventually) discovered that I was simply trying to pass a boolean from one to the next. The data was not from the database, it was something manual ('true/false'). At first I thought I needed something akin to a global variable which there are a few built-in globals in SSRS. But as I found out, you can't add anything to that collection.
So on this one report I have an image pointing to the 'Next' page of the report. Within that object/image, you can set navigation parameters on that object/image. Makes sense so far.
On the following page, your report parameters must match the position in which the variable was listed from the following page. I guess SSRS passes a non-key based arrays from one report to the next so index/position is vital for getting the parameters right. Hence the arrows allowing you to adjust the parameter order. That was what tipped me off, but I thought it was SSRS was more adept then that in the sense that parameters being passed had to just match in name, not position.
(IMHO) as I see things, SSRS has/tries/must remain fairly static. There's no real sense of events, OO, etc. and yet SSRS seems to stitch elements from VB, VBA (expressions), SQL/T-SQL altogether and spew forth a usable product. I guess that's my newb perspective. I'm sure it will change with time.
Using subreports might allow you the functionality you need. Otherwise, the only other way I know of to "pass" parameters from one report to the next is using the query string.

Pass dataset to subreport with SQL Server Reporting Services

I'm using SQL Server Reporting Services and the report designer that comes with Visual Studio. I've got a really big report. It's actually so large that Visual Studio hangs (sometimes for hours at a time) or just crashes when I make changes.
There is preciously little I can do to solve the problem, so I've decided to just move the bottom half of the report into a sub-report. So, I started with one enormous, unresponsive report and ended with two small, manageable reports -- surprisingly, this actually works.
One problem: my subreport uses the same data as my main report. Right now, it populates its dataset by re-querying the database. The extra round-trip to the database causes the report to take twice as long to generate; up from 45 minutes to 1 1/2 hours to generate.
I'd like to avoid hitting the database again, and instead use the same dataset in both reports.
How can I share or pass a dataset between a report and subreport?
I think this can help you:
http://www.gotreportviewer.com/subreports/index.html
Supplying data for the subreport - the SubreportProcessing event To
supply data for the subreport you have to handle the
SubreportProcessing event. Note that this event is on the LocalReport
object. You can add an event handler like this:
private void MainForm_Load(object sender, EventArgs e)
{
this.reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(MySubreportEventHandler);
}
Below is an example for the event handler. In this example
LoadSalesData is defined to return a DataTable.
void MySubreportEventHandler(object sender, SubreportProcessingEventArgs e)
{
e.DataSources.Add(new ReportDataSource("Sales", LoadSalesData()));
}
If your report has multiple subreports you can look at the ReportPath
property of SubreportProcessingEventArgs and supply data for the
corresponding subreport. You may also want to examine the values of
Parameters property of SubreportProcessingEventArgs and only return
the subset of data that corresponds to the subreport parameters, as
mentioned here.
I'm pretty sure you can't. You're probably better off looking for ways to redesign the report entirely so that it's not so large... not to mention the various problems with subreports when exporting to excel.
I have several reports that the SQL is so complex in that it locks up Visual Studio when I try to edit it. In these reports I go straight into the Code view and edit the XML directly, which works. I also do this when Visual Studio mysteriously makes columns slightly wider than I set them at. However, I doubt you'd want to go down this path if you are editing the layout of the report too much.
Instead of running your query in the report, would it be possible to build a table using a stored procedure that both reports use? The first report runs the stored procedure to build the table and then both reports simply query the report. Watch for concurrency problems if the report can be run by multiple users.
Have you tried using a list within a list where both lists use the same dataset and then filter the inner list to display only records linked to the the outer list?
As far as the execution time, 45 minutes seems like an awful long time in the first place. I'm assuming you've done some analysis of the execution plan to verify your query or stored procedure is using meaningful indexes?
Hope this helps,
Bill
You can do it using a dummy parameter:
i. Create a parameter in your main report 'MyData' and tick 'internal'
ii. Set default value of 'MyData' to your data-set
iii. Set the sub-report parameter with the expression
=Parameters!MyData.Value
Hope this helps,
Duncan
If you create a table, you can merge all the cells of the details row and put a subreport as the contents. Then set the parameter of the subreport to the field you want to run the subreport against.
Jason