Link to home
Start Free TrialLog in
Avatar of bmccleary
bmccleary

asked on

Access reporting services report via URL and get raw HTML or XML output

I want to enable a monitoring system that we have (ServersAlive) to periodically check a report in SQL Reporting Services 2008 automatically.  I have it setup so that it checks a URL similar to the following and sees if the word "Failure" appears anywhere in the XML file:

http://reports.mycompany.com/ReportServer/Pages/ReportViewer.aspx?%2fReports%2fSQL+Server+Job+Status&rs:Command=Render&rs:Format=XML

This works perfectly when I set it up and continues to work for a period of time only after I check the actual report by through the RS interface by going to the following link:

http://reports.mycompany.com/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fSQL+Server+Job+Status

The problem is that after a certain period of time (normally a few hours), the first link stops working and starts returning an error stating "Execution '2qqtn2yhtrejup452tvznt55' cannot be found (rsExecutionNotFound)".  It's like there is a timeout issue or somehow the second link only works for a period of time after I go to the first link (like the first link is only accessing a snapshot of the report and not generating the report on the fly).

Basically, I need a way that I can point our monitoring application to a URL that generates a report on the fly, perferably in XML format.  I can't just point it to the second link, because the HTML from that page is just the report rendering viewer and not the report itself that would have the report data (and the word "Failure") in it.  Any help is appreciated.
Avatar of Chris Luttrell
Chris Luttrell
Flag of United States of America image

I think it has to do with the session either timing out or getting blocked (maybe by itself on a previous run)  see info at these links:
http://blogs.msdn.com/jgalla/archive/2006/10/11/session-timeout-during-execution.aspx
http://www.help-sql.info/27/7/637305.html
Avatar of bmccleary
bmccleary

ASKER

Yea... I saw that page to, but it has more to do with programtically accessing RS via .NET.  I just want to find out how I can have a simple link that can access the report data without all the report viewer junk (toolbar, page control, export button, etc.) in the way which blocks/hides the source of the report data.  Do you have any thoughts on how I can just bring up one URL to view the raw report?
ASKER CERTIFIED SOLUTION
Avatar of Chris Luttrell
Chris Luttrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just tried that (using the second link I posted) to no avail.  The toolbar (and all Reporting Services navigation/tabs) still appear.  I tried it with my first link, and it worked, but that may because I reestablished a session by going to the second link first.  John Gallardo mentiones that by not having that, it won't keep the session alive and getting rsExecutionNotFound errors.  That's what I want to avoid... I don't need to keep the session alive, but I do need the report to regenerate each time that link is hit and then dispose of itself without throwing rsExecutionNotFound errors.  I will wait a few more hours and see if it is still doing it (as it is fine right now).

By the way, thanks for all the help!
Your welcome, it helps me investigate and learn new things also.  Let me know your outcome.