Jump to content

Creating a Table


BBE

Recommended Posts

I have no experience creating tables and am in some need of direction. I have a customer who wants a variable letter with a table that can have any where from 2 rows to as much as 29 rows.(see attached pdf for a visual) There is static information below this table that needs to "move" with the table. If the table has more than 7 rows, part of the chart and the static information will run onto the next page. Is there any way to accomplish this?

 

I am using Acrobat X Vers 10.1.8, FP VDP 9.1.0

USF Admin.pdf

Link to comment
Share on other sites

You can create a text rule to return the table and then include that rule in the text frame that the rest of your content is in. That will allow the text beneath it to flow with the table. You can set up your template with an "overflow page" in order to have your text frame run onto the next page.

 

As far as the table creation goes, here is a good place to start.

Link to comment
Share on other sites

thank you for the response. I had found that post that you suggested earlier today and read over it, it just didn't make a whole lot of sense to me. I'll have to dig into it a little further and see if I can get it figured out. It's good to know what I need to figure out is possible.
Link to comment
Share on other sites

Where are you pulling the data from in order to populate your table?

 

If you could provide us with more information or perhaps upload your template with some sample data, someone could probably help you out with generating your table.

Link to comment
Share on other sites

Sure. Attached is the data file and my collected files. I tried to insert what I needed from the post about tables. The table needs static headers as seen in the first post and then variable information below them. The static information below the table also contains a signature...do not know how to get that into a text frame or how to get it to move with the table...or how to get the copy to move to a 2nd page if there is too much information. I have done many variable things in the past, but nothing this complicated.

TEST2.zip

DataFile.zip

Link to comment
Share on other sites

I guess I don't understand how 1 record can produce more than 1 row in the table. You sent two data files. Are you supposed to reference one in order to populate the table?

 

As far as getting the verbiage to move with the table, you can either typeset the text below the table and create a rule to return the signature as an inline graphic like so:

<<TableRule>>

Eventis will continue...

Sincerely, 
<<Signature rule>>
Kari Juni

 

Signature rule (with "treat returned strings as tagged text" checked):

return '<graphic file="signature.jpg">';

 

Or you can make an image out of the bottom part of the letter and return that at the end of the table rule. The former solution will probably allow for better flow when an overflow page is needed.

Edited by step
Link to comment
Share on other sites

I'm struggling to figure out how else to explain it. attached is a pdf showing what the example the customer sent (top) and the database information (bottom). 1 database will be used and the fields in that database will feed information into the variable text field (or in this case the table) yes, the database will be referenced in order to populate the table..in the screen shot Columns D, E, and F will need to be put together as one field before it can be referenced

chart example.pdf

Link to comment
Share on other sites

Okay, I'm assuming you want every record in your data file to appear in the table. These are the steps to doing that:

 

1. FusionPro > Manage Pages > Page Usage: Edit the second page, name it "Back" and set the type to "Overflow"

 

2. Draw a second text frame on the second page and select "Overflow To" in the text frame editor

 

3. Name the text frame on the first page "content"

 

4. Create an OnJobStart Callback rule and put this as the contents:

FusionPro.Composition.composeAllRecords = false;
FusionPro.Composition.endRecordNumber = 1;

5. Create an OnRecordStart Callback rule and put this as the contents:

var signature = "/path/to/signature.jpg";
var data = new ExternalDataFileEx(FusionPro.Composition.inputFileName,',');
var recs = data.recordCount;

// in inches
var BPIDWidth = 1.625; 
var typeWidth = 1.625;
var addressWidth = 1.625;
var idWidth = 1.625;

var myTable = new FPTable;
myTable.AddColumns(7200 * BPIDWidth, 7200 * typeWidth, 7200 * addressWidth, 7200 * idWidth);
myTable.AddRows(recs+1); // Plus 1 for header row
myTable.Rows[0].Cells[0].Font="Helvetica";
myTable.Rows[0].Cells[0].TextColor="Black";
myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left");
myTable.Rows[0].CopyCells(0,1,2,3);

