Monday, April 16, 2012

SSRS Reporting in a Java Web Site

For the last 6 months or so, I have been working on a project with our web application development team to integrate SSRS reporting into our client facing Java web site.

When I first proposed this project, I knew that in theory this should work fine. But, it did take a bit of research and a lot of work to bring it to fruition.

We are moving into the testing phase this week, and I am happy to say that it works very well! The Java developer working on this is doing a great job of translating all of my Microsoft talk to java :)

We are using the Web Services provided by SSRS with a custom security extension that authenticates against our web site security.

Since we are only rendering one page at a time, rendering is pretty quick, taking less than a second a page to render.

Once we go thru testing and release, I am going to write more on this, including some details.

8 comments:

Tyler said...

Definitely keen on hearing more about this. I've done some embedding of reports in web applications just using the img html tag that points back to the report servers img version of the report. It works well, but users have to authenticate with the report server each time they load up the page. I use javascript to pull the image in every 20 seconds to update the report. Look forward to hearing more about what you're doing!

ramakrishna said...

Hi, i'm able to create report using url. but how to use in java web application.

Bob Pearson said...

We used the web services provided by ssrs. Using it thru Java was a little tricky, but the web service calls are pretty well documented here: http://msdn.microsoft.com/en-us/library/aa274396(v=SQL.80).aspx

Anonymous said...

Hi i'm able to integrate and generate report using servlet/web service with SSRS, but i'm getting the reports in the form of images. not able to get tool bar(pagination, serach filter,save option etc.)

Bob Pearson said...

Using the web services, you will have to create your own tool bar, save option, export, etc. The web services provide no user interface, just the methods needed to support these items.


When you generate the report via the web services, you pass the format to the Render method. The format can be any of the rendering extensions you have installed on your reporting server. (i.e. EXCEL, HTML4.0, etc)

Deeps said...

I am consuming SSRS webservice with java app. I am able to get the reports from SSRS in HTML 4.0 format. I am able to send the parameters from java and get associated reports.

My issues are:
1.I am not able to get the charts associated with reports. I tried using renderStream method to get the chart but still I am not able to get the chart.

2. I understand for the toolbar I need to create a UI and integrate it with SSRS web Service functions. My question is which functions do I need to use.
for eg. For Pagenation on SSRS reportViewer, Which functions in web service do I call.
another example .. Export icon.. for that should I call the render method with different format options.

Bob Pearson said...

I am going to answer just a bit... To control which page you get, in the DeviceInfo XML string in the Render call, add a Node called Section and use that to set the page to return. Here is an example:
< Section>1< /Section>
That returns page 1.

For the charts, you also have to set the StreamRoot node in the DeviceInfo.

This is a C# example, but the java thought is the same.

< StreamRoot>" + this.BaseSiteUrl + "< /StreamRoot>

Then when you pull the streams using render streams, you write them to the same folder as the StreamRoot. Then the charts are rendered correctly.

And yes, for the export, you just call render again, with the renderer name as defined in the RSReportServer.config file.

Hope that helps!!

Anonymous said...

I am using java and SSRS and I am trying to get drill down reports.
I do get the report results but when clicking +/- in report result, I get an error( I rsReportParameterValueNotSet).

I am setting up the parameter value initially in order to get the report result.My code is below for parameter setting

ParameterValue[] parameters = new ParameterValue[1];
parameters[0] = new ParameterValue();
parameters[0].setName("country");
parameters[0].setValue(india);