views:

95

answers:

4

We are considering migrating to Sql Server 2005 Reporting Services. Many of our existing reports require pre-processing of the data before rendering it.

For example, we have a query for a report that returns GPS coordinates (Latitude and Longitude) from a stored procedure, but before passing off the DataSet to our reporting engine (currently Crystal) we call out to a Web Service to reverse geocode the coordinates and get an address string. We push this into the DataSet object.

I've read a bit about Data Processing extensions but I'm not sure that's what I want, as then (if I understand correctly) I would need to implement the entire processing flow (including retrieving the data from the stored proc) just to massage it a bit at the end.

How can I interject and pre-process the dataset after retrieving it from the data source, but before passing it on to the renderer?

A: 

You could create a .NET assembly with a method in it that processes an individual record. Then, include that assembly in the report, and call that method when each row is being rendered. This would do the processing and display the result.

For instance, after creating the assembly and adding it to the report, you could have a table where one of the cell expressions looks like this:

=Code.ReverseGeocode(Fields!Latitude, Fields!Longitude)

See http://msdn.microsoft.com/en-us/library/ms155798.aspx for some guidance.

NYSystemsAnalyst
A: 

One option would be to use a ReportViewer control in local mode.

The data is loaded into ASP-NET, you can the pre-process it, then pass it to the control for presentation.

I'm not sure of how SSRS would deal with custom code/DLL when you want to process all data before thinking about presentation (as in the =Code.ReverseGeocode solution mentioned). RBAR feels wrong at the text box or cell level.

gbn
I agree the assembly suggestion feels wrong, however your answer seems very "manual" (not that that is so bad). In any case, can I do what you suggest while still accessing the report through Report Manager for example? Or even through URL Access (ala http://msdn.microsoft.com/en-us/library/ms153586.aspx)?
JPot
@JPot: As soon as your use URL access or Rpt Mgr, SSRS gets the data and renders. The RV control in local mode allows an intermediate step
gbn
A: 

I guess I don't understand why you just don't write the SQl to provide the data the way you want it. Can't you calculate the field through a function or use a where clause to filter the data further. You can do quite extensive data manipulation in a stored proc or query data source.

HLGEM
I don't believe I can. Do you know how to issue a SOAP request to a 3rd party Web Service to reverse geocode a pair of coordinates, *from within SQL Server*? I sure don't.
JPot
Since I don't know what that web service does, maybe not, but I've done extensive lat long caluations from within SQL Server using functions so I bet it could be done if you didn't feel as if you had to stay tied to some third party tool. I might also note, you didn't mention using a call to a third party tool or SOAP to do your processing in your question. That might be helpful to people trying to help solve your problem.
HLGEM
@HLGEM: Good point, I've updated the question to be more clear. Generally, reverse geocoding is handled by 3rd parties, often via Web Services for programmatic access.
JPot
+1  A: 

You can also use the results of an SSIS package as a data source (the package is executed on demand when the report runs).

This can be very helpful if you are trying to solve the problem of joining data from multiple data sources into a single dataset for example: a geocode web service and a relational result set.

I don't think a lot of people realize that this exists and how useful it is for handling EII type reports

JasonHorner