SSRS - Visual Studio 2017 - reporting-services

OK I've come across something that baffles me.
I've downloaded SSDT for Visual Studio 2017, version 15.5.2
I'm creating new .rdls. I use Reports --> Add --> New Item for Reports.
Have my DataSource and Dataset created, no problem. i use an existing stored proc to retrieve, and it's no problem.
But i cant' figure out why there is no DETAIL band. I mean, any item that is retrieved, is First(columnname) for a string column, or Sum(columnname) for a numeric column, etc. Why on earth can i not just have a detail row, for all the columns i select? Not having a detail band really defeats the purpose of a report in the first place. I can have a page header/footer for summarizations and such.
So do i need to use the Report Wizard instead? The wizard does not seem to allow me to select a stored proc, so that seems useless to me as well.
Why is there no Detail band when i create a report? i thought that was standard when creating a new report, when i used SSRS in the past.

Presuming you have placed a tablix or a matrix on the design window, Right click on the tablix.. select Tablix Properties and then set the Data set Name to your actual dataset in that window. You should now be able to select the columns as required.

Related

SSRS - Two different reports in one Excel?

I am pretty new to SSRS, so forgive me if I am asking something that is either obviously not possible (or easy) - I haven't found what I am looking for so far!!
I have a Detailed report, which splits by group onto multiple Excel tabs (pages). I also have a separate Summary report which outputs onto one page.
I want to merge these two into one report, so the users receive just one email, with tab 1 showing the Summary report and tab 2 on wards showing all the Detail.
The datasets come from two stored procedures and whilst related, they are different so I can't use the same dataset.
Is this possible in SSRS?
Thanks
Mark
Take your Detailed report and insert a subreport at the start of it. Set the subreport properties to point your Summary report.
If you have any manually set parameters in the Summary report, you'll need to set them up in the Detailed report (if they don't already exist) so you can pass the parameters to the subreport.
Now you have a single report with everything in.

How to pass parameters to subreports?

I have 5 reports that all have 2 parameters: startdate and enddate.
select * from table where date between startdate and enddate
This is a simplified version of what I have, but for this problem, it should work.
I need to have all of the tables in 1 compiled report and link all of their parameters. I think I might be approaching this problem incorrectly. First of all, the server that I'm publishing the report to is SQL Server 2008, not SQL Server 2008 R2, so I don't think I can use report parts (correct me if I'm wrong). Because of this, I thought that the best way to approach this would be to use subreports. I created a new report that will contain the other reports as subreports. In the subreport properties, I set startdate equal to:
=Parameters!startdate.Value
Startdate exists in the new final report and it has a default value. I did the same thing with enddate. However, when I run it, I get the error "One or more parameters were not specified for the subreport, 'Subreport', located at :/Subreport."
I'd really appreciate any help with this, and I apologize for the length of this post. I tried to find this online, but I couldn't, so I finally made an account so that I could ask this question.
Edit: I never found the solution to this problem, but I achieved the result I wanted by just copy and pasting the tables and adding the respective datasets to the main report.
First, you have to define startDate and endDate in your main report as well as all reports that will be used as a SubReport. I don't think you are mapping the paremeters. SSRS will not auto-map same named parameters.
Add a SubReport component from the toolbox onto your main report
Right click on the SubReport and select sub-report properties
Select the Parameters list view item from the left hand list view
NOTE : If the SubReport is contained in the same vs project as your main report you should see the available SubReport parameters.
Map the name of the SubReport parameter to the value of your main report's associated parameter.

use expression to dynamically decide which subreport to open

I have a report that contains several pages with graphs, tables and so on.
This report is used by different customers who always want small modifications to the report. At the moment if a customer wants a change on page 5 the whole report is recreated with the modifications, even though the only change is in the graph on page 5.
More so, some customers don't want to see page 3, others want a custom table at page 6.
My boss would like the report to be modular so he can simply switch parts on/off depending on what the customer wants. At the moment a change in a report means development followed by deployment.
My idea is to create a report with a number of subreports. Each graph/table would be a subreport so that if a change is needed we only need to change thàt specific subreport.
Ideally a dataset would be attached to the mainreport detailing which subreport to show: for customer X we would show SubreportX, Customer Y would see subreportY.
I know this can be done by adding all possible subreports to the mainreport and switching visibility per subreport but more elegant would be to dynamically decide which subreport to show. On drillthrough reports this is possible by using an expression to determine which report to open;
eg IIF(customer = X, "subreportX", "SubreportY")
but is this possible with subreports?
To be clear: I am looking for a way to decide dynamically at the moment of opening the report which subreports to show. Something like using an expression to get the name of the wanted subreport.
I have been searching for this (in VS2012 and through Google) but I cannot seem to find a definitive answer whether it is possible to decide at opening the report which subreports to show....
I found the following but again that seems merely to be using toggling visibility:
Dynamic subreport in SSRS 2008
I am very much hoping for suggestions, answers or even general directions. Thanks for thinking with me!
I would create a Dataset that returns the list of valid subreports for the selected Customer. I would add all the possible subreports to the master report. I would set the Visibility property of each sub-report using a Lookup expression, targeting that dataset.

reporting services, have two reports in rdl

I have a SSRS 2008 report that shows some information based on a start date.
I would now like to add another instance of the report to the same rdl, with a different start date.
How can I add a second instance of the same report to the rdl file? There doesn't seem to be a way to copy and paste it in.
The dataset is the same, just a parameter value changes, but both need to be shown on the same report.
Your question sounds a little confusing, because you're talking of "a report in an rdl", but an RDL is a report. What you should probably be looking into is creating a subreport. You can create a "master" report that holds the subreport either exactly twice (2 times) or in a list (n times).
The business case around your start date will determine which option is best for you. If you just have a master report with merely two subreports right below eachother, you can hard-code the parameter "start date" for both subreports. In this case you don't even need a data-set in the master report.
If you need or want to be more flexible use the other option with the subreport in a list. You could create a dataset with a column "start date" and bind that to the parameter for the subreport. This way it's easy to extend the setup to show the report three, four, or n times.
In any case, either option allows you to minimize copy/paste action, which is a good thing.

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