Jump to content

Josh

Registered Users - Approved
  • Posts

    7
  • Joined

Posts posted by Josh

  1. Hello All,

     

    I am trying to figure out how to setup my document to handle a type of variable image stacking that is based on true and false values in an attached data file.

     

    The image area can contain 1 - 3 images, from a pool of 6. Most of the time they are vertically stacked, center aligned on the vertical axis, and the combination changes for each record in the data. My only thought is to build a table with JS and make the rows the variable part based on an IF statement, but I haven't had luck pushing an image into a table.

     

    I have attached some images to show how the are setup, the data behind them and the results. All of this is with a different software and I am really wanting to bring this all together in FP.

     

    I very much appreciate any help possible.

    X-SellIcons.thumb.jpg.e2f0341d543e50ef55396e71b9434818.jpg

    X-Sells.jpg.2206e7750b54b870f633280df37e8d44.jpg

    X-SellIcons_1.jpg.c3e7fb8a5eb965eac547b5beff6c9098.jpg

    X-SellIcons_2.jpg.c518c9455de660f7e2b4204b6bb9a029.jpg

  2. I am trying to ensure that no matter the amount variable tagged text elements we have, that we can search the output for missing variables from the data.

     

    I know I would have to do something along the lines of the following JS for each variable we use, but I am hoping I can do this in the OnRecordStart rule and it will work in the individual text rules that already exist outside of the ORS.

     

    var greetingText = '<span color="' + Greet_color + '" font="' + Greet_font + '" pointsize="' + Greet_size + '">';
    
    //Inserting Empty Field! when data is absent
    if (Field("Greeting") == "")
       greetingText += "Empty Field!" + '</span>';
    else
       greetingText += Field("Salutation") + " " + Trim(Field("Greeting")) + Field("Punctuation") + '</span>';

  3. Hello All,

     

    I found a post from Dan that got me 40-50% of the way to my goal, but I am struggling as I am a total Noob.

     

    I am working with a project that has up to 1200 different versions/ possible pages, front and back. Each page can have up to 50 variables, all in various locations. I am trying to make this as simple as possible, and found this code from a previous post which showed promise.

     

    data = new ExternalDataFileEx('/path/to/data.csv',',');

    for (var i=1; i<=data.recordCount; i++) {

    var frame = FindTextFrame(data.GetFieldValue(i, 'Frame'));

    var att = ['width','height','x','y'];

    for (var n in att)

    if (a = data.GetFieldValue(i, att[n]))

    frame[att[n]] = a;

    frame.content = RawTextFromTagged(CreateResource(data.GetFieldValue(i, 'content')).content);

    }

     

    Catch is that I am trying to use Formatted Text Resources, to make the fonts easier to manage, in the content location. All I can think to do is create a huge amount of Switch statements that control the FTR being matched to the Version codes I have and then calling that rule in the 'frame.content' part of this code.

     

    Sorry if I am losing anyone, this is not an easy task and has so many moving parts.

×
×
  • Create New...