Jump to content

Kim

Registered Users - Approved
  • Posts

    72
  • Joined

Everything posted by Kim

  1. Hi Ste! Thanks for the response. This is almost perfect. I thought it was doing it exactly as needed, but have found that it behaves a little weird when there are 4 records - it makes 2 columns with 2 lines each and puts a blank 3rd column with just headers. If I have 3 records it is fine and does 3 columns across. It just seems to get confused by 4 records. Examples of the one scenario that doesn't work attached along with examples of other record counts working as expected.
  2. Hi Dan and Ste, Remember this thoroughly beautiful table you helped me work out? I wound up using the code below for v10 and it's great and just what I asked for. But now that I've got some real data, I've got a little wrinkle. Sometimes there is only 1 entry for Date and Amount. So, I don't need 3 columns in those cases, but it still outputs the Date Amount headers for all 3 columns. Any ideas on how to show the Date and Amount headers only if there is content to warrant them? var numOfCols = 3; var data = FusionPro.GetMultiLineRecords(); var table = new FPTable(); table.AddColumns(6000, 7000, 3000); var header = table.AddRow(); header.Type = 'Header'; var cell = header.Cells[0]; cell.SetBorders('Thin', 'Black', 'Bottom'); cell.HAlign = 'Left'; header.CopyCells(0, 1); header.SetContents('Date', 'Amount'); for (var i = 1; i <= data.recordCount; i++) { function ExField(str) { return TaggedTextFromRaw(data.GetFieldValue(i, str)); } var row = table.AddRow(); row.Cells[0].HAlign = 'Left'; row.CopyCells(0, 1); row.SetContents.apply(row, ['Date', 'Amount'].map(ExField)); } // Number of rows needed to evenly distribute across numOfCols. // Minus 1 for the header row. var rows = Math.ceil((table.Rows.length - 1) / numOfCols); // Duplicate column 1 and 2 (and their headers) to make up numOfCols. for (var i = 0; i < (numOfCols - 1) * 3; i++) { table.Columns.push(table.Columns[i % 3]); table.Rows[0].Cells.push(table.Rows[0].Cells[i % 3]) } // Concatenate the rows cells in order to reduce our total rows // and fill up the extra columns. var rowCounter = 1; while ((table.Rows.length - 1) > rows) { var index = rowCounter % rows || rows; var row = table.Rows.splice(rows + 1, 1).pop(); table.Rows[index].Cells = table.Rows[index].Cells.concat(row.Cells) rowCounter++ } // Return the table tags. return table.MakeTags(); Thanks! Kim
  3. Thanks, Dan! A thing of beauty (as always) and great to see how to accomplish in v10. Sorry for my slow response, been out of the office. Happy New Year and thanks again to you both!! Kim
  4. Thanks for your patience with me, Ste. It looks great!
  5. Doh! I missed that multi-line was still checked. That fixed the problem with the records getting jumbled. That HAlign centers ALL the cells. I was wondering if it's possible to just center the header and leave the actual dates and amounts under those headers flush left?
  6. Hmmm...although I just realized it's not parsing the data properly for the different companies. It did the first record group correctly but then skips records in the following companies.
  7. Thanks so much, Ste! I'm sure you're right and there's a way to do this differently with v10 that's possibly easier, but this does the trick. The only other thing I'd like is to center just the headers (so center the words Date and Amount over the columns). There's a way to just center headers isn't there? Thanks again, Kim
  8. Thanks again for looking at this, Ste. Sorry for the tiny grabs, I've collected files from the start I made - again, the data repeats itself right now since I don't have columns set yet. I just repeated the same info to give the idea for now. Hopefully Dan isn't off on an exotic holiday trip and will be able to chime in too. I usually find the 2 of you quite helpful. Thanks! Kim MultiLine_Sample.zip
  9. Hey Ste! Thanks so much for the reply! You're like Santa Claus!! So, I tried both of these. The first one gives me weird results with the first record info twice and then the last and one in the middle, then Date and Time repeated a number of times. The other one just gives me a big blank with the red bar indicating not fitting. I'm not able to make my box big enough to get anything to show. I'm sure it's something I'm missing or maybe I don't have my data defined properly. Also, I do have a paragraph of text below the table and then a name and signature. I was trying to set all up in one block so that the final paragraph and sig line move up or down according to the number of rows (so maybe that's contributing to things breaking or maybe something is off with my data file). See grabs below when you get a chance. Please note that the grab showing sample data just has example entries in the date and amount columns, but rest assured my real data has all info in all fields, I just removed anything real. Thanks again! Kim
  10. Hi everyone, So I know it's right before Christmas and the last thing anyone is going to do is look at this board, but maybe Dan or Ste or somebody is out there?? ;-) I'm attempting my first table with multi-line record use. I've got a letter that's going to include a section with a report of dates and amounts in columns. There will be varying numbers of dates and amounts for each letter. I've worked out the easy part of telling Fusion I've got multi-line and telling it to change based on the Company name field. And I've got the basics of a table set. What I am trying to figure out is can I make it flow the data into columns... My letter layout allows 6 columns (so 3 groups of Date Amount columns). One company may have 25 lines of dates and amounts while another has 6 or 10, etc. Can Fusion flow that info into columns, or will I have to massage the data into columns? I'm attaching a screen grab to illustrate what I need and here's the start of my table code: (since I don't know how to flow the info, it's just repeating the same info in each column group right now - but I wanted to give you what I've got so far...) var table = new FPTable(); table.AddColumns(7200,8500,7200,8500,7200,8500); var data = FusionPro.GetMultiLineRecords(); for (var rec = 1; rec <= data.recordCount; rec++) { function ExField(str) { return TaggedTextFromRaw(data.GetFieldValue(rec, str)); } var content = ["Date","Amount","Date","Amount","Date","Amount"].map(ExField); var row = table.AddRow(); row.SetContents.apply(row, content); // row.Cells[0].Margins = row.Cells[1].Margins = { Top:0, Bottom:0, Left:0, Right:0 }; } return table.MakeTags(); Thanks! Kim
  11. Hi Ste, Realized I never replied to you and didn't want to be rude! That's some cool info you supplied and I appreciate it - I'll bank it for future when I'm sure it will come in handy. My job die cuts, perfs and folds into an accordion like book of tickets. Our layout is the entire press sheet and we place the 6 fields in specific places on that layout (can't do imposition as Dan was envisioning and as I'd normally do due to the design of the piece - parts of it are info based without any variable info). Each ticket in the book has a barcode printed on it. So during this discussion I've realized there just really have to be 6 fields in order to designate each code to a different ticket/area of the layout. We get a database of all codes in a single field and I've been reflowing that single field database into one with 6 fields. I had a fantasy when I heard multi-line that it could somehow magically parse every 6 records into 6 fields and let me put each on a different ticket since I hadn't really investigated multi-line and what it's good for. I should have done some research like I usually do, instead of just immediately posting here. Thanks again for the info though. You always have helpful code and ideas and I appreciate learning javascript solutions from you and Dan! -Kim
  12. Thanks, Dan. I should have been clearer. I understand what you mean and do jobs like that most of the time. But this is a layout that has to be a full press sheet layout because it's a special die cut with specific folds and perfs and certain sections that don't have variable and can't be repeated the way you envision. I haven't played with multi-line at all yet. I should have investigated better instead of just hoping that it could mean there was a way to stipulate that every 6 or 8 or 10 lines in a db are one record. Writing this out makes me realize I hadn't fully thought it through b/c for what I'm doing, specific fields are needed. I'll continue managing my data into the number of fields per record that I need and do better investigation into multi-line to figure out more appropriate future use. Thanks for the info.
  13. I haven't used the new multi-line feature yet. I have a database of 10,000 or so codes and I need 6 codes per press sheet layout. I can't use any of the defaults like 'changes' or 'starts with' because each code is unique. But I figure there's a way to say every 6 records? Probably by choosing 'matches'? Hope that makes sense. Basically, I need to have 6 fields on each press sheet. I have a database with one code per record right now. I've been massaging the data to have 6 tab-delimited codes per record and can continue that way, but wanted to try the new multi-line and thought this is a good case for it. Thanks, Kim
  14. Yes, the value of the Logo1 field in the database is ACC-AmericasMart.jpg When Logo1 has a value of ACC-AmericasMart.jpg, then the logo file with that name should show in the top box (which uses the first rule I posted). The formatted text resource should show underneath the logo (those resources are defined as the filename without the .extension). In the case of this logo, there is not a resource named ACC-AmericasMart and the error occurs. I was trying to give you a grab showing all 10 logo boxes with their 10 corresponding formatted text resource boxes. Due to size restrictions on the forum, I couldn't make too large of a grab. Besides, it's not important to be able to read the text under the logos. It's just the formatted text resource with info like a Contact Name, email address, URL, etc. The second rule that you were trying to help me with is where there isn't a resource and it's displaying {RUL_LogoTxt_01} instead of being blank. Here's the pertinent info from the log: RUL_LogoTxt_01, line 5: Error: In Resource(), no resource named ACC-AmericasMart Composing record #1, input record 1 Value for variable RUL_LogoTxt_01 not found in instance data Hope that helps. Kim
  15. Sorry, screen grabs do help don't they? Please see attached. I've got a folder of logos and the user can choose 10 of them to insert on a page. Most of the logos (but not all) have a blurb of text (which I have as a separate formatted text resource) inserted under the logo. There are 3 you will notice in the screen grab which do not have a formatted text resource and are showing the placeholder {RUL}. My rules are: (I've got 10 of each of these rules for Logos 1-10) return CreateResource (Field("Logo1")); and var resName = Field("Logo1").replace(/\..+$/,''); if (!resName || resName == "None") return ""; //else return Resource(resName); Thanks again for your help. Kim
  16. Thanks for the fast reply. When I try that I get an error that there is no resource named *** See attached.
  17. Sorry for my slow response, Dan. I've been out of the office. I realized I was overthinking things and that your initial answer is actually a good solution. The last issue I'm having is that there are a couple of logos that do not have a corresponding formatted text resource. So I'm getting a placeholder {RUL-***} showing when there is an error of No Resource and I need it to just be blank. How do I properly return NullResource when there isn't a formatted text resource? I realize this doesn't work, but I figure I need something along the lines of: if (Resource (Field("Logo1").replace(/\..+$/,'') == "None")) return NullResource(); else return Resource (Field("Logo1").replace(/\..+$/,'')); Thanks! Kim
  18. Thanks, Dan. I'm not sure what the replace is doing? I maybe overthinking this. I have 10 spaces where a user can insert 10 different logos. And 10 corresponding places under each logo to put formatted text resources. I'm not currently at my computer to check, but am wondering if the formatted text resource allows for the insertion of a graphic? Then I could marry the proper logo with its corresponding text from the start in one resource and just have 10 variable blocks of info instead of trying to create rules to put 2 pieces together?
  19. Hi all, Trying to figure out best way to allow users to choose logos from a list to insert on a form (using Fusion Server/Windows). There will be 10 logo areas on the output, with 10 corresponding/related info areas. The user will select a logo from a pulldown list for 10 different fields. If they choose Logo A, then the graphic file for Logo A will be shown in position 1 and the corresponding formatted text resource for Logo A should appear below Logo A. I'm trying to figure out the best way to write the rules so that whatever logo they choose for position 1, they'll also get the text for the logo they chose. Basically: If (Field(Logo1)==ABC.jpg) return Resource(ABC) If (Field(Logo1)==XYZ.jpg) return Resource(XYZ) I know there's an elegant way to do this without having to list all 10 possibilities every time for each of the 10 sections, but I'm not getting anything to work yet. I'm also trying to point to graphic images saved on a Windows server, so I'm trying to reference graphic images at \\servername\filepath\folder\info\graphicfile.jpg which is compounding my problems by giving me errors related to the back slashes. Hope that makes sense. Thanks! Kim
  20. I've got a business card file with the first page as the person's contact info and pages 2-6 are the back with different photos. A rule composes and imposes the file properly so that I will wind up with a pack of 250 cards with 50 of each back. (So the user gets a combo pack with 5 different card backs, 50 each). I'm trying to figure out the best way to get just the 1st (front) page composed for a 1-up 3.5x2 proof, and then also a final print file that's all pages imposed for printing on a press sheet (21-up). Will I need to have 2 setup files - a 1 page proof file with no imposition and a separate 6 page file set to compose for printed output? Or is there a way (maybe using OnRecordStart, SetBodyPage rules, etc.) to make a 1-up, 1 page proof AND the 21-up press sheet output files at the same time from a single setup file? Thanks, Kim
  21. You understood perfectly. This is exactly what I needed. Thanks so much! Now I'm moving on to figuring out the best way to get just the 1st (front) page composed for a 1-up proof, but a final print file that's all pages imposed 21-up. Basically I'll need the first page by itself as a 3.5x2 1 page file for a proof and the final output file imposed 21-up on a press sheet for printing. Not sure if there may be a way (using OnRecordStart and SetBodyPage rules?) to make a 1-up, 1 page proof and the 21-up full print output files at the same time. Or whether it would be better to have a 1-up proof file and then generate the print ready file from another file setup for that after approval. Hope that makes sense. I'll go do some research first and then start another thread... Thanks again for the fast help on my repeatRecordCount rule!!
  22. Hi Ste, I've got a similar need for a business card that needs to have the same front and 5 different backs. I need to wind up with a pack of 250 cards with 50 of each back. I seem to be missing something in my imposition settings because I'm getting an error when I compose of "the number of pages in this record does not match imposition signature, 1 blank page will be added". The front looks correct in the composed output with 21 cards imposed as expected. But the back page shows the 5 backs repeated with random blanks on each back page. I want to impose the records 21-up, so I think that's what's causing my problem. I was expecting to be able to output and keep it ordered to cut and stack so that I wind up with 50 of 1 back, followed by 50 of the next, etc. I'm using the following rule with my 5 backs set as unused pages with unique names. FusionPro.Composition.repeatRecordCount = 250; for (var page = 2; page <= 6; page++) FusionPro.Composition.SetBodyPageUsage(page, page == ((FusionPro.Composition.repeatRecordNumber + 1) % 6 || 6)); My imposition file is set for 6 records with step and repeat settings for Stack count 1, vertical 7, and horizontal 3. Any ideas on what I'm missing? Thanks, Kim
×
×
  • Create New...