Jump to content

FusionPro.Composition.currentOutputFileNumber


tou

Recommended Posts

I current working on splitting a file out in OnRecordStart callback rule and was wondering why the FusionPro.Composition.currentOutputFileNumber value doesn't actually jump correctly the first time up. In output settings, I'm processing the entire range.

 

I've set the following in OnJobStart:

.........codeStart............

FusionPro.Composition.chunksBreakStacks = true;

.........codeEnd............

 

I've set the following in OnRecordStart:

.........codeStart............

if (FieldChanged("Order_Number")) {

FusionPro.Composition.StartNewStack()

FusionPro.Composition.OpenNewOutputFile(Field("Product_Desc") + "_" + Field("Order_Number") + "_" + FormatNumber("0000", FusionPro.Composition.currentOutputFileNumber) + "."+ FusionPro.Composition.outputFormatExtension);

}

.........codeEnd............

 

Attached is a snapshot of my PDF files....note the **0001.pdf in the first two filenames.

 

I'm sorry in advance if this issue has been resolved in other posts.

 

Thanks in advance.

filenamepartsseq.png.4190468aa83ef1e97879ed5e36b0f379.png

Link to comment
Share on other sites

It's possible that setting FusionPro.Composition.chunksBreakStacks = true in a stacked imposition job results in an off-by-one error in the output file (chunk) number counting. Is it correct if you don't set that?

 

I could debug this with the job files, or with a minimal example that demonstrates the problem.

 

As a workaround, you can always just declare a counter variable in the JavaScript Globals and increment it in your OnRecordStart call.

Link to comment
Share on other sites

I've modified the following and seems to work.....looks like nesting the filename values into the OpenNewOutputFile() function within OnRecordStart must have a lapsed error or system variable for the file part number not transferring right away.....:mad:

 

OnRecordStart:

if (FieldChanged("Order_Number")) {

FusionPro.Composition.StartNewStack()

FusionPro.Composition.OpenNewOutputFile()

}

 

OnNewOutputFile:

FusionPro.Composition.OpenNewOutputFile(Field("Product_Desc") + "_" + Field("Order_Number") + "_" + FormatNumber("0000", FusionPro.Composition.currentOutputFileNumber) +"."+ FusionPro.Composition.outputFormatExtension);

 

I've tested the above with both checking and not checking the "output to multiple files" and was successful. It was still able to split correctly if I have a quantity less than the split amount (for example, split amount is 100, but only 25 exist in some of these chunks - the OnRecordStart rule that has FieldChange() will honor to the next chunk of 100 records if it has it).

 

I think we're good now. Just had to poke around with it.

 

Thanks!

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...