Jump to content

kentbaker

Registered Users - Approved
  • Posts

    23
  • Joined

Posts posted by kentbaker

  1. Thanks Dan. I get this in the msg file, 'debug rule' being the text rule you suggested.

     

    "Value for variable debug rule not found in instance data"

     

    So, I am not picking up the CFG file value in the first place.

     

    EDIT: hold the phone..............I just switched up this morning and did an 'On demand' composition and it is working fine. There is a flaw in my testing methodology. Sorry to bother.

     

    Here is what I think happened. I was using CMD argument:

     

    fusionpro.exe <instance file> <format (the .dif) file> <config file> <output file>

     

    And assumed that the DEF file with the same name/folder as the DIF would be used. The DEF file in the CFG had none of the rules I was testing. When I did an On-Demand composition, I defined the path to the DEF (where the darn rules are!).

  2. Hello,

     

    I have this key/value in my CFG file:

     

    oNumber=1219054055

     

    And this OnRecordStart Rule

     

    FusionPro.thisRuleReturnsTaggedText = true;
    //oNumber = 1231234567
    var oNumber = FusionPro.Composition.JobOptions.oNumber;
    var lastThree = Right(oNumber, 3 );
    var firstSeven = Left(oNumber, 7 );
    FindTextFrame("orderNumber").content = '<span><f name="Arial"><z newsize="6.0">' +  firstSeven +'</span>' + '<span><f name="Arial"><b><z newsize="8">' + lastThree + '</span>';

     

    And a text frame named: orderNumber

     

    For the life of me, I am not sure why this does not work ( does not return the value 1219054055 to the text frame) when composing with FP Server. I have tried both 10.0.3 and 9.3.15 Server versions, and it is the same. For the Template creation have use both 9.3.9 and 9.3.40

     

    Any input or suggestion is greatly appreciated. Thanks in advance.

  3. It is a great help. It would be days before I got this far. I can't thank you enough.

    Hardcoding the path, in OnJobStart, doing a

    return sorted_data;

    result in this

    [object Object],[object Object],.............

    but in OnRecordStart

    return recFlag;

    results in the value of "Order Number" being displayed in ascending order.

     

    The output pdf is not affected, though a pdf named undefined.pdf is output additionally. They are identical in content, number of pages, etc. The data has 5 different "Order Numbers". I imagine I have something wrong in OnRecordStart.

    example_template.zip

  4. Hello.

     

    Thanks in advance for any help.

     

    I have need to sort by a field value so I can do dynamic chunking. The input file is presorted for mailing so the "order number" field values are not contiguous. So I think/hope I can use the input file in an "on job start" something like this (name of input file is not static)

    var inFile = FusionPro.Composition.inputFileName;
    var exData = new ExternalDataFileEx(inFile, ',');

    then I need to "sort" the records in the external data based on the field "Order Number". Can I populate an array with the external data

     

    sortedList = [];
    for (var i=1; i<=26; i++){
    sortedList.push(exData.GetFieldValue(FusionPro.Composition.inputRecordNumber,i));
       }

    and somehow sort the array by the field "Order Number"? My attempts have sorted the rows, not the columns.

     

    sortedList = sortedList.sort().join("<br>");

     

    Ideally, I would then like to be able to use the external data as the input file so that I do not have to change rules, but if that is not not possible I will re-write all the rules to use the external data, and "On Record Start" use the FieldChanged() to create my chunks by order number. I am unclear on how to reference the field in the external data.

    if (FieldChanged([color="Red"]the "Order Number" field in sortedList??[/color]))
       FusionPro.Composition.OpenNewOutputFile(Field([color="red"]the "Order Number" field in sortedList??[/color]) + "." + FusionPro.Composition.outputFormatExtension);

×
×
  • Create New...