Sharepoint Integrated SSRS report excel export fails - sql-server

When trying to export a report to excel, the web site loads for some time and I am getting "This page can’t be displayed. Make sure the web address is correct" error.
Here are some platform details:
SQL Server 2012 with SP2
Sharepoint 2013
SS Reporting Services with Sharepoint Integrated Mode
Windows Server 2012 R2
The report itself has 4-5 parameters, calling some views and one procedure, and displays 120K rows with 30 columns max. The whole report without filtering can execute in about 7 seconds in SSMS. SP website can display the results of rdl just fine, report displays fine and fast enough. I can also export the results to csv, xml, all 120K rows of it. But when it comes to exporting to excel, it gets stuck.
Now this is where it gets funny.
When called with some parameters or date filtering, the report comes out nice and easy and can be exported to excel without delay. I have tested with increasing number of rows and excel export works fine up to some 50K rows. The exported xlsx file is around 9MB. But when I increase the date range, excel export is timing out.
Now on to the things I tried.
Exporting to other formats work fine. Just EXCELOPENXML is not working.
Increasing the values of ProcessTimeout, ProcessTimeoutGcExtension and even adding DatabaseQueryTimeout keys in rsreportserver.config did not help.
Increase the values of executionTimeout and maxRequestLength keys in web.config also had no effect.
I restarted Reporting Server services after config changes.
I suspected the 10MB excel export bug in SQL 2012 but that should be resolved with SP2 which is applied in this system.
Also related, few minutes before displaying the error message, web site asks for a re-login to sharepoint site. That happens after a couple of minutes of hitting the excel export. I want to make sure everything is what is supposed to be in sql side before making any IIS config changes.
Any ideas?

A few days of trial and error later, I've found the cause of this issue.
The problem was in a column with an action property of "Go to URL" and the url was set by string concatenation expression, taking 4 parameters from the report fields. Apparently SSRS processes all few hundred K's of data all over again while exporting to excel.
The reason why csv and xml formats were able to process the same report, but excel throwing the timeout remains a mystery to me. All I can speculate is that excel renderer requires more process time to format the cells.
Another way to solve the issue might have been enabling the report snapshot, so report data would be consumed from the cache but I'm not sure excel export would still re-process the report or not.
I solved the issue by adding another column with the same data, but adding the expression below to column visibility property:
=(Globals!RenderFormat.Name="EXCELOPENXML")
So now, the string operations with the parameters are successfully processed to form the URL format in web view, but are not processed in excel renderer.
Hope this helps someone.

Related

When printing to Excel in SQL Service Reporting Services a rendering error is shown

I am a report that on page 1 shows 3 charts and then on all subsequent pages shows a Tablix output of column / row data. I was making edits to it earlier today and adding two new columns to the query that generates the Tablix output and ever since when I attempt to print to Excel I receive the following:
Reporting Services Error
An error occurred during rendering of the report. (rrRenderingError)
An error occurred during rendering of the report.
Excel Rendering Extension : Argument is not valid.
SQL Server Reporting Services
I am unclear if this is due to my modifications of the Dataset and corresponding Tablix or if it is due to the amount of data being put into the Tablix as one of my columns is a notes column that at times can be lengthy.
I own and have full access to the SSRS server so can reboot / restart services / etc.
Any help in resolving is much appreciated?
Thanks!

getting strange errors when importing external data to excel from SQL Server

In Excel I using a Data Table that connects via a data connection string to an sql server procedure. The procedure accepts some parameters querys and then returns the data to the excel data table. This has worked well for quite a while.
Now the users have started to randomly get the following error message.
This is happening randomly as the user try's it again and it works.
Nothing else is on the spreadsheet and the returned information is well within any row count limitation that excel may have.
I was able to isolate the cause of the error. If you have something on your clipboard and then refresh your table it causes a conflict when the records are returned. After clearing my clipboard and refreshing it worked fine. This most be a flaw in the version of Excel I'm using - 2016.

