Showing posts with label ssrs. Show all posts
Showing posts with label ssrs. Show all posts

Monday, March 19, 2012

Generating letters in SSRS

Hi. I'm looking for tutorials on how to use SSRS 2005 to generate letters in Word or PDF format from a database. We need to send letters with our company logo and some boilerplate text to a set of companies based on a SQL Server query. So the letter will look something like this, with the red areas repeating from the dataset,

[logo goes here]


123 Any St.
AnyCity, CA 90210

[today's date]

Dear [name from database],

Some boilerplate text goes here. Your Account [account number from database] is past due.

Sincerely,

[scanned signature goes here]

Somebody


Don't have a tutorial but here are the high-level steps:

1. Use the Data tab to create a dataset that returns on record with all fields required.

2. On the Layout tab, drop a List data region and add textboxes in it to hold the content.

3. Type in fixed text in the approapriate textboxes.

4. You can concatenate text in textboxes as needed, e.g.: = "Dear " & Fields!Name.Value

Friday, March 9, 2012

Generate thousands of SSRS PDFs programmatically with SP or SSIS

I have a report that I'd like to involve in delivering tons of PDFs for each
of our customers for a billing cycle. There is a table that the report reads
from that gives it all its data necessary for the report (which is a customer
bill) and the table also has a column that has the file name for the PDF for
that particular customers bill for the report. Basically each table row
represents one output report (bill) and each table row has its name nicely
formated for me. Writing the report is not a problem. Figuring out how to
run through thousands of rows generating a PDF for each with the file name
from the table is my challenge.
I would like to create either a SP or a SSIS package (that is scheduled)
that can run a report for each line of data in my table and spit out a PDF
file to a UNC path. It might have to generate thousands of PDFs to a UNC
path that has plenty of space. There will be another SSIS package that
moves the PDFs later to their proper directory.
So, is there someone who has done this before? Any suggestions? Is there a
quick path to doing this, would it take a ton of time? Any tutorials out
there?
Thanks,
Keith
p.s. My preference is to do this in SP's or SSIS and if I need a .NET
language to do that in VB.NET, but I'd rather avoid that if I can.hi,
i had a similar problem and found an easy solution: just create a new
subsciption in reporting services and specify the UNC-output-path and the
column that contains the filename. then schedule the subsciption to run every
night.
"greenmtnsun" wrote:
> I have a report that I'd like to involve in delivering tons of PDFs for each
> of our customers for a billing cycle. There is a table that the report reads
> from that gives it all its data necessary for the report (which is a customer
> bill) and the table also has a column that has the file name for the PDF for
> that particular customers bill for the report. Basically each table row
> represents one output report (bill) and each table row has its name nicely
> formated for me. Writing the report is not a problem. Figuring out how to
> run through thousands of rows generating a PDF for each with the file name
> from the table is my challenge.
> I would like to create either a SP or a SSIS package (that is scheduled)
> that can run a report for each line of data in my table and spit out a PDF
> file to a UNC path. It might have to generate thousands of PDFs to a UNC
> path that has plenty of space. There will be another SSIS package that
> moves the PDFs later to their proper directory.
> So, is there someone who has done this before? Any suggestions? Is there a
> quick path to doing this, would it take a ton of time? Any tutorials out
> there?
> Thanks,
> Keith
> p.s. My preference is to do this in SP's or SSIS and if I need a .NET
> language to do that in VB.NET, but I'd rather avoid that if I can.|||I don't think I understand how your suggestion could work.
I see nothing on the subscription that allows me to specify a column in a
table that assigns a file name. Perhaps there is a way to use an expression
but I don't know about it.
More importantly I also see nothing that allows me to tell this subscription
that it needs to create one PDF per customer. There is no looping mechanism.
Were you suggesting I create a schedule for EVERY customer? If so, I can't
do that.
Did I miss something?
Keith
"csc67" wrote:
> hi,
> i had a similar problem and found an easy solution: just create a new
> subsciption in reporting services and specify the UNC-output-path and the
> column that contains the filename. then schedule the subsciption to run every
> night.
> "greenmtnsun" wrote:
> > I have a report that I'd like to involve in delivering tons of PDFs for each
> > of our customers for a billing cycle. There is a table that the report reads
> > from that gives it all its data necessary for the report (which is a customer
> > bill) and the table also has a column that has the file name for the PDF for
> > that particular customers bill for the report. Basically each table row
> > represents one output report (bill) and each table row has its name nicely
> > formated for me. Writing the report is not a problem. Figuring out how to
> > run through thousands of rows generating a PDF for each with the file name
> > from the table is my challenge.
> >
> > I would like to create either a SP or a SSIS package (that is scheduled)
> > that can run a report for each line of data in my table and spit out a PDF
> > file to a UNC path. It might have to generate thousands of PDFs to a UNC
> > path that has plenty of space. There will be another SSIS package that
> > moves the PDFs later to their proper directory.
> >
> > So, is there someone who has done this before? Any suggestions? Is there a
> > quick path to doing this, would it take a ton of time? Any tutorials out
> > there?
> >
> > Thanks,
> > Keith
> >
> > p.s. My preference is to do this in SP's or SSIS and if I need a .NET
> > language to do that in VB.NET, but I'd rather avoid that if I can.|||Hi Keith,
sorry for being a little bit short on details but memory fades in time...
What you need to do is to define a datadriven subsciption. this doesn´t work
with windows-authentication in your reports connection-string. instead store
a user and password on report server (report properties, data source).
In step 1 of the datadriven subsription you define that the reports are to
be stored in the filesystem. in step 2 leave a connection string. here you
can store windows-credentials for a (super-) user. step 3 is were you then
define a sql query witch returns (at least) the filename plus
report-parameters. More possible fields to generated here and use in step 4
are: the UNC-path or the renderformat (a different for each customer for
example). the user and password provided on this page are for writing files
into the filesystem.
in step 5 you can then match report-parameters with your query from step 3
and finally define a schedule.
have fun!
"greenmtnsun" wrote:
> I don't think I understand how your suggestion could work.
> I see nothing on the subscription that allows me to specify a column in a
> table that assigns a file name. Perhaps there is a way to use an expression
> but I don't know about it.
> More importantly I also see nothing that allows me to tell this subscription
> that it needs to create one PDF per customer. There is no looping mechanism.
> Were you suggesting I create a schedule for EVERY customer? If so, I can't
> do that.
> Did I miss something?
> Keith
> "csc67" wrote:
> > hi,
> >
> > i had a similar problem and found an easy solution: just create a new
> > subsciption in reporting services and specify the UNC-output-path and the
> > column that contains the filename. then schedule the subsciption to run every
> > night.
> >
> > "greenmtnsun" wrote:
> >
> > > I have a report that I'd like to involve in delivering tons of PDFs for each
> > > of our customers for a billing cycle. There is a table that the report reads
> > > from that gives it all its data necessary for the report (which is a customer
> > > bill) and the table also has a column that has the file name for the PDF for
> > > that particular customers bill for the report. Basically each table row
> > > represents one output report (bill) and each table row has its name nicely
> > > formated for me. Writing the report is not a problem. Figuring out how to
> > > run through thousands of rows generating a PDF for each with the file name
> > > from the table is my challenge.
> > >
> > > I would like to create either a SP or a SSIS package (that is scheduled)
> > > that can run a report for each line of data in my table and spit out a PDF
> > > file to a UNC path. It might have to generate thousands of PDFs to a UNC
> > > path that has plenty of space. There will be another SSIS package that
> > > moves the PDFs later to their proper directory.
> > >
> > > So, is there someone who has done this before? Any suggestions? Is there a
> > > quick path to doing this, would it take a ton of time? Any tutorials out
> > > there?
> > >
> > > Thanks,
> > > Keith
> > >
> > > p.s. My preference is to do this in SP's or SSIS and if I need a .NET
> > > language to do that in VB.NET, but I'd rather avoid that if I can.

Generate thousands of SSRS PDFs programmatically with SP or SSIS

I have a report that I'd like to involve in delivering tons of PDFs for each of our customers for a billing cycle. There is a table that the report reads from that gives it all its data necessary for the report (which is a customer bill) and the table also has a column that has the file name for the PDF for that particular customers bill for the report. Basically each table row represents one output report (bill) and each table row has its name nicely formated for me. Writing the report is not a problem. Figuring out how to run through thousands of rows generating a PDF for each with the file name from the table is my challenge.

I would like to create either a SP or a SSIS package (that is scheduled) that can run a report for each line of data in my table and spit out a PDF file to a UNC path. It might have to generate thousands of PDFs to a UNC path that has plenty of space. There will be another SSIS package that moves the PDFs later to their proper directory.

So, is there someone who has done this before? Any suggestions? Is there a quick path to doing this, would it take a ton of time? Any tutorials out there?

Thanks,
Keith

p.s. My preference is to do this in SP's or SSIS and if I need a .NET language to do that in VB.NET, but I'd rather avoid that if I can.

Yes, I am actually doing something similar in SSIS with reports.

I'm not generating thousands of them, but I am calling into RS and saving out a PDF file at the end of a process, from withinthe SSIS package. Earlier in the package there is some loop processing where I'm building and saving multiple files to disk, that part isn't a problem for you I'm sure. It was hard for me, but I'm not really very knowledgeable about SSIS <g>. You sound like you like it!

I use package variables to hold the various things I need from RS, and another variable for the output dir... which I use if the derived output file name doesn't come complete with a full path.

NB: I'm using URL Access, because I see absolutely no advantage to using SOAP for this. IOW, I just used a straight script (not ActiveX Script) task, not a Web Service task. Your mileage may vary.

The actual VB.NET code I use in the script task is a variant of what I posted in this thread. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1718577&SiteID=1 -- you'll even see the Dts variables referenced there <s>.

The only real "gotcha" I've found with this approach in SSIS (the URL Access part I mean) is building up the request URL properly with parameters, without having an ampersand mistakenly encoded or something from having been stored in the package variable. It's handleable and I'm not sure you even indicated that you need to worry about this. I think you'll see that hack in the code snippet in the thread referenced above.

So... Which part is really bothering you? The scaleability aspect, or ensuring rights to the output path, passing the credentials to the reporting server, or what? If it's the credentials I'm not really expert with that either but the same techniques are going to work as you would use *outside* of SSIS, in any VB.NET app that calls out to RS.

>L<

|||If you are using SSRS Enterprise, you should look into using "Data Driven Subscriptions". It sounds like that is exactly what you need. Creating an SSIS package to do what you're talking about would probably be overkill since the feature is out of the box with SSRS.

Here's a link to get you started:

http://technet.microsoft.com/en-us/library/ms159150.aspx
|||

I'm not sure it's overkill. I guess it depends on what you're comfortable with and where you want to do the work.

* -- the OP is already using a separate package to move the files after creation. This argues for a combined process, to make sure that things happen in the right sequence.

* -- the OP is concerned about scaleability (I have asked him/her for details, and it may be justified or not; we can't say). IAC the point is that moving the behavior out of RS may be legitimate as a way of moving some of the activity to a different box.

It's definitely do-able either way ...

>L<

Generate thousands of SSRS PDFs programmatically with SP or SSIS

I have a report that I'd like to involve in delivering tons of PDFs for each of our customers for a billing cycle. There is a table that the report reads from that gives it all its data necessary for the report (which is a customer bill) and the table also has a column that has the file name for the PDF for that particular customers bill for the report. Basically each table row represents one output report (bill) and each table row has its name nicely formated for me. Writing the report is not a problem. Figuring out how to run through thousands of rows generating a PDF for each with the file name from the table is my challenge.

I would like to create either a SP or a SSIS package (that is scheduled) that can run a report for each line of data in my table and spit out a PDF file to a UNC path. It might have to generate thousands of PDFs to a UNC path that has plenty of space. There will be another SSIS package that moves the PDFs later to their proper directory.

So, is there someone who has done this before? Any suggestions? Is there a quick path to doing this, would it take a ton of time? Any tutorials out there?

Thanks,
Keith

p.s. My preference is to do this in SP's or SSIS and if I need a .NET language to do that in VB.NET, but I'd rather avoid that if I can.

Yes, I am actually doing something similar in SSIS with reports.

I'm not generating thousands of them, but I am calling into RS and saving out a PDF file at the end of a process, from withinthe SSIS package. Earlier in the package there is some loop processing where I'm building and saving multiple files to disk, that part isn't a problem for you I'm sure. It was hard for me, but I'm not really very knowledgeable about SSIS <g>. You sound like you like it!

I use package variables to hold the various things I need from RS, and another variable for the output dir... which I use if the derived output file name doesn't come complete with a full path.

NB: I'm using URL Access, because I see absolutely no advantage to using SOAP for this. IOW, I just used a straight script (not ActiveX Script) task, not a Web Service task. Your mileage may vary.

The actual VB.NET code I use in the script task is a variant of what I posted in this thread. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1718577&SiteID=1 -- you'll even see the Dts variables referenced there <s>.

The only real "gotcha" I've found with this approach in SSIS (the URL Access part I mean) is building up the request URL properly with parameters, without having an ampersand mistakenly encoded or something from having been stored in the package variable. It's handleable and I'm not sure you even indicated that you need to worry about this. I think you'll see that hack in the code snippet in the thread referenced above.

So... Which part is really bothering you? The scaleability aspect, or ensuring rights to the output path, passing the credentials to the reporting server, or what? If it's the credentials I'm not really expert with that either but the same techniques are going to work as you would use *outside* of SSIS, in any VB.NET app that calls out to RS.

>L<

|||If you are using SSRS Enterprise, you should look into using "Data Driven Subscriptions". It sounds like that is exactly what you need. Creating an SSIS package to do what you're talking about would probably be overkill since the feature is out of the box with SSRS.

Here's a link to get you started:

http://technet.microsoft.com/en-us/library/ms159150.aspx
|||

I'm not sure it's overkill. I guess it depends on what you're comfortable with and where you want to do the work.

* -- the OP is already using a separate package to move the files after creation. This argues for a combined process, to make sure that things happen in the right sequence.

* -- the OP is concerned about scaleability (I have asked him/her for details, and it may be justified or not; we can't say). IAC the point is that moving the behavior out of RS may be legitimate as a way of moving some of the activity to a different box.

It's definitely do-able either way ...

>L<

Sunday, February 26, 2012

Generate Report Direct to PDF

Hello All,
I have been asked to find a solution for generating an SSRS report
directly to PDF without the client ever viewing it. There are a couple of
particualrs about our requirements:
1. The report is being called from a third party piece of software
2. We have no, or at most, very limited control of this third party app
(some URL control possible)
3. The location the PDF is to be generated to is static
Any information, links, articles, sample code would be muy, muy appreciated
Gracias
Michael CReporting Services provides a set of Web Services that you can use to get
find targeting report, render it as binery stream in one of the output
format (PDF, XLS, HTML...).
You can simply wite an application to call corresponding web methods of the
reporting services. This application can be any type: desktop, web app or
even Windows services..., based on your need.
I have no idea how the said third part app calls the report. But it is
fairly simple to build a ASP.NET app, which works this way (you need to set
web reference to the report server and know how to consume web services in
your app):
1. User is presented a web page, which allow he to select a report and enter
required report parameters, his email address is also collected, where the
report would be sent to in the format of his choice (PDF, XLS...);
2. When the user submit the web form to server, one of the web methods of
the reporting services is called to render the requested report into binary
stream (PDF or XLS...) and returnd to ASP.NET app;
3. The binary stream of the report is saved to a temporary location on the
ASP.NET app server;
4. The ASP.NET app compose an email, attach the saved report, send the email
to user's email address.
After step 2, of course, you can also stream back the report binary data to
user's browser, in this can, user's browser would prompt user with a
download dialog box. User can choose either open it or save it.
"Michael C" <MichaelC@.discussions.microsoft.com> wrote in message
news:C75284F9-60BA-415C-8D2D-CB41F245A232@.microsoft.com...
> Hello All,
> I have been asked to find a solution for generating an SSRS report
> directly to PDF without the client ever viewing it. There are a couple of
> particualrs about our requirements:
> 1. The report is being called from a third party piece of software
> 2. We have no, or at most, very limited control of this third party app
> (some URL control possible)
> 3. The location the PDF is to be generated to is static
> Any information, links, articles, sample code would be muy, muy
> appreciated
> Gracias
> Michael C|||Thanks Norman,
I'm not too familiar with ASP.NET but necessity is the mother of
invention! Ill give this a shot.
Michael C
"Norman Yuan" wrote:
> Reporting Services provides a set of Web Services that you can use to get
> find targeting report, render it as binery stream in one of the output
> format (PDF, XLS, HTML...).
> You can simply wite an application to call corresponding web methods of the
> reporting services. This application can be any type: desktop, web app or
> even Windows services..., based on your need.
> I have no idea how the said third part app calls the report. But it is
> fairly simple to build a ASP.NET app, which works this way (you need to set
> web reference to the report server and know how to consume web services in
> your app):
> 1. User is presented a web page, which allow he to select a report and enter
> required report parameters, his email address is also collected, where the
> report would be sent to in the format of his choice (PDF, XLS...);
> 2. When the user submit the web form to server, one of the web methods of
> the reporting services is called to render the requested report into binary
> stream (PDF or XLS...) and returnd to ASP.NET app;
> 3. The binary stream of the report is saved to a temporary location on the
> ASP.NET app server;
> 4. The ASP.NET app compose an email, attach the saved report, send the email
> to user's email address.
> After step 2, of course, you can also stream back the report binary data to
> user's browser, in this can, user's browser would prompt user with a
> download dialog box. User can choose either open it or save it.
>
> "Michael C" <MichaelC@.discussions.microsoft.com> wrote in message
> news:C75284F9-60BA-415C-8D2D-CB41F245A232@.microsoft.com...
> > Hello All,
> > I have been asked to find a solution for generating an SSRS report
> > directly to PDF without the client ever viewing it. There are a couple of
> > particualrs about our requirements:
> >
> > 1. The report is being called from a third party piece of software
> > 2. We have no, or at most, very limited control of this third party app
> > (some URL control possible)
> > 3. The location the PDF is to be generated to is static
> >
> > Any information, links, articles, sample code would be muy, muy
> > appreciated
> >
> > Gracias
> > Michael C
>|||You mentioned URL access. You can easily tell reporting services to execute
a report to PDF format by using URL access from you third party application.
When you call the desired report add to the calling URL this name=value pair
" &rs:Format=PDF" (no quotes of course).
--
Thanks, Jim
"Michael C" wrote:
> Thanks Norman,
> I'm not too familiar with ASP.NET but necessity is the mother of
> invention! Ill give this a shot.
> Michael C
>
> "Norman Yuan" wrote:
> > Reporting Services provides a set of Web Services that you can use to get
> > find targeting report, render it as binery stream in one of the output
> > format (PDF, XLS, HTML...).
> >
> > You can simply wite an application to call corresponding web methods of the
> > reporting services. This application can be any type: desktop, web app or
> > even Windows services..., based on your need.
> >
> > I have no idea how the said third part app calls the report. But it is
> > fairly simple to build a ASP.NET app, which works this way (you need to set
> > web reference to the report server and know how to consume web services in
> > your app):
> >
> > 1. User is presented a web page, which allow he to select a report and enter
> > required report parameters, his email address is also collected, where the
> > report would be sent to in the format of his choice (PDF, XLS...);
> >
> > 2. When the user submit the web form to server, one of the web methods of
> > the reporting services is called to render the requested report into binary
> > stream (PDF or XLS...) and returnd to ASP.NET app;
> >
> > 3. The binary stream of the report is saved to a temporary location on the
> > ASP.NET app server;
> >
> > 4. The ASP.NET app compose an email, attach the saved report, send the email
> > to user's email address.
> >
> > After step 2, of course, you can also stream back the report binary data to
> > user's browser, in this can, user's browser would prompt user with a
> > download dialog box. User can choose either open it or save it.
> >
> >
> > "Michael C" <MichaelC@.discussions.microsoft.com> wrote in message
> > news:C75284F9-60BA-415C-8D2D-CB41F245A232@.microsoft.com...
> > > Hello All,
> > > I have been asked to find a solution for generating an SSRS report
> > > directly to PDF without the client ever viewing it. There are a couple of
> > > particualrs about our requirements:
> > >
> > > 1. The report is being called from a third party piece of software
> > > 2. We have no, or at most, very limited control of this third party app
> > > (some URL control possible)
> > > 3. The location the PDF is to be generated to is static
> > >
> > > Any information, links, articles, sample code would be muy, muy
> > > appreciated
> > >
> > > Gracias
> > > Michael C
> >
> >