Displaying a custom error from SSRS Report Manager for rsProcessingAborted - sql-server-2008-r2

I'm using SQL Server 2008 R2 Reporting Services, designing reports with Report Builder 3.0 and viewing them through Report Manager (http://host/Reports/, not http://host/reportserver/).
I have a large number of reports built and accessed this way, reading data from a database which is refreshed every hour. The refresh process takes a few minutes and is a simple ETL C# script I wrote to (for each table) delete all matching rows and insert new data (inside a Transaction). It might be this part of the process I need to change, so I have tagged this question with SQL Server 2008 R2.
My issue is that whenever the import and SSRS report execution run simultaneously, I get an rsProcessingAborted error. It looks like processing aborts if the underlying data changes while it is executing. One of my reports is very complicated takes several minutes to run, so I see this error a lot and generally don't see it at all on the other reports.
An error has occurred during report processing. (rsProcessingAborted)
Cannot read the next data row for the dataset xxx. (rsErrorReadingNextDataRow)
These reports need to be shared with users who will not want to see the error. Is there any way I can
make my import script and the SSRS execution "atomic" so the report is able to run anyway
customise the rsProcessingAborted error shown in Report Manager so that the user is shown a message like "The data behind this report is being refreshed. Please try again in 5 minutes." - still irritating, but nicer than the error above...

Use "NOLOCK" table hint in your report.
For Example:
SELECT [LastName] FROM [dbo].[AuditLog] WITH (NOLOCK)

Related

Jasperreports: how to gracefully handle or ignore SQL error?

Our runtime environment is Tomcat with thin jasperreports servlet with compile/get connection/fill/generate PDF functionality.
Reports usually consist of several tables, each with its own dataset (SQL query).
JR version is 6.2.0.
Is there a way to:
gracefully handle SQL error in a dataset - ie. to catch it and to
display error code/message
or
ignore SQL error so that report execution doesn't get interrupted
(of course, if other report parts depend on erroneous sql query,
report will break eventually)
Is it possible to do this using custom scriptlet class, custom data adapter, datasource or something like that (overriding some engine class/method)?
With regards,
Goran
JasperReport is only a viewer on data. Error management must be done elsewhere.
Two ideas: Materialize the functions into a "business" table and select with JasperReports on the table. Results in more tables, of course. If a job isn't finished yet, there won't be any data. This is the way we usually tackle this requirement.
Or you could use the JasperReports API, select the data in Java code and handle the errors there. In the report you could use the "No data" field or an "Error" parameter, which is usually empty. If an error happens, it will be filled with the error message. This could be done with a Custom data source, as seen in the documentation. In the custom data source you can select the data using your own methods and handle any errors. Then you can control the results given back.
Note: We haven't implemented a custom data source yet, so there still might be a better way.

Crystal Reports (CR13) and Dataset (Command)

Your help is needed.
I am Using .Net 4.5 and CR13. I've created two reports using OLEDB(SQL Server 2012), with SQL command as source. I wanted to add second report as a sub-report to the first one. For the testing purpose, I just inserted second report to first as sub-report with no link. While in the design time everything works perfect(both reports shows all data according to the command), but in the run-time sub-report shows no records for the same command.
NOTE: I am not using any parameters for the testing purpose (Will be using later on if everything is a good to go)
Thank You
Jason

How to avoid blank report export to Excel in SSRS 2008 r2?

