Forgot password? | Forgot username? | Register

Duplicate Details in Report

Duplicate Details in Report

Has anyone created a Crystal Report that duplicates the detail section based on a value in a field?  As an example, this CSV:
irn, Description, NoOfLabels
123, baseball, 2
124, football, 5
125, basketball, 3

I'd want baseball to print twice, football 5 times, and basketball 3 times.

Bill

Bill Mertz
Database Manager
useravatar
Offline
22 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Duplicate Details in Report

Hi Bill,

Yes but there is some behind the scenes stuff that has to be done.  Axiell created a method for doing this by creating a custom report type based on a program they wrote called texxmlreplicate.  Either Axiell staff or someone with scripting expertise at your institution will have to create a very tiny script calling this program which tells it what field you wish to use for the number of duplicates.  What the program essentially does is to duplicate the data row the number of times specified in the field.  I gave a presentation on this at 3rd North American EMu Conference in NY.  The presentation is called Unleashing the Dark Crystal – Crystal Reports.  You can find a link to this presentation in the EMu Conference page.  We now have about three different custom Crystal reports in our system based on this method and they work pretty well.

Good luck and let me know if you need any further guidance.  I would contact your Axiell support staff for assistance setting things up.

Cheers,
Beth :-)

Edited by: Beth Gamble - 09-Mar-16 00:34:19

--- Beth L. Gamble ----------------------------------
Senior Systems Analyst
National Museum of Natural History
Smithsonian Institution

Beth Gamble
Senior Systems Analyst
useravatar
Offline
29 Posts
Female 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Duplicate Details in Report

Beth,
Thank you for your input.  It gave me a good starting point.  What I finally did was create a simple read-only csv file, placed it in the local report folder(s), and linked my Crystal Report to that file to create repetition based on a value in an EMu field.  While it may not be elegant (and can be improved upon), it gets the job done, and is easy to set up. 
Bill

Bill Mertz
Database Manager
useravatar
Offline
22 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Duplicate Details in Report

Very interesting Bill.  Would you be willing to elaborate on what is in the Read Only CSV file that enabled the duplication?  Do you have to recreate this CSV file each time for different data sets?  You have peaked my curiosity ;-).

Beth :-)

--- Beth L. Gamble ----------------------------------
Senior Systems Analyst
National Museum of Natural History
Smithsonian Institution

Beth Gamble
Senior Systems Analyst
useravatar
Offline
29 Posts
Female 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Duplicate Details in Report

Beth,

First, create a csv file that contains one column with values 1,2,2,3,3,3,4,4,4,4,etc. You can use the Excel function: A2+(OFFSET(A3,A2*-1,)=A2).
Make this file read-only, otherwise the reporting process deletes the file each time it's run. Place the file in C:\Users\username\AppData\Local\KESoftware\Reports\esites (or whichever report folder requires the repetition).
In Crystal add the csv and link it to your report table (from the csv to your EMu table's "number of labels" field).
In the design all you have to do is place the field from the csv into your report.
(To make the csv read-only I found that checking read-only first, then going to advanced security and setting Traverse Folder, List folder, Read Attributes, Read extended attributes, and read permissions works)
I am certain this can be improved upon, but it works as described.  Contact me if you have questions or it doesn't give you the results you expect.

Bill

Edited by: Bill Mertz - 21-Jun-16 09:25:51

Bill Mertz
Database Manager
useravatar
Offline
22 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Duplicate Details in Report

Very ingenious method.  I'll stick with my texxmlreplicate method but love knowing there is a crystal only way to handle it.

Beth :-)

--- Beth L. Gamble ----------------------------------
Senior Systems Analyst
National Museum of Natural History
Smithsonian Institution

Beth Gamble
Senior Systems Analyst
useravatar
Offline
29 Posts
Female 
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic