Jump to content

Rule to relocate a text box?


Recommended Posts

Working on this business card still. Some of the records have short employee titles ("TITLE" Field) while other records have long titles that wrap to a 2nd line.

 

What I'm aiming for is that all the information on the card moves down a line if the TITLE wraps. I tried putting all the information into one text box (the "lower half," as it were, of the business card is split into two columns), but using tab stops was keeping my data from suppressing properly (some records have a mobile or office number, while some dont). Also it was keeping my CopyFit rule from working (another problem entirely?). So i put another text box in place for the right column. This is an example of a good single-line-title business card:

 

http://imageshack.us/photo/my-images/571/screenshot20130404at246.png/

 

However, if the TITLE field is long and wraps around, I want everything to drop down so that the spacing remains the same. This is an example of a double-line-title card, notice the right column isn't lined up:

 

http://imageshack.us/photo/my-images/811/screenshot20130404at247.png/

 

I may be doing this wrong. Any help is really appreciated! Thanks!

Link to comment
Share on other sites

Sorry, off for the weekend. Hopefully this helps:

 

new FPTable;

var myTable = new FPTable;

myTable.AddColumns(9400, 3600, 9000);

myTable.AddRows(3);

myTable.Rows[0].Cells[1].HAlign = "Left";

myTable.Rows[0].SetContents(Field("Street address"), Field("Office"), Field("PHONE"));

myTable.Rows[1].SetContents(Field("City State Zip"), Field("Mobile"), Field("CELL"));

myTable.Rows[2].SetContents("", "", Field("EMAIL"));

 

return myTable.MakeTags(true);

Link to comment
Share on other sites

Sorry, off for the weekend. Hopefully this helps:

 

new FPTable;

var myTable = new FPTable;

myTable.AddColumns(9400, 3600, 9000);

myTable.AddRows(3);

myTable.Rows[0].Cells[1].HAlign = "Left";

myTable.Rows[0].SetContents(Field("Street address"), Field("Office"), Field("PHONE"));

myTable.Rows[1].SetContents(Field("City State Zip"), Field("Mobile"), Field("CELL"));

myTable.Rows[2].SetContents("", "", Field("EMAIL"));

 

return myTable.MakeTags(true);

Well, it's still hard to read the tiny comments in the picture you posted. I think one says that the email copyfit rule isn't working. Yeah, because you're not calling it. Replace Field("EMAIL") in the last line with Rule("EmailCopyfitRule"), or whatever the rule name is.

 

I think the other comments are about the spacing between columns. That can all be tweaked by changing the widths of your columns, or the margins. Please refer to the table API documentation.

Link to comment
Share on other sites

Sorry it took so long to respond Dan; thanks for pointing that out. I ended up not using a table after all. I used tab stops to align my plus signs etc, and "supress if containing empty variables" was the kicker I was missing. In order to make my text boxes move correctly, I used two pages and a simple bit of JS to swap them out based on a "TitleLine2" Field.

 

Thank you sir!

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...