Jump to content

Susan

Registered Users - Approved
  • Posts

    69
  • Joined

Everything posted by Susan

  1. Thanks for cleaning up my table rule. I am having trouble getting the first Code to work. The "Event/Package" straddles correctly, but the "Sec" is only straddling into "Row" and not "Row" and "Seat(s)" and "Seat(s) and "Qty" straddle. On the more versatile code I get an error on this line while (!myTable.Rows.Cells[c + straddle].Content) straddle++; Finally, if I can get any of these to work, is it possible to have "Sec" flush left only when it straddles as opposed to centering. I've attached a sample FP file if you have a chance to look at it. Thanks Ste.
  2. I've attached a sample of a table and was wondering if it would be possible to create a table like this where some of the entries would straddle the columns. Here is my usual table rule where the columns don't straddle. if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } //Get a count of the total number of records in the external data file numRecsExtDF = externalDF.recordCount; /*============================================================================= || Create arrays to hold values that match the CID of the client's record ||=============================================================================*/ var clientMatch = []; var eventMatch = []; var locationMatch = []; var secMatch = []; var rowMatch = []; var seatMatch = []; var qtyMatch = []; var priceMatch = []; var extendedMatch = []; // Step through the external data file and push matches into their respective variables if there is a match for (var i=1; i <= numRecsExtDF; i++) { if (externalDF.GetFieldValue(i, 'USERACCOUNTNUMBER') == Field("USERACCOUNTNUMBER")) { clientMatch.push(externalDF.GetFieldValue(i, 'USERACCOUNTNUMBER')); eventMatch.push(externalDF.GetFieldValue(i, 'cEvent_Package')); locationMatch.push(externalDF.GetFieldValue(i, 'cLocation')); secMatch.push(externalDF.GetFieldValue(i, 'cSec')); rowMatch.push(externalDF.GetFieldValue(i, 'cRow')); seatMatch.push(externalDF.GetFieldValue(i, 'cSeats')); qtyMatch.push(externalDF.GetFieldValue(i, 'TOTAL_COUNT')); priceMatch.push(externalDF.GetFieldValue(i, 'SEAT_PRICE')); extendedMatch.push(externalDF.GetFieldValue (i, 'EXTENDED_AMOUNT')); } } /*============================================================================= || Create the table ||=============================================================================*/ new FPTable; var myTable = new FPTable; myTable.AddColumns(19800, 6200, 5700, 3800,6200,2650,5450,6150) myTable.AddRows(clientMatch.length+2); // add 2 additional rows (Header and summary lines) // HEADER ROW FORMATTING myTable.Rows[0].Type = "Header"; myTable.Rows[0].Cells[0].Font = "Helvetica Neue Bold Condensed"; myTable.Rows[0].Cells[0].PointSize = "10"; myTable.Rows[0].Cells[0].TextColor = "White"; myTable.Rows[0].Cells[0].ShadeColor = "Black"; myTable.Rows[0].Cells[0].ShadePct = 50; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 30; myTable.Rows[0].Cells[0].Margins.Bottom = 45; myTable.Rows[0].Cells[0].Margins.Right = 500; myTable.Rows[0].Cells[0].SetBorders("Very Thin", "Gray", "Top", "Bottom", "Right", "Left"); myTable.Rows[0].CopyCells(0, 1, 2, 3,4,5,6,7); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].Type = "Header"; myTable.Rows[0].Cells[0].HAlign = "Left"; myTable.Rows[0].Cells[1].HAlign = "Left"; myTable.Rows[0].Cells[2].HAlign = "Center"; myTable.Rows[0].Cells[3].HAlign = "Center"; myTable.Rows[0].Cells[4].HAlign = "Center"; myTable.Rows[0].Cells[5].HAlign = "Center"; myTable.Rows[0].Cells[6].HAlign = "Center"; myTable.Rows[0].Cells[7].HAlign = "Center"; myTable.Rows[0].SetContents("Event / Package", "Location", "Sec", "Row", "Seat(s)", "Qty", "Price", "Total"); // interate through the length of the arrays (data matches from external data file) and create rows for (var i=1; i<=clientMatch.length; i++) { // TABLE CONTENT FORMATTING myTable.Rows.Cells[0].Font = "HelveticaNeueLT Std Cn"; myTable.Rows.Cells[0].PointSize = "10"; myTable.Rows.Cells[0].Margins = new FPTableMargins; myTable.Rows.Cells[0].Margins.Top = 50; myTable.Rows.Cells[0].Margins.Bottom = 30; myTable.Rows.Cells[0].Margins.Right = 500; myTable.Rows.Cells[0].Margins.Left = 500; myTable.Rows.Cells[0].SetBorders("Very Thin", "Gray", "Top", "Bottom", "Right", "Left"); myTable.Rows.CopyCells(0,1,2,3,4,5,6,7); // Apply the same formating to each cell in this row // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS myTable.Rows.Cells[0].VAlign = "Middle"; myTable.Rows.Cells[1].VAlign = "Middle"; myTable.Rows.Cells[2].VAlign = "Middle"; myTable.Rows.Cells[3].VAlign = "Middle"; myTable.Rows.Cells[4].VAlign = "Middle"; myTable.Rows.Cells[5].VAlign = "Middle"; myTable.Rows.Cells[6].VAlign = "Middle"; myTable.Rows.Cells[7].VAlign = "Middle"; myTable.Rows.SetContents(eventMatch[i-1], locationMatch[i-1], secMatch[i-1], rowMatch[i-1], seatMatch[i-1], qtyMatch[i-1], priceMatch[i-1], extendedMatch[i-1]); myTable.Rows.Cells[0].HAlign = "Left"; myTable.Rows.Cells[1].HAlign = "Left"; myTable.Rows.Cells[2].HAlign = "Center"; myTable.Rows.Cells[3].HAlign = "Center"; myTable.Rows.Cells[4].HAlign = "Center"; myTable.Rows.Cells[5].HAlign = "Center"; myTable.Rows.Cells[6].HAlign = "Right"; myTable.Rows.Cells[7].HAlign = "Right"; myTable.Rows.SetContents(eventMatch[i-1], locationMatch[i-1], secMatch[i-1], rowMatch[i-1], seatMatch[i-1], qtyMatch[i-1], "$"+priceMatch[i-1], "$"+extendedMatch[i-1]); } return myTable.MakeTags();
  3. Thank you! You've saved me a lot of time and headaches!
  4. Thanks for the reply. For some reason my result is $9 with this rule. The entry in my field is $515.00. The previous rule below resulted in $524. I need it to be $524.00. var price = Field("External_Data::cTotal") // Your field here return '$' + (StringToNumber(price.replace(/[^\d\.]/g, '')) +9);
  5. Thanks. This rules works great except I need 2 decimal places. ($525.00).
  6. I have a field with a total amount. I need to add $9.00 to that amount. Can anyone help me with a rule to do this.
  7. Ste, thanks for the fix and explanation.
  8. The files are attached. Thanks.
  9. Thanks Dan. I added the code to the OnRecordStart and it composed the imposed file. The only problem now is that it only composed one press sheet. The imposition is 3up 2sided and there are 11 unique entries in the field so it should have composed 4 press sheets. Any thoughts on what else I might need to correct.
  10. You were correct about the stacking, when removed from the FP Imposition it will compose. I tried adding the new code: if (FusionPro.Composition.processedRecordNumber() == 1) versions = {}; to the beginning of the OnRecordStart but I am getting an error. "TypeError: FusionPro.Composition.processedRecordNumber is not a function" Can you show me where it should be added to this: var isProof = true; // false to compose job normally var version = Field("list"); // Field that indicates version if (isProof) { if (!versions[version]) versions[version] = 0; FusionPro.Composition.composeThisRecord = ++versions[version] <= 1; } Thanks
  11. I am using a JavaScript Globals: versions = {}; and a OnRecordStart rule: var isProof = true; // false to compose job normally var version = Field("list"); // Field that indicates version if (isProof) { if (!versions[version]) versions[version] = 0; FusionPro.Composition.composeThisRecord = ++versions[version] <= 1; } which I found on the forum to compose one copy of each unique entry in a Field. It works great when composing without a FusionPro Imposition, but when I try to add an imposition and compose I get the following error: A fatal error has occurred and FusionPro must abort. It is possible the disk is full. Composition stopped with errors. Error no. 1096. and this message in the log: A blank page is emitted since no record is composed properly. dlpdfdocwritepdf, progress "Doc->PageCount is zero", error: Bad parameter. PDF Library Document Write Error: Bad parameter. pdf_om_WriteDoc, dtl_pdf_WritePdf returned "-2" Will it be possible to compose using an FP Imposition template with the JavaScript Globals and OnRecordStart rules?
  12. I have a field with various prices ($10, for example). Is it possible to write a rule that would return that price doubled. ($20)?
  13. Just wanted to update this post. I updated FPExpression to the latest version and everything is working like it should.
  14. I haven't used FP Expression in about 4 years and am having trouble with error messages. I pulled an old job that previously worked to familiarize myself with Expression again but I am getting an image error. Waiting for Personalized Image, Template "Clouds_PalmTrees_CX.fpx", Data "IT'S TIME#Randy"... Failed to open file /Users/Shared/FPExpressionOutput/Mac-1488470411-C1B5A086-B438-4B5B-9918-3BAE7232720C-9.log.xml Graphic is not found or is not processed properly: Personalized Image Error: Template Clouds_PalmTrees_CX.fpx, Data IT'S TIME#Randy: Invalid log file.. Check for file existence and that it is of the proper format. I am attaching the file that was used. The Lores PDF folder shows what had been printed previously. The only change I made was deleting page 2 so my attachment would be smaller. The error log is in the OUTPUT folder. Thanks for any help.
  15. Thanks Ste, That was my problem. Composing 1-1 is what I needed. Susan
  16. I had to put together a quick test for a table job. When I compose the file, I get multiples pages of the same table. It should just output 2 pages, not 44 pages. Is there something in my table rule causing this? The file is attached.
  17. Thanks for the help. I was able to get the results I needed using your rule (not the table rule) but I was wondering if there is a way I can keep the quotes from breaking when I use an overflow page. I've attached a sample pdf. When I assign "keep with next paragraph" or change widows to 99 it treats the <Quote External Data Rule> as one object and knocks it all over to the next page. Below is the changes I made to your rule. //Create an empty variable that will be populated with a //string of text that lists the customer's purchases returnStr = ''; //The following if statement will detect if we are currently in preview //mode or editing this rule (versus composing output). If so, the script //will manually call the OnJobStart rule so the link to the external //data file can be established. OnJobStart is called automatically when //a full composition is run. if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } return externalDF.FindRecords('Fund', Field("Fund")) .map(function(s){ var quote = TaggedTextFromRaw(externalDF.GetFieldValue(s, 'Quote')); var name = TaggedTextFromRaw(externalDF.GetFieldValue(s, 'Recipient Name_cal')); return quote ? ['<f name=Gotham-Book>'+ '"' +quote, '<f name=Gotham-Medium>' + name].filter(function(p) { return RawTextFromTagged(p); }).join('" - ') : ''; }).filter(String).join('<br><br>');
  18. I am using table rules for this document. I've attached a screenshot showing how the bottom "quote" table is printing copy I don't want. I am using fields “Quote” and “Recipient Name_cal”. Can I put a rule within my table rule to suppress the “-Namel” if there is no copy in the “Quote” field. Below is my table rule for the bottom on the screen shot, fields are highlighted in red: if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } //Get a count of the total number of records in the external data file numRecsExtDF = externalDF.recordCount; /*============================================================================= || Create arrays to hold values that match the CID of the client's record ||=============================================================================*/ var QuoteMatch = []; var RecipientMatch = []; // Step through the external data file and push matches into their respective variables if there is a match for (var i=1; i <= numRecsExtDF; i++) { if (externalDF.GetFieldValue(i, 'Fund') == Field("Fund")) { QuoteMatch.push(TaggedTextFromRaw(externalDF.GetFieldValue(i, 'Quote'))); RecipientMatch.push(TaggedTextFromRaw(externalDF.GetFieldValue(i, 'Recipient Name_cal'))); } } /*============================================================================= || Create the table ||=============================================================================*/ new FPTable; var myTable = new FPTable; myTable.AddColumns(47000); // interate through the length of the arrays (data matches from external data file) and create rows for (var i = 0; i < QuoteMatch.length; i++) { // TABLE CONTENT FORMATTING var row = myTable.AddRow(); for (var c = 0; c < myTable.Columns.length; c++) { row.SetContents(QuoteMatch, RecipientMatch); var cell = row.Cells[c]; cell.Font = "Gotham-Book"; cell.PointSize = "10"; cell.TextColor = "Black"; cell.ShadeColor = "Black"; cell.Margins = { Top:20, Bottom:100, Right:20, Left:20}; cell.VAlign = "Left"; cell.HAlign = "Left"; // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS row.SetContents(QuoteMatch + " –"+'<f name=Gotham-Medium>'+ RecipientMatch); } } return myTable.MakeTags();
  19. After composing a file as a PPML and trying to close the pdf I get a message: "The document could not be saved. The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder." This only happens when composing to a PPML. I can compose to PDF and save and close the FusionPro PDF.
  20. I'm having the same issue. It occurs on all my variable files when composing as a PPML. It will save when composing as a PDF.
  21. I am linking to an external data file for a table. I wanted to use that external data to pick up just one field for a text box. Each Customer may have multiple entries in the data with the same USERACCOUNTNUMBER and USERID. I wanted to pick up the USERID, but if a customer has multiple entries the USERID repeats itself (USER ID: sr189sr189sr189). Can I tell it to just pick up the first one that it finds so that the result would be USER ID: sr189? My rule is: returnStr = ''; if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } numRecsExtDF = externalDF.recordCount; for (recordWalker=1; recordWalker <= numRecsExtDF; recordWalker++) { if (externalDF.GetFieldValue(recordWalker, 'USERACCOUNTNUMBER') == Field("USERACCOUNTNUMBER")) { { returnStr += externalDF.GetFieldValue(recordWalker, 'USERID'); } } } return returnStr;
  22. I think I figured it out myself. I added a column amount in the rule and it adjusts the width: var myBarcode = new PDF417Barcode(); myBarcode.pointSize =9; myBarcode.totalColumns =9; return myBarcode.Make(Field("Reg Code") +"^"+ Field("First Name") +"^"+ Field("Last Name") +"^"+ Field("Position") +"^"+ Field("Organization") +"^"+ Field("Address") +"^"+ Field("Address 2") +"^"+ Field("City") +"^"+ Field("State/Province") +"^"+ Field("Postal Code") +"^"+ Field("Email"));
  23. I am creating a PDF417 barcode with the following rule: var myBarcode = new PDF417Barcode(); myBarcode.pointSize =3; return myBarcode.Make(Field("Reg Code") +"^"+ Field("First Name") +"^"+ Field("Last Name") +"^"+ Field("Position") +"^"+ Field("Organization") +"^"+ Field("Address") +"^"+ Field("Address 2") +"^"+ Field("City") +"^"+ Field("State/Province") +"^"+ Field("Postal Code") +"^"+ Field("Email")); The barcode that is being created is too tall and not wide enough. Is there some way I can adjust this?
×
×
  • Create New...