SSRS 2008 - Object Reference not set to an instance of an object - sql-server-2008

Issue I get for one of my shared data sets only on certain parameters. If the parameter returns nothing for that dataset then I seem to come across this problem, there is a tablix in this report that uses the shared dataset and if I remove the tablix but keep the shared dataset I still get the error on the report preview.
The dataset uses a MDX query (SSAS) to get its data, if I run the query from the query designer it returns 2 rows but the dates in the rows are outwith the scope of my report so the report would return 0 and I assume thats my issue.
Anyone got any ideas/tips?
Uses SQL Server 2008 R2
Thanks

Managed to get round this issue by having an embedded data set rather than a shared one.
Gets around the issue, very annoying though!

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

how is ssrs parameter getting set?

I have an ssrs report that uses a Shared Dataset to extract a maximum datetime value that I want to use for multiple reports. I have created a shared dataset called MaxSnapshotDateTime.rsd that uses the query:
select max(snapshot_DT) as snapshot_DT from dbo.SystemLog (nolock) where sync= 1
My report dataset Snapshotdatetime uses the shared dataset. And my parameter #snapshotdatetime takes available and default values from the Snapshotdatetime dataset. I want to be able to use this #snapshotdatetime parameter for embedded datasets.
The #snapshotdatetime parameter is the first in the list of parameters. And the Snapshotdatetime dataset is the first in the list of datasets.
When I preview the report in SSDT it displays correctly initially. But once I select View Report the snapshotdatetime parameter displays as a dropdown with "Select a Value" as the default value and my snapshot datetime available in the dropdown.
If I set my available values for the parameter to be None then I get different behaviour: the parameter appears correctly but it is not available for other dataset queries.
Unfortunately I don't have sufficient permissions for a trace. And I have been unable to replicate with another source. Can anyone shed some light on what is happening when View Report is being clicked?
I am taking a wild guess here, but I have faced such issue before and have done lot of head-scratching. Turns out there is a rdl.data file in the solution where the rdl file resides(and it gets created automatically). This is the cache file for the report. When you "Preview" a report, the data and design for the report is fetched from this cache file, not the actual dataset. Hence there are chances it might be stale.
If you really want to see the report's output, instead of previewing it, try running the report from solution. That would be much more reliable.
Hope it helps you.

SSRS 2005 page break per report

I have a specific type report that I need to generate multiple copies of. What I want to do is pass a string of report IDs to SSRS and generate all of the individual reports (let call them subreports) with those IDs in one master report with each subreport on a new page. I've already tried making a subreport and placing it in a table with grouping. This worked the closest so far. It gave me all the pages I needed, but it generated the report for the first ID number over and over. Is there anyway to do this or am I gonna have to jump through a lot of hoops?
If you are passing the string of report IDs to a parameter on the master report, I think using a table and subreport should work. You'll need a way to split out the report IDs using a dataset on the master report and return them one per row (so you can pass each report ID individually to the subreport via the details row of the table).
I was going to recommend a table-valued parameter for this, but since they don't exist in SQL Server 2005 check out Arrays and Lists in SQL Server 2005 by Erland Sommarskog for a few other options.

MS reporting services limiting number of rows

I have a report working well where I extract the number of logins per user. Each login takes up one row on the report.
I have date parameters and my DB goes back a year. However it seems the report will only show 40/50 rows despite a report expecting to deliver, say, 250 for the amount of times I logged in.
Is there some setting in reporting services that limits the number of rows delivered. Can't find it anywhere..
Thanks.
The answer to your question: nope, as far as I know there's no real equivalent of SQL's TOP 50 statement in SSRS itself.
Some things that come to mind that may be causing your symptoms / can be investigated:
What happens if you run the query for the dataset in SSMS? Be sure to fill in the exact parameters the report's using (if any).
Run the query as a test from SSRS designer. If you're using Visual Studio: right-click the dataset and hit "Query...", then hit the red exclamation mark and fill in any parameters if needed.
Try putting a CountDistinct call (on your dataset) in a textbox somehwere in the report, by itself.
Check the filtering and grouping on your tablixes, perhaps even by looking at the XML source code for the RDL.
Show the parameters in textboxes (oldskool printf debugging! :D) to make sure they're what you expect them to be when the report's run on the Report Server. If they're not: try deleting the report on the server and re-deploying it.
Have a look at the ExecutionLog2 View in the ReportServer database, specifically the Number of Rows returned.
As mentioned in the comments by Atilla: You may also monitor exact SQL SSRS sends to server using SQL Server Profiler.

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