Crystal Reports: only field headers showing up. No data

I'm new to CR (this is my first experience in fact). I'm trying to create a report based on a stored procedure I created in SQL Server 2012.
The SP is relatively simple and it runs just fine within SQL Server: all the data is right there in the results.
However, when I created a new standard report in Crystal Reports (2013), I'm able to access my server and database, select the SP, and the fields I want to use. It goes smoothly until I select "Finish". When the report loads, there's only the field headers from the SP.
I'm lost. I've tried it many times and continue to have no data. When I right-click to check the connection, it confirms connection. When I right-click on a field in the field explorer (I believe it's called) to view the data, there's nothing there.
The strange thing is, I created a view in SQL Server with the same query and when I added that view to CR, it worked fine. All my data was right there.
I also tried using a few other SPs in the database and I had the same issue —headers with no data, so I'm pretty confident it's not the SP itself.
Note: after selecting my SP and field when starting a new CR, I'm presented a window to choose the data range (which I assume is based on a date time parameter I have built into the SP). I didn't choose a date range because the end user will be selecting the range they need, so I checked the null boxes. I doubt if this plays any part, but I figured I'd mention it.
There must be something simple I'm missing here. I just don't get it. Any ideas? Thanks for taking the time to help.
put your code and SP so that i can identify

Steps to export the SQL Server returned result set to an Excel file

I have a stored procedure that I am going to run every weekend, it produces a result set that I need to export into an Excel file.
For the above problem I want to automate this process, so I am going to create a SQL Job and I am going to run this stored procedure every weekend so that that generated Excel file is sent to my reporter.
For this I need steps to export the result set data to an Excel file.
And also is it possible to send that Excel file to the specific mail while running the job itself?
So, you might try your luck on https://dba.stackexchange.com/, but in my experience a SQL Agent job running a stored procedure could be coaxed to return CSV or XML - and those could end up in Excel, but there are missing links. I think the missing links would involve programming and potentially 3rd party tools to avoid using Excel's COM API.
I'd strongly recommend your pursuing SQL Server Reporting Services. It is included free with your edition of SQL and includes the ability to
run reports on a schedule (subscriptions),
format the results as an Excel file
distribute the results via email
You'd take your query and use it as the data source for a "report" and use the report wizard to create a very simple table with the results.
Avoid page headers (or footers) that span columns - this will keep the excel output cleaner.
References
Stack Overflow: reporting-services-export-to-excel-with-multiple-worksheets
Technet: Reporting Services

Reporting Solution for Data Validation Queries

I'd like to get some advice on a reporting situation that I have. I am working in SQL Server. I have a ton of data validation queries that I run against a database. In general, for each query, I return two things -- one is the count of the offending records, and the other is the offending records themselves.
My goal is produce a report that gives the counts of the offending records for all data validation queries (ideally, on one sheet in an Excel workbook) and the offending records themselves (ideally, on separate sheets in an Excel workbook).
How is this best achieved? That is, what technology is best for this situation? For example, in the past, I have prototyped the queries in SSMS, copied them into a Windows batch file (and added code to write the results to separate text files), and called the batch file via the sqlcmd utility (using command prompt). However, I know that other solutions exist (e.g., SSRS). Would something like SSRS be a better tool for this situation? I'm hesitant to go the SSRS route, since I'm only giving metrics on one issue (i.e., counts of offending records) and the rest of the report consists of offending records.
This might get closed because it is a matter of opinion, but SSRS would be a good solution for this requirement. I think SSRS is a good fit if you have the following criteria:
You need to visualize the data in some kind of a table, chart, or graph
You want to send out automated emails every morning / week / month to a group of users (as opposed to just individual consumption)
You want to be able to export the report to other formats (excel or pdf) for additional analysis or sharing.
Otherwise, if it's just for you and you currently don't have SSRS running on the server, save yourself the overhead of running another service and just keep doing it in batch files.

Resources