Hi I developed one report which is taking parameters dynamically with help of Data driven subscription.
but when I did subscription it is exporting all users reports into Excel and keeping it into windows file share folder.
here my issue is my client doesn't want the report if report is empty for a particular user.
but I have to fix this issue in SSRS itself instead of doing changes in Procedure (database) level.
i used the below expression in SP Level
i.e
if(##rowcoun>0)
raiserror("nodata",16,1)
Note: but the same procedure is using for multiple purpose and my db developer is not accepting to do changes in SP levle.
in reports level i am using the below expression to hide the column headers if report is empty
iif(countrows()>0,"true","false")
but the above expression showing blank report and it is exporting empty excel sheet for the user.
Thanks in advance
Since you are already using a Data Driven Subscription, what you need to do is edit the subscription query so that it creates a list of recipient emails based on those with data. The way I do this is to join the table of recipients with the dataset to be returned.

How to Query a Web Service (XML) From a Subreport?

I apologize if this has been already asked but my searches have had little luck. I've also tried MSDN forum's, but its obvious that I need the big guns for this one ;)
I am using VS2008 (SSRS 2008 R2) to create a series of subreports. Each Subreport queries 1 or more Web Methods from a WCF Web Service.
When I run an rdl as a stand-alone report, everything renders properly. When I run that rdl as a subreport, I receive an error recommending that I check the log (details, and steps to reproduce below.)
Simple Test (No Subreports):
Using the instructions found in the article Reporting Services: Using XML and Web Service Data Sources I was able to create the necessary Shared Datasets for each web method.
I successfully created a report (SubTest.rdl) utilizing a Shared Dataset for a Table.
The dataset's underlying web method contains no parameters (trying to keep it simple).
SubTest.rdl renders correctly!
So far so good.
Test 2: Master/Subreport structure
created a Parent/Master report (MasterTest.rdl)
added a Subreport Report Item, and specified "SubTest.rdl"
Note: No Report parameters are specified, as SubTest does not have any parameters defined.
I receive the following error during the rendering of the MasterTest.rdl report:
Warning 1 [rsErrorExecutingSubreport] An error occurred while executing the subreport 'Subreport1' (Instance: 5iS0): Data retrieval failed for the subreport, 'Subreport1', located at: /SubTest. Please check the log files for more information.
Additional Testing:
To ensure that my subreport is properly defined in MasterTest.rdl, I altered SubTest.rdl. In SubTest I removed the DataSource, DataSet, and Table from "SubTest.rdl" and insterted a TextBox filled with the words "Output From Subreport". This rendered properly in the Master report, indicating that the problem specifically relates to my Web Service Datasource/DataSet.
Questions: :(
Is there a way to accomplish this task?
If this is not possible, can anyone suggest a workaround for providing Web Service xml to a subreport?
Also, per the error message: Any idea where I can find this log? (because this is running in Visual Studio, checking the SSRS logs folder on my local machine did not help, nor did running VS with logging enabled.)
A workaround that I could not get to work:
I tried to follow the instructions in the linked article for passing XML to a subreport as a parameter, but
The master passes the xml as a scalar string. Because I am querying
a web service and not using a data set where each row contains a col holding the XML, I only have the resultant dataset to work with. Basically I need to convert a data set to a scalar.
I had difficulty following the instructions (even if I could solve problem
1, I'm not even sure that I properly defined the dataset and
parameter - how do I get fields when the data is not known until
runtime?)
Thank you for any help you can give. This has been driving nuts for days!

Crystal Reports - Failed to open a rowset

What can be done to resolve the exception:
CrystalDecisions.CrystalReports.Engine.InternalException: Failed to open a rowset.
This is a generic error in Crystal Reports whenever the report query fails. There can be a number of causes. If your report was targeted to a specific database and then the database was changed without updated the report, this can cause it. It can also be caused by something in the query itself failing, such as if the report is based on a stored procedure that doesn't exist on the database against which the report is running. Try verifying the database for the report.
As said this is a generic error, and like all such errors it's a very frustrating one. The problem is that VS 2003 has no preview option for crystal reports so it's hard to track down the source of the problem. So best way to solve this is to create a blank project in vs 2005 or later, import the crystal report, and run preview. You will get a more specific error then.
I had the same issue, and received this error message:
One ore more fields could not be found in the result set. Use Verify Database to update the report.
Error in File filename {9FEE6406-1613-409A-B9BD-C5FDA24E3DEE}.rpt:
The rowset column could not be found.
I was using a stored procedure to collect data for the report, and sure enough I was passing an invalid parameter for the SP. Double check the type and value of the parameters if you are using a SP to populate the report data.
Good luck!
I have also gone through same error with report having sub reports. Issue resolved as i switch to each sub report and make it verify again with database/tables/views.
This is caused by some discrepancy in your relations, like opposite left joins or something similar. CR has also the bad habit to create 'default' links each time you modify the list of tables and views needed for the report. It can even sometimes automatically create recursive links that might not be viewable 'at once' in the relations screen.
If you cannot find which relation(s) is causing the trouble (sometimes it is not so obvious), you'll have to make some trial & errors test by adding/removing tables from your report.
Every time you add a new table in crystal it adds its own links on already linked tables, some times it even links the 2 fields from the same table.
Make sure you know your links in order to go through after you add a table and scroll all tables to see for any links create from to the same table
I received :
CrystalDecisions.CrystalReports.Engine.InternalException was unhandled
Message=The Report Application Server failed
Google brought me here. For those that have similar problems.
For the record: I had a byte[] array with an image and removed the log from the report and the error stopped. I now have to figure out what I have done wrong with the logo.
I had this problem - we use SQL logins for our security (not integrated / DSN connections)
By granting execute permissions to the user for my stored procedure I fixed the problem.
Really, really couldn't hate Crystal more for their exception masking - let this be a lesson to all programmers;
Try
'your code here
Catch
Throw new exception("Hey, here's a really friendly but completely useless error message")
End Try
will result in pain for future developers - DON'T DO IT!
When you verify your database it might tell you that it is up to date, in that case you have two more options to check for:
a) Refreshing the report (a lightning-shaped icon), if you have a problem with a field, such as a SQL Field, it will give you the error and then show you the edit window for the field.
b) Running the query directly on SQL, if there is a problem with the query itself you will also get this message in Crystal but SQL will tell you exactly what went wrong.
Check Changing Crystal Report Database logon information at runtime in VS2005 for help.
Important line in it is:
table.Location = Database & ".dbo." & table.Name
For me, the problem was fixed when I logged of and logged back to the SQL server that the report was connecting to
In your store procedure If you are using
SET NOCOUNT ON;
Then just remove this
--SET NOCOUNT ON;
Now verify your report database, build & run your solution.