all groups > sql server reporting services > september 2007 >
You're in the

sql server reporting services

group:

Reporting Services and ASP 3.0?



Re: Reporting Services and ASP 3.0? Norman Yuan
9/26/2007 5:22:23 PM
sql server reporting services: If you can make web service call from your ASP3.0 app, then you can get
report from SQL Server reporting service. SQL Server RS itself provides web
services that you can use to access reports. You can consume RS's web
services at

http://ServerName/reportserver/reportservice.asmx

With this service, you call Render() method to get a report rendered as
binary data stream (in specified format, PDF, XLS, HTML..), which you can
save to file system, or send back to client's web browser. You can also call
other methods to, say, list all available reports' name for user to choose
for downloading.


[quoted text, click to view]
Reporting Services and ASP 3.0? Don Miller
9/26/2007 6:51:03 PM
I currently use Crystal Reports RDC that is called from an ASP 3.0 page
(actually, the ASP page calls my custom VB COM+ code which then calls then
RDC), supplies a CustomerID as a parameter to generate a report (e.g. on one
customer) that is then exported as a PDF file and saved to the filesystem on
the server. That PDF is then available for download by end-users in my web
application (i.e. as a link). Since the move to Win2003/SQL Server 2005 one
of the Crystal components is misbehaving and I'd like to move this report
entirely to SSRS.

However, my entire web application is classic ASP 3.0 (and will not be
changing anytime soon). So what I'd like to do is call a web service with a
parameter from my ASP 3.0 page (e.g. CustomerID), have the web service
generate the report, save the PDF file on the server, and return back to the
ASP page the path to the PDF file. Except I don't know how to do this and
cannot find any examples of using ASP 3.0 with SSRS. I can probably do some
limited ASP.NET 2.0 programming to create the web service but need help
doing that (if necessary).

Can someone please direct me to examples of how to use ASP 3.0 and SSRS
together? Or tell me if I'm going about it the wrong way (e.g. do I even
need to save the PDF on the server)?

Thanks for any help or direction.

Re: Reporting Services and ASP 3.0? Don Miller
9/26/2007 10:42:50 PM
Thanks for the pointer.

But how do I specify where the PDF file is created (or is that hard-coded
into the web service?)?

And how would I get back the physical path (including filename) of the PDF
file?

I'm really new at web services and I realize these questions may be naive.
Thanks again.

[quoted text, click to view]

Re: Reporting Services and ASP 3.0? Bruce L-C [MVP]
9/27/2007 12:00:00 AM
Unless you need to I would not go to PDF. RS can render in multiple ways but
PDF and Excel are the slowest. It is not saving the file anywhere, it is
streaming it to you.

You can integrate in two ways, web services or URL integration. If you use
URL integration (the easiest) then the user can get the full benefit of the
server including printing support and they have have html output as the
rendering type which is much much faster than pdf. In books online the
documentation is quite good (RS 2005). If you are using RS 2000 then go to
the MS site and look at the books on line there for RS 2005. URL integration
has not changed between versions. For example, here is an example URL that
sends a parameter. Your app would just assemble the URL. I strongly
recommend starting this way. Otherwise I see a very large learning curve for
you. You need to learn and understand Reporting Services. With URL
integration you can concentrate on that without worrying about webservices
from asp 3.0 website.

Here are some quick examples. I show below different rendering as well:
Excel, PDF and the default HTML.
This renders as Excel

http://servername/reportserver?/Sales/YearlySalesSummary&rs:Format=ExcelThis
renders as PDF and passes a parameter for the year

http://servername/reportserver?/Sales/YearlySalesSummary&Year=2006&rs:Format=PDFThis
renders as HTML (the speediest) which is the default if nothing is
specified.

http://servername/reportserver?/Sales/YearlySalesSummary&Year=2006When
integrating with older technology URL integration in my mind is the way to
go.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]

Re: Reporting Services and ASP 3.0? EMartinez
9/27/2007 12:56:17 AM
[quoted text, click to view]


You can either iFrame a connection to the Report Server and/or you can
access a report and export it to a predefined format via URL from
within ASP 3.0. Here's an example of calling a report and exporting it
to PDF and separately to Excel.
http://SomeServerName/reportserver?/SomeReportFolder/SomeReportName&rs:Command=Render&Param1=ParamValue&rs:Format=PDF
http://SomeServerName/reportserver?/SomeReportFolder/SomeReportName&rs:Command=Render&Param1=ParamValue&rs:Format=Excel
Here's the URL format:
http://<ServerName>/reportserver?/<Directory>/<ReportName>&rs:Command=Render&<ParameterName>=<ParameterValue>&rs:Format=<PDF/CSV/XML/Excel/MHTML>
Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
Re: Reporting Services and ASP 3.0? Don Miller
9/27/2007 10:15:46 AM
Thanks for your time putting this together and your advice.