// Header Row
myTable.Rows[0].Cells[0].Content = "BPID";
myTable.Rows[0].Cells[1].Content = "Service Type";
myTable.Rows[0].Cells[2].Content = "Service Address";
myTable.Rows[0].Cells[3].Content = "Circuit ID";

// Populate table with data file records
for (var i=1; i<=recs; i++){
   myTable.Rows[i].Cells[0].Font="Arial";
   myTable.Rows[i].Cells[0].TextColor="Black";
   myTable.Rows[i].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left");
   myTable.Rows[i].CopyCells(0,1,2,3);
   myTable.Rows[i].SetContents(data.GetFieldValue(i,"Billing_Point"), data.GetFieldValue(i,"Charge_Name"), data.GetFieldValue(i,"SP_Address"), data.GetFieldValue(i,"Alternate_ID"));
}   

// Add table to text frame
FindTextFrame("content").content = myTable.MakeTags().replace(/^\<table/, "<table alignment=center");

var verbiage = "<br>" +
              "Eventis will continue to make every effor to recover these costs in a fair and equitable manner.<br>" +
              "If you have any questions regarding this notification, please contact our Business Customer Care Center at<br>" +
              "855-ENVENTIS (855-368-3684).<br><br>" +
              "Sincerely,<br>" +
              '<graphic file="' + signature + '"><br>' +
              "Kari Juni<br>" +
              "Director of Customer Operations";

// Add verbiage to text frame
FindTextFrame("content").content += verbiage;

6. Create a graphic of the signature and put the path to that graphic in the 1st line of the OnRecordStart Callback

 

I'm attaching the template as I edited it for reference. Note that you'll only be able to preview the first record in the table, but once you compose the job, the rest of the table's contents should fill in.

revised.zip

Link to comment
Share on other sites

thank you! most of this seems to be working great!

the one thing I noticed is that when I compose it, I only see one record. the database has 21 records. I made sure I also, the 1 record I do see shows 3 pages, the 3rd one being blank. I do have the record range set to "all"

Link to comment
Share on other sites

another fly in the ointment. here is the 2nd version .... it has static information on it on the far right of the table. how would I get that static information into the rule that is existing and have it repeat down the column depending on how many rows are being used for each file?

Jurisdiction.pdf

Link to comment
Share on other sites

the one thing I noticed is that when I compose it, I only see one record. the database has 21 records. I made sure

Per your sample data (two CSV files in the 5th post) you appear to have separate data files for each letter. Are you combining multiple "tabs" (per your data file naming) into a single CSV, contrary to the samples you uploaded?

 

also, the 1 record I do see shows 3 pages, the 3rd one being blank. I do have the record range set to "all"

Make your text frames slightly longer than the template page (hanging off the bottom edge) to account for hidden content. You'll probably have to play around with the frame height to keep the trailing blank page from being used.

 

another fly in the ointment. here is the 2nd version .... it has static information on it on the far right of the table. how would I get that static information into the rule that is existing and have it repeat down the column depending on how many rows are being used for each file?

You'll need to create a loop in the code that keys off some value in your data which identifies a record as needing an extra column. If the value matches, the loop can add an extra column with either static or variable content.

Link to comment
Share on other sites

I'm getting really close on this. Attached is the latest collected files and a sample output. The only 2 things I need help with is:

 

1. If the information flows to a 2nd page and I compose, I get a 3rd "blank" page and I don't know why (template only has 2 pages in it)

 

2. I am placing a graphic in the last column for the static information (the boxes and interstate and intrastate) so I don't have to mess with change the typestyle for the box(dingbats) and copy(Arial)....I cannot figure out how to get the graphic to "copy" to each row...when I compose the first row works great, and then all other rows put in the word "Boxes" which is the name of my graphic. (see sample output)

TEST NEW.zip

testNEWcompose.pdf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...