Jump to content

ThomasLewis

Members
  • Posts

    294
  • Joined

  • Days Won

    11

Everything posted by ThomasLewis

  1. As I explained, that's what the allow_same_day variable is for. If you want to allow it, then set it to true.
  2. Change the weeks_out variable to how many weeks forward you want the date. This gets a little tricky when the order placed is on a Wednesday, that's what the allow_same_day variable is for. Once you make the rule(s), you can use the Validate button to check the values and play around with what settings work for you.
  3. function set_date(date_string, day_of_week, week_multiplier, same_day) { var d = DateFromString(date_string); var day = (day_of_week +7 -d.getDay()) % 7; if (!same_day && !day) day = 7; return d.setDate(d.getDate() + day + (7 * week_multiplier)); } //settings var weekday = 3; //sunday = 0, wednesday = 3 var weeks_out = 0; //change 0 to how many weeks out, ie 6, 12, 18 var allow_same_day = false; //if false, items ordered on same day will push to following week var order_date = Field("Order Date"); var date_format = "lm d, yyyy"; return FormatDate(set_date(order_date, weekday, weeks_out, allow_same_day), date_format); Give this a shot.
  4. Just realized the page numbers are off. You'll need to change «$outputrecordnumber» to «$repeatrecordnumber» in the page frame.
  5. I think this should do it: var begin = Int(Field("Begin").replace(/\D/g, "")); var end = Int(Field("End").replace(/\D/g, "")); var range_between = 5; var lines_per_sheet = 20; var iterate = (FusionPro.Composition.repeatRecordNumber -1) * (lines_per_sheet * (range_between +1)); var sequence = ""; var start_number = begin; var ending_number = 0; for (i = 0; i < lines_per_sheet && ending_number < end; i++) { sequence += "<t>" + (start_number + iterate) + "<t>-<t>"; ending_number = (start_number +iterate +range_between); if (ending_number > end) ending_number = end; sequence += ending_number + "<br>"; start_number += (range_between +1); } FindTextFrame("numbers").content = sequence; FusionPro.Composition.repeatRecordCount = Math.ceil((end -begin) / ((range_between +1) * lines_per_sheet)); if (FusionPro.Composition.repeatRecordNumber == 1) FusionPro.Composition.OpenNewOutputFile(Field("Location").replace(/[^A-Za-z0-9 -]/g, "") + "_impo" + "." + FusionPro.Composition.outputFormatExtension);
  6. I reworked this a little bit to work with your data file. var begin = Int(Field("Begin").replace(",", "")); var end = Int(Field("End").replace(",", "")); var range_between = 5; var lines_per_sheet = 20; var iterate = (FusionPro.Composition.outputRecordNumber -1) * (lines_per_sheet * (range_between +1)); var sequence = ""; var start_number = begin; for (i = 0; i < lines_per_sheet; i++) { sequence += "<t>" + (start_number + iterate) + "<t>-<t>" + (start_number +iterate +range_between) + "<br>"; start_number += (range_between +1); } FindTextFrame("numbers").content = sequence; FusionPro.Composition.repeatRecordCount = Math.ceil((end -begin) / ((range_between +1) * lines_per_sheet)); Also, if you rename your page frame to "page" you can run the entire data set and get them all in 1 PDF. Just add this to the bottom of the code: FindTextFrame("page").content = "Page " + FusionPro.Composition.repeatRecordNumber;
  7. It doesn't work because the qr rule has an embedded leading tag. The only way I have been able to get around that is to change the leading to use the magnify tag. Convert your QR rule to javascript. Change the return MakeQRBarcode line to the following: var qrcode = MakeQRBarcode(DataToEncode, ProcessTilde, EncodingMode, ErrorCorrectionMode, PreferredFormat, PointSize, NoFontTag, Font); return '<f name="IDAutomation2D"><magnify type="leading" factor=' + 100 / 1.2 + '>' + RawTextFromTagged(qrcode).replace(/\n/g, '<br>') + '</magnify>'; If you are for whatever reason using some non-standard global leading setting that's not 120%, change the 100 / 1.2 to whatever that is.
  8. The last line in your sample code works fine for me. It does in fact move the frame down by whatever value is specified by shiftValue10. My questions would be, are you using FusionPro Producer or Server? The other versions do not support x and y movement control. If so, are you using hundredths of points? Also, why do this with multiple text frames when it seems you could just do it inline in a single frame? It's really hard to tell what you are going for without a visual.
  9. In the menu: FusionPro/Advanced/Preferences... Look under Preview Selector
  10. Same here. I did report this to support last week and they have a case number for it. Hopefully we will get a fix soon.
  11. There's a few different ways to do this with substrings and regular expressions but I think the easiest is to use split. return Field("Address").split(",")[0]; This splits the string into segments at every comma. [0] is the first part, [1] would be the next, in this case city, then [2] would be state, etc. The only issue would be if the address contained a comma, for instance with an apartment number. That would end up in the next segment.
  12. Looks like there's something interfering with the IDAutomation2D font or it's not loaded. You might check just the QR rule in a new PDF to see if it works normally on it's own, if so then you have some sort of conflict. If it doesn't work, then your font isn't loaded properly.
  13. I think the real issue here is the lack of left and right margins being set in the code. I modified Dan's code to include a copyfit function with the proper margins set and it seems to work great. function cf(formatted_text_content, frame_width) { fptm = new FusionProTextMeasure; fptm.CalculateTextExtent(formatted_text_content); frame_width -= 500; //add some padding so content doesn't fill entire width if (fptm.textWidth > frame_width) { var magnify = Math.floor((frame_width / fptm.textWidth) * 100.0); return '<span><magnify type="textwidth" factor="' + magnify + '">' + formatted_text_content + '</magnify></span>'; } else return formatted_text_content; } // FPTable with Vars - v04 - cat //---------------------------------------------------------------- var font_format = '<f name="BrownStd"><z newsize=12>'; var symbol = '<superscript>'+"$"+'</superscript>'; var table = new FPTable; var col_width = 3499.2; // Prices var col = new Array(10); // col[0] unused; 1-9 used for (var i = 1; i <= 9; i++) { table.AddColumn(col_width); var num = "0" + i; col[i] = cf(font_format + '<b>' + symbol + Field("column" + num + "_DOLLAR") + '<superscript>' + Field("column" + num + "_CENT") + '</superscript></b>', col_width); } //---------------------------------------------------------------- // Table var MinH = 2880; for (var r = 0; r < 19; r++) { var row = table.AddRow(); row.minHeight = MinH; for (var c = 0; c < 9; c++) { var cell = row.Cells[c]; cell.HAlign = "Center"; cell.VAlign = "Middle"; cell.Margins = new FPTableMargins; cell.Margins.Top = 0; cell.Margins.Bottom = 0; cell.Margins.Left = 0; cell.Margins.Right = 0; cell.Content = col[c + 1]; } } return table;
  14. You might try zeroing out your Tmar and Bmar variables and defining your font properties for the cells. Hard to tell what else is going on without a copy of the template though. It looks like there is a font size and margin issue of some sort.
  15. You can use regular expressions to replace anything that's not a 0-9 with a blank. Your rule would look something like this: return FormatNumber("00000000000", Field("Currency").replace(/[^0-9]/g, "") );
  16. Like this if I'm reading your code right: ... "\\" + 'GH_magazine-' + FormatNumber("000", Field("MagIDShort")) + ".pdf";
  17. I think what you are looking for is the FormatNumber function FormatNumber("000", inputNumber)
  18. I am having the same issues at 95% I think the amount of overflow going on just may be too much to handle. I took a different approach. Removed the overflow completely and moved everything into OnRecordStart. Take a look. 158789-1_WIC_Log_Book_FP.pdf
  19. You need to remove the rule from the text frame on the overflow page, then in the text frame properties palatte, turn on the checkbox that says "Overflow To". Also in your Composition Settings under Input, change the Record Range to All or 1 to 1.
  20. Give this a shot: var start_number = 1001; var largest_number = 146000; var range = 5; var sequence = ""; while (start_number +range <= largest_number) { sequence += start_number + "-" + (start_number +range) + '<br>'; start_number += (range +1); } return sequence;
  21. This should work for you. Just a precaution though, you need to make sure you put that space in between the time and the meridiems. This works by splitting the time up into 3 sections, the hour, the minutes, and the meridiems. This first check is to see if one of the 2 drop downs is not used and just outputs what is there. The second checks if the meridiems match, if so it just uses the hour of the first drop down Lastly, if both drop downs are used and the meridiems dont match, it outputs the values as is with a hyphen between them. I have no doubt there is a more succinct way to achieve this, but this should work for what it is. var dd1_full = Field("Drop Down 1"); var dd2_full = Field("Drop Down 2"); var dd1_split = dd1_full.split(/[\:\s]/); var dd2_split = dd2_full.split(/[\:\s]/); if (!dd1_full || !dd2_full) return dd1_full + dd2_full; else if (dd1_split[2] == dd2_split[2]) return dd1_split[0] + " - " + dd2_full; else return dd1_full + " - " + dd2_full;
  22. Attached is an example on how to do this using FusionProTextMeasure and a white box.whitebox behind copy.zip
  23. You just have the syntax messed up. Try Field("PFNAME").substr(0,1) Or better yet, use Field("PFNAME").charAt(0)
  24. if (Field("FieldName").indexOf("AAAA") > -1) This returns the index of "AAAA" within the given string starting with 0. For instance if your string is "zzzAAAAzzz" it would return 3. If your string is "zzzBBBBzzz" it would return -1 because the search string is not found. So, if it returns greater than -1, then you have a match.
  25. This might help break it down for you: var start_number = 815255; var increment = 7; var crn = CurrentRecordNumber() -1; var set_start = start_number +crn +(crn * increment); var set_end = set_start + increment; return set_start + "-" + set_end;
×
×
  • Create New...