RE: Character count on record count??/
: Running a cfoutput TotalLen/Narrative[I] looks fine on a regular display. : I think it's the behavior of activepdf that is the problem. : Each [i] must be identified/hardcoded on the pdf ie: Narrative1, : narrative2, : Narrative3, Narrative4 : So on my action page up to 5000 characters may make Narrative1 equal : Narrative1/Narrative2/Narrativd3 : : Does that make sense? Not really, but I'll try not to blame you for it. :-) Why don't you run the loop creating a set of variables with dynamic names (ie page1, page2, etc) by concatenating the Narratives. That way you have 'hard' variable names. Then, when the loop which concatenates the contents is done, you run a second loop which takes each page and inserts it into a page in the PDF. Did that make sense? --Ben ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
Running a cfoutput TotalLen/Narrative[I] looks fine on a regular display. I think it's the behavior of activepdf that is the problem. Each [i] must be identified/hardcoded on the pdf ie: Narrative1, narrative2, Narrative3, Narrative4 So on my action page up to 5000 characters may make Narrative1 equal Narrative1/Narrative2/Narrativd3 Does that make sense? -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 11:24 AM To: CF-Talk Subject: RE: Character count on record count??/ Why not just keep a running total inside the loop, as I thought I was demonstrating? Having never worked with ActivPDF, maybe I'm missing something, but why wouldn't you simply keep track of how many characters you've already added, rather than trying to re-calculate it each time? -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Janine Jakim [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 11:06 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : Well the page part was easy enough to do. : It's the setting of the variable that I can't seem to get. I can set and : send the variable to a regular html page fine. It's the setting in : activePDF, which pulls the only the last : #NarrativeGet.EduLeveNarrative[i]# : (looks like each reiteration of the loop it resets it to the newest [i]) : I'm wondering how I can dynamically concatenate : #NarrativeGet.EduLeveNarrative[1]#+#NarrativeGet.EduLeveNarrative[2]# : +#NarrativeGet.EduLeveNarrative[3]# for activepdf...argh : Thanks for all the insight : j : -Original Message- : From: Ben Doom [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 9:48 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : : : : #(Len(NarrativeGet.EduLevelNarrative[I])# : : : : Initialize a temp variable to 0. Let's call it "totalLen". : Also, you need : a counter to tell you what page you're on. Each time you are about to try : to add a page, do something like : : if (totalLen + len(NarrativeGet.EduLevelNarrative[i]) gt 5000) : { : totalLen = 0; : pageRef = pageRef + 1; : } : totalLen = totalLen + len(NarrativeGet.EduLevelNarrative[i]); : addToPage(pageRef, NarrativeGet.EduLeveNarrative[i]); : : where addToPage() represents whatever has to be done to add the thing to a : page. : : Please note that this is thrown together off the top of my head. But it : seems to me to be in the right direction. : : HTH. : : : -- Benjamin C. Doom : Programmer [EMAIL PROTECTED] : Moonbow Software, Inc. 606.864.0041x4 : : : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
Why not just keep a running total inside the loop, as I thought I was demonstrating? Having never worked with ActivPDF, maybe I'm missing something, but why wouldn't you simply keep track of how many characters you've already added, rather than trying to re-calculate it each time? -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Janine Jakim [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 11:06 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : Well the page part was easy enough to do. : It's the setting of the variable that I can't seem to get. I can set and : send the variable to a regular html page fine. It's the setting in : activePDF, which pulls the only the last : #NarrativeGet.EduLeveNarrative[i]# : (looks like each reiteration of the loop it resets it to the newest [i]) : I'm wondering how I can dynamically concatenate : #NarrativeGet.EduLeveNarrative[1]#+#NarrativeGet.EduLeveNarrative[2]# : +#NarrativeGet.EduLeveNarrative[3]# for activepdf...argh : Thanks for all the insight : j : -Original Message- : From: Ben Doom [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 12, 2003 9:48 AM : To: CF-Talk : Subject: RE: Character count on record count??/ : : : : : : #(Len(NarrativeGet.EduLevelNarrative[I])# : : : : Initialize a temp variable to 0. Let's call it "totalLen". : Also, you need : a counter to tell you what page you're on. Each time you are about to try : to add a page, do something like : : if (totalLen + len(NarrativeGet.EduLevelNarrative[i]) gt 5000) : { : totalLen = 0; : pageRef = pageRef + 1; : } : totalLen = totalLen + len(NarrativeGet.EduLevelNarrative[i]); : addToPage(pageRef, NarrativeGet.EduLeveNarrative[i]); : : where addToPage() represents whatever has to be done to add the thing to a : page. : : Please note that this is thrown together off the top of my head. But it : seems to me to be in the right direction. : : HTH. : : : -- Benjamin C. Doom : Programmer [EMAIL PROTECTED] : Moonbow Software, Inc. 606.864.0041x4 : : : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
Well the page part was easy enough to do. It's the setting of the variable that I can't seem to get. I can set and send the variable to a regular html page fine. It's the setting in activePDF, which pulls the only the last #NarrativeGet.EduLeveNarrative[i]# (looks like each reiteration of the loop it resets it to the newest [i]) I'm wondering how I can dynamically concatenate #NarrativeGet.EduLeveNarrative[1]#+#NarrativeGet.EduLeveNarrative[2]# +#NarrativeGet.EduLeveNarrative[3]# for activepdf...argh Thanks for all the insight j -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 9:48 AM To: CF-Talk Subject: RE: Character count on record count??/ : : #(Len(NarrativeGet.EduLevelNarrative[I])# : Initialize a temp variable to 0. Let's call it "totalLen". Also, you need a counter to tell you what page you're on. Each time you are about to try to add a page, do something like if (totalLen + len(NarrativeGet.EduLevelNarrative[i]) gt 5000) { totalLen = 0; pageRef = pageRef + 1; } totalLen = totalLen + len(NarrativeGet.EduLevelNarrative[i]); addToPage(pageRef, NarrativeGet.EduLeveNarrative[i]); where addToPage() represents whatever has to be done to add the thing to a page. Please note that this is thrown together off the top of my head. But it seems to me to be in the right direction. HTH. -- Benjamin C. Doom Programmer [EMAIL PROTECTED] Moonbow Software, Inc. 606.864.0041x4 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
: : #(Len(NarrativeGet.EduLevelNarrative[I])# : Initialize a temp variable to 0. Let's call it "totalLen". Also, you need a counter to tell you what page you're on. Each time you are about to try to add a page, do something like if (totalLen + len(NarrativeGet.EduLevelNarrative[i]) gt 5000) { totalLen = 0; pageRef = pageRef + 1; } totalLen = totalLen + len(NarrativeGet.EduLevelNarrative[i]); addToPage(pageRef, NarrativeGet.EduLeveNarrative[i]); where addToPage() represents whatever has to be done to add the thing to a page. Please note that this is thrown together off the top of my head. But it seems to me to be in the right direction. HTH. -- Benjamin C. Doom Programmer [EMAIL PROTECTED] Moonbow Software, Inc. 606.864.0041x4 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
Why can't you just use SQL? SELECT LEN(yourfield) AS 'Length' Neil -Original Message- From: Janine Jakim [mailto:[EMAIL PROTECTED] Sent: 12 March 2003 14:27 To: CF-Talk Subject: RE: Character count on record count??/ Maybe I'm making this harder than it is (that's usual for me) It sounds easy enough-but I am stuck- let me show you my code I have this: #(Len(NarrativeGet.EduLevelNarrative[I])# Thanks, j -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 5:17 PM To: CF-Talk Subject: RE: Character count on record count??/ : 2. count the characters used in each narrative. Retrieve the narratives and use len() on them. Probably add some to it to allow a break between narratives. : 3. Output the narratives in chuncks of 5000 characters. (or to the : narratives that come close to 5000) For example : narrative1=2000 characters : narrative2= 50 characters : narrative3=1000 characters : narrative4=2000 characters : so the page would only show the first 3 narratives Since you (apparently) want them to show up in order, look at the first. If it's length is less than 5000 (I assume it always will be, is this true?), add it to the 1st page and add its length to the total length of the first page. Repeat. If the total length of the page will exceed 5000, start a new page. : Make sense? doable?? Yes and yes, I think. :-) -- Ben Doom Programmer & General Lackey Moonbow Software, Inc ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
Maybe I'm making this harder than it is (that's usual for me) It sounds easy enough-but I am stuck- let me show you my code I have this: #(Len(NarrativeGet.EduLevelNarrative[I])# Thanks, j -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 5:17 PM To: CF-Talk Subject: RE: Character count on record count??/ : 2. count the characters used in each narrative. Retrieve the narratives and use len() on them. Probably add some to it to allow a break between narratives. : 3. Output the narratives in chuncks of 5000 characters. (or to the : narratives that come close to 5000) For example : narrative1=2000 characters : narrative2= 50 characters : narrative3=1000 characters : narrative4=2000 characters : so the page would only show the first 3 narratives Since you (apparently) want them to show up in order, look at the first. If it's length is less than 5000 (I assume it always will be, is this true?), add it to the 1st page and add its length to the total length of the first page. Repeat. If the total length of the page will exceed 5000, start a new page. : Make sense? doable?? Yes and yes, I think. :-) -- Ben Doom Programmer & General Lackey Moonbow Software, Inc ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Character count on record count??/
: 2. count the characters used in each narrative. Retrieve the narratives and use len() on them. Probably add some to it to allow a break between narratives. : 3. Output the narratives in chuncks of 5000 characters. (or to the : narratives that come close to 5000) For example : narrative1=2000 characters : narrative2= 50 characters : narrative3=1000 characters : narrative4=2000 characters : so the page would only show the first 3 narratives Since you (apparently) want them to show up in order, look at the first. If it's length is less than 5000 (I assume it always will be, is this true?), add it to the 1st page and add its length to the total length of the first page. Repeat. If the total length of the page will exceed 5000, start a new page. : Make sense? doable?? Yes and yes, I think. :-) -- Ben Doom Programmer & General Lackey Moonbow Software, Inc ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Character count on record count??/
I have a page where teachers write narratives on students- this will be sent to a pdf. I'm wondering about all of the empty space- each page can hold 5000 characters. Depending on the teacher groups a student may have a 1 -6 page narrative...(ie: one teacher may write 200 characters/another 1500/etc...)What I want to do is figure out- how to put these narratives together without a bunch of space between the entries. (ie: we discussed blocks of 1250 characters, but that may look odd if teachers do not write much) 1. record count of narratives (know how to do that) 2. count the characters used in each narrative. 3. Output the narratives in chuncks of 5000 characters. (or to the narratives that come close to 5000) For example narrative1=2000 characters narrative2= 50 characters narrative3=1000 characters narrative4=2000 characters so the page would only show the first 3 narratives Make sense? doable?? thanks, j ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4