Jump to content

Output File Names


Recommended Posts

I have a client ssking to output single pdf files and use the account number within the data file as the file name for each individual file. Is there a way to do this in FusionPro? Please help as i think this may be doable with a Java rule but I am still in the beginning stages of learning Java.
Link to comment
Share on other sites

Since you have Fusion Pro 8 you should be able to use this rule.

 

if (FieldChanged("YourFieldName"))
   FusionPro.Composition.OpenNewOutputFile(Field("YourFieldName") +
       "." + FusionPro.Composition.outputFormatExtension);

 

I am not able to use this rule since I don't have FP 8. Would come in handy though if I could!!!

Edited by dreimer
Link to comment
Share on other sites

Thanks dreimer. I have two questions: 1.) Should this be added as a blank text rule or should it be added as on OnRecordStart Rule? 2.) How do you find all these rules? I reviewed the documentation that is provided with FP8 and i searched the forum and did not find any thing that was close to what i needed. This is twice now that within a hour or so of me posting a question you have the code. Is there some other place that I should be looking for this?
Link to comment
Share on other sites

OnRecordStart rule. I did a forum search to find the code. Not sure how to create a link to a thread but it was titled "http://forums.printable.com/images/misc/tag.pngFile output records based on data field"

 

Oh well look at that, it created the link to the thread!!!

 

This forum has many great people on it and you can normally find a way to resolve a problem on here.

Edited by dreimer
Link to comment
Share on other sites

Since you have Fusion Pro 8 you should be able to use this rule.

 

if (FieldChanged("YourFieldName"))
   FusionPro.Composition.OpenNewOutputFile(Field("YourFieldName") +
       "." + FusionPro.Composition.outputFormatExtension);

I am not able to use this rule since I don't have FP 8. Would come in handy though if I could!!!

You do need FusionPro 8 to use that specific function, but you DO NOT need FusionPro 8 to name output files based on data fields.

 

In earlier versions of FusionPro, you can still name output files for output "chunks" by setting FusionPro.Composition.outputFileName in the OnNewOutputFile callback rule. You can define the size of each output chunk with the "Output to multiple files" check box and related controls on the Output tab of the Composition Settings dialog.

 

What's new in FusionPro 8 is the ability to break up the output into chunks of arbitrary sizes, instead of every chunk containing the same number of output records.

 

Specifically, if I understand correctly what Amber is trying to do, she wants each record in its own output file (chunks of one record). That can be done in any version of FusionPro, by checking that "Output to multiple files" box, setting "Number of records per file" to 1, and creating the OnNewOutputFile rule to set FusionPro.Composition.outputFileName, as I described above.

 

If you are running FusionPro 8, you could also accomplish a new output file for each input record by unconditionally calling FusionPro.Composition.OpenNewOutputFile() in OnRecordStart; that is, without the "if (FieldChanged("YourFieldName"))" line.

Thanks dreimer. I have two questions: 1.) Should this be added as a blank text rule or should it be added as on OnRecordStart Rule?

FusionPro.Composition.OpenNewOutputFile() should be called in OnRecordStart. If you want to set FusionPro.Composition.outputFileName instead, that goes in the OnNewOutputFile callback rule.

2.) How do you find all these rules? I reviewed the documentation that is provided with FP8 and i searched the forum and did not find any thing that was close to what i needed. This is twice now that within a hour or so of me posting a question you have the code. Is there some other place that I should be looking for this?

Well, there's no substitute for experience. But this is all documented in the FusionPro Rules Guide. The section titled "How to make each record its own file whose name is based on a data field" (on page 103 in my version) shows how to set FusionPro.Composition.outputFileName in the OnNewOutputFile callback rule. The OpenNewOutputFile() function is documented with the FusionPro.Composition Object (on page 86).

 

Also, searching this forum for terms such as "output file name", or searching with Google for terms such as "FusionPro output file name", or "site:forums.pti.com output file name", returns lots of threads and posts like this one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...