Kevin Fay Posted September 19, 2011 Share Posted September 19, 2011 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. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 21, 2011 Share Posted September 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
Kevin Fay Posted September 21, 2011 Author Share Posted September 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 10, 2012 Share Posted December 10, 2012 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 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 10, 2012 Share Posted December 10, 2012 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> Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 10, 2012 Share Posted December 10, 2012 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 ""; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 11, 2012 Share Posted December 11, 2012 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. Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 11, 2012 Share Posted December 11, 2012 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'); Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 11, 2012 Share Posted December 11, 2012 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 ""; Quote Link to comment Share on other sites More sharing options...
esmith Posted December 11, 2012 Share Posted December 11, 2012 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; Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 12, 2012 Share Posted December 12, 2012 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.