Unfortunately, I do "need" a PDF as a file that can be downloaded and saved
to device (disk, network share, flash drive, etc.) by my customers for their
permanent and legal records (I tell them to right-click my link and "Save
Target As..." to do the save, rather than rely on Adobe Reader Disk Save
icon). This is a fundamental business requirement.

Also, the report is usually 8-10 page long and contains about a dozen
sub-reports all with different and intricate formatting that cannot be
duplicated with HTML (even if I wanted to save in that format). And it does
currently takes about 5-10secs to generate (it basically takes ALL the
information about a customer in the database and exports it).

So, if I understand you, even in the best of circumstances, the exported PDF
document is not ever saved physically to disk on the server? This might
still work as long as my customer *could* save it with Adobe Reader in the
browser.

[quoted text, click to view]

Do you know of anyone who has already climbed that mountain who I could
contract to provide the framework for accessing exported PDF files from SSRS
from ASP 3.0?

And if you don't, do you know of any other references that I could begin
climbing?


[quoted text, click to view]

Re: Reporting Services and ASP 3.0? Bruce L-C [MVP]
9/27/2007 11:05:41 AM
If you use URL integration you get the full Report Manager (the portal that
ships with RS) interface. This allows the user to save as in any of the
formats. So, they get very fast html for viewing and they can save as they
want when they want in a variety of formats. IF you pick PDF (which the
example showed) then what happens is the PDF is viewed in the browser. They
can save or they can export as PDF.

Nothing prevents you from using PDF as your design target. There are
definitely things you can do in PDF that you cannot do in html format.
However, when developing this means you will need to do lots of deploying
and viewing. The development environment preview is html.

You are a little stuck with how the previous environment worked. RS is
streaming the result back to the browser. The browser is the target. You can
change the rendering format but it still gets streamed to the browser
whether it is Excel, PDF, html, image whatever and then IE determines how to
handle it. PDF will get a File Download box. If you want to save to disk on
the server your app would have to take the stream and write it to disk.

You also with URL integration have control over which parts of the screen to
show, for instance the parameter section. RS comes with the ability to
export in multiple formats and to print.

My suggestion is that before you go too much further worry about how to
integrate that you first learn about RS. Create a few simple (very simple)
reports. Try creating the URL and just typing it into the browser. Do
different things by modifying the URL. Save your example URLs off. Once you
know the capabilities of doing this you can decide if you need to go more
extreme and implement web services.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]
Re: Reporting Services and ASP 3.0? Don Miller
9/27/2007 11:33:03 AM
Thanks. I certainly am stuck in the mindset I've had and used successfully
for the last seven years. Time to change maybe.

Although saving the report as PDF to a device is optional (but necessary),
most of my customers click on the link to the PDF file (on the server) on my
web page and it loads into Adobe Reader plug-in and they simply print out
the PDF document and save *that* paper as their permanent record. So, a
"file download" box appearing first would not be a good thing for most
customers (but I assume there will be an Open instead option with
configuration of the response headers???).

I actually do NOT want to expose my customers to the full Report Manager at
all or give them options to save the report in any other format. They just
want one thing and many of my end-users would be overwhelmed by anything
other than "click here" to view the report. These are not business people
and many only have high-school diplomas and "variety" is not good.

Nevertheless, I'll take your seasoned advice and play around a bit. But with
this and all the hacking that has to be done (no Report Headers/Footers
without tricks, hidden parameters, no Fields in Page Headers, no tabs, no
document size editing, etc.) to recreate a Crystal Reports report, I may be
going right back to CR. I hope not though.


[quoted text, click to view]
Re: Reporting Services and ASP 3.0? Don Miller
9/27/2007 12:12:30 PM
After very brief playing, with the complete URL, this may indeed work (and
save me the trouble of deleting PDFs off the server every night - with a BAT
file ;) BUT I need to have the default filename to be saved to be specific
when folks save the exported file (see other Topic I've posted).

It's always something ;)

[quoted text, click to view]
Re: Reporting Services and ASP 3.0? EMartinez
9/28/2007 1:17:01 AM
[quoted text, click to view]
ll:
Re: Reporting Services and ASP 3.0? Don Miller
9/28/2007 7:37:49 AM
Yes, I would like to use the URL method, but what you suggest (and how to do
it) is probably part of the steep learning curve I have not yet approached.
It's probably not so important to me anymore that I continue to write the
PDF to the server as long as the end-user can save it on their local machine
(which they can just using the URL method).

Again, it is still difficult to use SOAP with classic ASP 3.0 (there is
apparently a MS COM object that will no longer be supported in 2008 that
helps) and I'm probably out of my space (mind) to handcraft all of that in
ASP 3.0 to use the Reporting Service API.

Security is a major concern (that I've created another post in this
newsgroup) and I cannot make heads or tails about the issue in BOL.

I appreciate your assistance and expertise.


[quoted text, click to view]
Re: Reporting Services and ASP 3.0? EMartinez
9/29/2007 5:02:08 PM
[quoted text, click to view]
AddThis Social Bookmark Button