Jump to content

Kim

Registered Users - Approved
  • Posts

    72
  • Joined

Converted

  • FusionPro Products
    Yes

Converted

  • FusionPro VDP software version
    10.0.16

Converted

  • OS
    Mac OS 10.12

Kim's Achievements

Enthusiast

Enthusiast (6/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

10

Reputation

  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
×
×
  • Create New...