Jump to content

Overflow to specific text box


Kevin Fay

Recommended Posts

I have two text boxes on a page (A and B). Each one lists a different category of items, by state. A state could have 1 item in A and 300 in B. Another state could have 10 in A and 10 in B.

 

I need to be able to overflow the contents of each text box onto a new page, but have it only overflow into the corresponding text box on the overflow page...B overflows into B.

 

I tried it out with normal overflow, and it put everything into B on the overflow page. If both columns overflow, the overflow page should have data in each column.

 

I don't see how linking the boxes would work, since I have an known number of pages.

 

I am using 7.1 in Windows 7.

Link to comment
Share on other sites

I don't see how linking the boxes would work, since I have an known number of pages.

I presume you mean that you have an unknown number of pages to insert. Otherwise, you could indeed just link up frames between the two body pages.

I have two text boxes on a page (A and B). Each one lists a different category of items, by state. A state could have 1 item in A and 300 in B. Another state could have 10 in A and 10 in B.

 

I need to be able to overflow the contents of each text box onto a new page, but have it only overflow into the corresponding text box on the overflow page...B overflows into B.

 

I tried it out with normal overflow, and it put everything into B on the overflow page. If both columns overflow, the overflow page should have data in each column.

You can't have more than one overflow destination frame (with the "Overflow To" box on the Frame Properties dialog checked) on an Overflow page. I can't imagine too many scenarios in which the output document would make sense to a reader with multiple overflows on the same page. Plus, in the case where you have "1 item in A and 300 in B", you'd have a lot of of wasted blank space on multiple overflow pages.

 

You might consider placing the items in a two-column table, which could overflow to a single overflow page. Or use two overflow pages, one for each set of items.

Link to comment
Share on other sites

Dan,

 

You are correct, I meant unknown number of pages.

 

I sent the document to tech support and they said that it is not possible to do what I want...specify where the overflow of 2 separate text boxes goes to.

 

I ended up making an overflow for each and I am using Pitstop to move things where I need them to be.

Link to comment
Share on other sites

  • 1 year later...
Is there a way to force text to break at a certain point & flow into the next box?

I have 4 variable bullet points. I would like to keep them in 1 rule & have:

bullet points 1&2 in Text Box A.

&

bullet points 3&4 in Text Box B.

How could that be arranged?

Thanks

Well, if the issue is just keeping the code in one place, you could assign the text to each frame in OnRecordStart; something like this:

FindTextFrame("Frame1Name").content = "some text from logic in the rule";
FindTextFrame("Frame2Name").content = "some other text from logic in the rule";

That said, you can force a break to a new frame or column with this tag:

<p verticalstart=topofcolumn br=false>

Link to comment
Share on other sites

Actually I just tried this rule as a new empty text rule.

It does work I was wondering what your thoughts would be.

 

if(Field("area1") != "00087") return "";

var frameA = FindTextFrame("bullet_1n2");

var frameB = FindTextFrame("bullet_3n4");

frameA.content = frameA.content + "this and that" + "<br>" + Field("area2");

frameB.content = frameB.content + "these N those";

return "";

Link to comment
Share on other sites

Actually I just tried this rule as a new empty text rule.

It does work I was wondering what your thoughts would be.

Well, it may happen to work in a regular rule, but I recommend putting such logic in the OnRecordStart Callback. The order in which other rules are evaluated is not guaranteed, and you could end up having multiple rules which try to do conflicting things with a given frame. Also, the ability to manipulate the frame content in this way, outside of a Callback rule, is considered unsupported, and may be removed in the future.

 

So I would just do this in OnRecordStart:

if (Field("area1") == "00087")
{
   FindTextFrame("bullet_1n2").content += "this and that" + "<br>" + Field("area2");
   FindTextFrame("bullet_3n4").content += "these N those";
}

Note the use of the += (string concatenation) operator as well.

Link to comment
Share on other sites

Ok Dan I see your point. Here is one of my issues. I have 12 different sets of 4 bullet points. I could make 12 rules for box 1 & another 12 rules for box 2.

or; following your example, I could put all 12 rules in one OnRecordStart.

Do you think the solution below is a good idea? I build 12 rules similar to the one below ('Rule_BulletstoFrames00087'), then call for all of them in the OnRecordStart. It works and it does use the OnRecordStart. I just want to make sure not to back us into a corner (like you mentioned earlier).

 

OnRecordStart

Rule('Rule_BulletstoFrames00087');

Rule('Rule_BulletstoFrames00088');

Rule('Rule_BulletstoFrames00089');

Rule('Rule_BulletstoFrames00090');

Link to comment
Share on other sites

Rule_BulletstoFrames00087

if(Field("CompanyType") != "00087") return "";

var frameA = FindTextFrame("bullet_1n2");

var frameB = FindTextFrame("bullet_3n4");

frameA.content = "";

frameB.content = "";

frameA.content += "this and that" + "<br>" + Field("area2");

frameB.content += "these N those";

return "";

Link to comment
Share on other sites

You could just as easily write your rules directly in the callback rule instead of calling to separate rules each time. And by combining them, you'd be able to condense them into a SWITCH to only process the information applicable to each record.

var frameA = "";
var frameB = "";
switch (Field("CompanyType")) {
  case "00087":
  frameA += "this and that" + "<br>" + Field("area2"); 
  frameB += "these N those"; 
  break;

  case: "00088":
  frameA += "something else<br>" + Field("area2"); 
  frameB += "and a little more"; 
  break;

  //add cases for each value
  //if multiple values use same logic, you can write logic once 
  //and precede it with multiple cases. For example:

  case "00089":
  case "00090":
  default:
  frameA += "a third option<br>" + Field("area2"); 
  frameB += ""; 
  break;
}
FindTextFrame("bullet_1n2").content = frameA;
FindTextFrame("bullet_3n4").content = frameB;

Link to comment
Share on other sites

Ok I'll do that. I started this job without being a "programer" (I'm working on changing that).

Soo...

I thought that was a lot of code for 1 rule. I was trying to cut it down into smaller chunks

I realize it is not a lot of code, I just need to get used to it.

Thanks for the advice!

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