Jump to content

Landisa

Registered Users - Approved
  • Posts

    31
  • Joined

Everything posted by Landisa

  1. Nevermind! I just needed to think it through a little bit. Made each table unique and set an easy if else statement. I got these to work with the following code: // If the current page is odd, return the barcode if (pg == 1){ return pg %2 ? OMR3.MakeTags() : ''; } else { return pg %2 ? OMR2.MakeTags() : ''; }
  2. Step your code helped me figure out my mistake! Looks like I just needed to set my code to re-evaluate for every text flow so that it would actually call the page number rather than always using page 1 as the result. Could this theory be applied to a set of OMR marks (essentially a table with borders that change from 3-fin marks on page 1 and 2-fin marks on pages 2-N)? I am using this code to apply the marks: //Create 3-Fin OMR Mark using tables and borders new FPTable; var OMR = new FPTable; OMR.AddColumns(7200); OMR.AddRows(3); OMR.Rows[0].minHeight = 1800; //specified in hundredths of a point OMR.Rows[0].Cells[0].SetBorders("Medium", "Black", "Top"); OMR.Rows[0].Cells[0].Content = ""; OMR.Rows[1].minHeight = 1800; //specified in hundredths of a point OMR.Rows[1].Cells[0].SetBorders("Medium", "Black", "Top"); OMR.Rows[1].Cells[0].Content = ""; OMR.Rows[2].minHeight = 1800; //specified in hundredths of a point OMR.Rows[2].Cells[0].SetBorders("Medium", "Black", "Top"); OMR.Rows[2].Cells[0].Content = ""; return OMR.MakeTags();
  3. ================ UPDATE: 1/29/2016 Listing as solved and leaving code for future people if they need help. ================ I am working on creating several rules based on the page number of a document. First rule is a barcode for our inserter. We need to include: customer id current page (2-digit) total pages in record (2-digit) check digit So it should look something like: CN61341010300 I am having difficulty calling the page numbers in the empty rules though. Second rule is making it so that the barcode only displays on odd number pages and the first page is a different setup than all the other pages. Page 1 has a special check digit that signifies start of a document. Page 2-N have a different check digit to signify that it continues to pull. How would I call up page numbers in these situations? Will they work in empty rules or do I need a callback?
  4. Thanks! The code got it working. I will look into the shorter code as well. Would be much simpler not to have so many rules.
  5. To answer your question, yes. The third letter has the first and seconds tables as well as its own tables. If I knew how to save it in a backwards compatible mode I would do that. However, I have attached the other two rules and will post OnRecordStart Rule below. Some formatting has been snipped in order to post (it was too large). OnRecordStart: //The following if statement will detect if we are currently in preview mode or editing this rule (versus composing output). if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } // Create empty var ArraySize = 0; var tables = []; //Get a count of the total number of records in the external data file NumberOfRecords = data.recordCount; //Now, loop through all records in the external data file and find the records that belong to the customer. for (var i = 1; i <= NumberOfRecords; i++) { if (data.GetFieldValue(i, "CID") == Field("Customer ID")) { //Create Table var myTable = new FPTable; myTable.AddColumns(5825, 5400, 27200, 7200, 8100); myTable.AddRows(15); myTable.Rows[0].Cells[3].HStraddle = 2; myTable.Rows[1].Cells[0].HStraddle = 2; myTable.Rows[1].Cells[2].VStraddle = 2; myTable.Rows[1].Cells[3].VStraddle = 2; myTable.Rows[1].Cells[4].VStraddle = 2; myTable.Rows[0].Cells[0].PointSize=10; myTable.Rows[1].Cells[0].PointSize=10; myTable.Rows[2].Cells[0].PointSize=8; myTable.Rows[3].Cells[0].PointSize=10; myTable.Rows[4].Cells[0].PointSize=10; myTable.Rows[5].Cells[0].PointSize=10; myTable.Rows[6].Cells[0].PointSize=10; myTable.Rows[7].Cells[0].PointSize=10; myTable.Rows[8].Cells[0].PointSize=10; myTable.Rows[9].Cells[0].PointSize=10; myTable.Rows[10].Cells[0].PointSize=10; myTable.Rows[11].Cells[0].PointSize=10; myTable.Rows[12].Cells[0].PointSize=10; myTable.Rows[13].Cells[0].PointSize=10; //Title Row myTable.Rows[0].SetContents("County", data.GetFieldValue(i, "County"), "Property ID", data.GetFieldValue(i, "PropertyID"), ""); //Header Rows myTable.Rows[1].Cells[0].Content = "Head Count"; myTable.Rows[1].Cells[2].Content = "Livestock Type"; myTable.Rows[1].Cells[3].Content = "Fee Amount Per Head"; myTable.Rows[1].Cells[4].Content = "Per Capita Fee Calculated Totals"; myTable.Rows[2].Cells[0].Content = "Previous Year"; myTable.Rows[2].Cells[1].Content = "Current Year"; //Variable Data Rows myTable.Rows[3].SetContents(data.GetFieldValue(i, "Horses"), "", "Horses, Mules and Asses (ponies, donkeys, burros)", "$ 5.85", ""); myTable.Rows[4].SetContents(data.GetFieldValue(i, "Cattle"), "", "Cattle (cows, bulls, yearling)", "$ 2.29", ""); myTable.Rows[5].SetContents(data.GetFieldValue(i, "Bison"), "", "Domestic Bison", "$ 6.38", ""); myTable.Rows[6].SetContents(data.GetFieldValue(i, "Sheep"), "", "Sheep", "$ 0.54", ""); myTable.Rows[7].SetContents(data.GetFieldValue(i, "Swine"), "", "Swine", "$ 0.78", ""); myTable.Rows[8].SetContents(data.GetFieldValue(i, "Goats"), "", "Goats", "$ 0.54", ""); myTable.Rows[9].SetContents(data.GetFieldValue(i, "Poultry"), "", "Poultry (chickens, turkeys, gees, ducks and other domestic birds raised as food or to produce feathers", "$ 0.05", ""); myTable.Rows[10].SetContents(data.GetFieldValue(i, "Bees"), "", "Bees (number of hives or boards)", "$ 0.41", ""); myTable.Rows[11].SetContents(data.GetFieldValue(i, "Domestic"), "", "Alternative Livestock (privately owned caribou, mule deer, whitetail deer, elk, moose, antelope, mountain sheep, mountain goats indigenous to Montana)", "$26.23", ""); myTable.Rows[12].SetContents(data.GetFieldValue(i, "Ratites"), "", "Ratites (includes all ostriches, rheas and emus", "$ 9.37", ""); myTable.Rows[13].SetContents(data.GetFieldValue(i, "Llamas"), "", "Llamas and Alpacas", "$ 9.37", ""); // Footer Row myTable.Rows[14].Cells[0].HStraddle = 4; myTable.Rows[14].Cells[4].HStraddle = 4; myTable.Rows[14].Cells[4].PointSize=10; myTable.Rows[14].Cells[0].Content = "Total Amount Due for 2016 Per Capita Fee"; myTable.Rows[14].Cells[4].Content = "$"; // Create variable for holding table tags text = myTable.MakeTags(); // Push variable into Array tables.push(text); } // Get Array Length ArraySize = tables.length; } // Cycle through Array until length is reached and print lines for (t = 0; t < ArraySize; t++) { tbl += tables[t]; } Removing them from Global doesn't seem to correct the issue.
  6. ==================== [uPDATE] January 14, 2016 ==================== Solution has been found (by Step) and a cleaner code was also provided. I am leaving this thread as it is so others can get help with similar problems. Attachments have been removed. ===================== [ORIGINAL] January 13, 2016 ===================== We have a request to merge one user's letter with their property tables. These tables will vary in quantity per user. Currently I am able to populate the data tables and create an overflow. However, it seems that the first letter for "Johnny" works out and he gets what he is supposed to have. Then the second letter for "Beth" ends up with Johnny's table and both of her tables. The problem continues on from there. I believe it has to do with the array the data is being stored into and how we are calling it to run. Can someone look over the code and see how I get the tables to stay with their owners and not continue on to the next owner? Since the form is for our state government I will be unable to post the original for download. However, I have attached a sample build and test resources used to build the item. Please keep in mind that this is a very large mailing. If there is an issue with memory recall on larger items let me know.
×
×
  • Create New...