Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Generate multiple files from 1 run Post Reply Post New Topic
Author Message
jim33
Newbie
Newbie


Joined: 30 Jan 2009
Online Status: Offline
Posts: 8
Quote jim33 Replybullet Topic: Generate multiple files from 1 run
    Posted: 26 Feb 2010 at 5:47am

Is there a way to have a single Crystal report parm run  for multiple selected customers that would produce multiple pages that would actually create multiple individual files for its output? Perhaps in multiple PDF files?

Customers selected

Report runs - 1 page per customer is the output, but based on the customers selected it generates - for example 10 customers/10 pages; how can these 10 pages generate 10 PDF files from this single run?

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Mar 2010 at 6:32am
I don't have much experience with exporting files, but CR is not the brightest, it pretty sees a report as an entity and only exports the entire entity to some file format.  It doesn't understand splitting it up.
 
I think you are out of luck, but someone with more export experience might chime in with a different solution.
 
HTH
IP IP Logged
rdseal
Newbie
Newbie
Avatar

Joined: 18 Jun 2009
Online Status: Offline
Posts: 23
Quote rdseal Replybullet Posted: 01 Mar 2010 at 7:48am
I have just (nearly) finished a similar project.

I have created a report that grouped in particular order. when I am using Visual CUT 11 to burst my report into lots of small reports (per group specified earlier in the report). Then saved in special way in specified path for individual file (you can also email it if you need). Very simple and easy to use interface.

Read my original topic: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9201&PID=29165#29165

and don't forget to check out www.kenhamady.com/bookmarks.html. as that is where I found Visual Cut 11.

I know its not a free solution but I am considering to purchase it soon, when my 30 days evaluation is finished :) knowing that it will save me a lot more in the long run (I hope.)

If you find something cheaper or a free ap please let me know.

Hope it will help.

read read read
IP IP Logged
johnstaj
Newbie
Newbie
Avatar

Joined: 15 Dec 2011
Online Status: Offline
Posts: 2
Quote johnstaj Replybullet Posted: 15 Dec 2011 at 8:45pm

·         Please refer to the following VB.Net code for exporting to seperate pdf files.

·         Dim rdoc As New ReportDocument

·         '------------------------------------

·         'Add your code to set rdoc object

·         '--------------------------------------

·             Dim exportOpts As ExportOptions = New ExportOptions()
    Dim pdfRtfWordOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
    Dim destinationOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
        For li_count As Integer = 1 To pagecount
            pdfRtfWordOpts.FirstPageNumber = li_count
            pdfRtfWordOpts.LastPageNumber = li_count
            pdfRtfWordOpts.UsePageRange = True
            exportOpts.ExportFormatOptions = pdfRtfWordOpts
            exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat

            destinationOpts.DiskFileName = "D:\report File" & li_count & ".pdf"
            exportOpts.ExportDestinationOptions = destinationOpts
            exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
            rdoc.Export(exportOpts)

        Next

Please let me know the result.

IP IP Logged
VandalHeart
Newbie
Newbie
Avatar

Joined: 15 Mar 2012
Location: Italy
Online Status: Offline
Posts: 2
Quote VandalHeart Replybullet Posted: 15 Mar 2012 at 6:08am
@johnstaj:
Thanks for your code, it works grat. My problem is a little different, i need to export in pdf making a file for each group but i don't know how many page is the report in each group, can you help me please?
IP IP Logged
johnstaj
Newbie
Newbie
Avatar

Joined: 15 Dec 2011
Online Status: Offline
Posts: 2
Quote johnstaj Replybullet Posted: 18 Mar 2012 at 11:06pm
Hi,

You need to create separate pdf files for each group.

Suppose Dt_Group (datatable) contains all the required groups and its unique ids
        Dim exportOpts As ExportOptions = New ExportOptions()
        Dim pdfRtfWordOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
        Dim destinationOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
pdfRtfWordOpts.UsePageRange  = False
            exportOpts.ExportFormatOptions = pdfRtfWordOpts
            exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat


for Li_count as integer=0 to Dt_Group.rows.count-1
           rdoc.setDatasource(Dataset) 'create new dataset for each Group
            destinationOpts.DiskFileName = "D:\report File" & "group name" & ".pdf"
            exportOpts.ExportDestinationOptions = destinationOpts
            exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
            rdoc.Export(exportOpts)


next


IP IP Logged
VandalHeart
Newbie
Newbie
Avatar

Joined: 15 Mar 2012
Location: Italy
Online Status: Offline
Posts: 2
Quote VandalHeart Replybullet Posted: 19 Mar 2012 at 4:27am
Thanks a lot for your attention, your post is very useful, i've decided to get the group nome via vb.net, so i launch the report and export it for every groups because there are other conditions to care about when grouping.
IP IP Logged
howardW
Newbie
Newbie
Avatar

Joined: 20 Mar 2012
Location: United States
Online Status: Offline
Posts: 2
Quote howardW Replybullet Posted: 20 Mar 2012 at 12:35pm
Jim -
 
I use VisualCut from Millet Software for exactly this purpose.... It can burst a report into multiple individual reports based on fields in your report.
 
So if you had 20 customers you could create 20 reports and put them into folders for each customer like this
 
C:\
     {Cust_name}.{Cust_number}\invoice_{due_date}.pdf
 
You'd end up with
 
c:\JoesHardware.12345\invoice_12-2-2011.pdf
c:\Toms Taxi.98765\invoice_11-12-2011.pdf
 
And so on
 
Note; i do not own or have any financial interest in the software, just a happy user!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.