cancel
Showing results for 
Search instead for 
Did you mean: 

Export one PDF per record?

Former Member
0 Kudos

I have a data source with lots of records.  My report generates multiple pages for each record.  How can I export one PDF file for each record in the datasource?

If doing it programatically is the only way, that is okay too.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Programmatically or from the designer, it will be the same; Selection formulas. Pass in the record you want to export, and that will be in your PDF. In an app this would be more efficient as you could loop through and just keep on exporting each record one after the other. If you need resources re. app development, please post your query to the SAP Crystal Reports, version for Visual Studio discussion forum.

- Ludek

Former Member
0 Kudos

Thanks Ludek.  I was hoping to be able to point it at the database with a query that returns the 2192 (approx.) records that need to be processed, and let it generate 2192 PDF files.

Obviously, manually doing them one-by-one is not an option.

So, do I need to do it in an app?

ido_millet
Active Contributor
0 Kudos

At least one of the 3rd-party Crystal Reports schedulers listed at http://kenhamady.com/bookmarks.html provides bursting functionality so you can automatically generate the 2192 PDF files in a single pass.

former_member183750
Active Contributor
0 Kudos

Hi Glen

Yeah, I figured that's what you'd want to do. Unfortunately, app will be the way to go. And it will not need to be a big app. I'd say, as little as 10 lines of code should do the trick. The pseudo code would be something like:

  1. Load report (one line of code)
  2. logon to database (15 +/- lines of code - if you are changing the DB. If original DB, one line of code)
  3. pass in selection formula (one line of code)
  4. export to pdf (one line of code)

loop through (4) and (5) for the number of records / exports we want.

And we do have sample apps and more that will help. If you want more info re. the app, please post them to that SAP Crystal Reports, version for Visual Studio forum. Not that I am trying to be difficult, but in this way, we'll keep things a little bit organized .

- Ludek

Former Member
0 Kudos

Thanks. 

While waiting for a response, I just finished writing a short C# command-line program that does this exactly.  It also does other things, like updating each record as it gets written out, etc.

If you can move this thread to the VS forum, that would be great.

Answers (0)