RE: output cf to html
right. but what about when you want to do that but have the people into 3 columns, basically divided by count of maxrows i just cant do it in a group! if i could learn how to use query of a query in this situation. i could get rid of the 12+ separate pages i have. that basically just do what's below here.. City - Columbus All employee phone --Adam---Ghristy---Mric --Bob1HaronNran --Cdam---IhristyOric --Dob1JaronPran --Edam---Khristy---Qric --Fob1LaronRran City - Columbus ---Studio A --Adam---Christy---Eric --whatever1--whatever4 -whatever7 --whatever2--whatever5 -whatever8 --whatever3--whatever6 -whatever9 --Bob1--Daron-Fran --whatever1---whatever4 ---whatever7 --whatever2---whatever5 ---whatever8 --whatever3---whatever6 ---whatever9 City - Columbus ---Studio 56 --Adam---Christy---Eric --whatever1--whatever4 -whatever7 --whatever2--whatever5 -whatever8 --whatever3--whatever6 -whatever9 --Bob1--Daron-Fran --whatever1---whatever4 ---whatever7 --whatever2---whatever5 ---whatever8 --whatever3---whatever6 ---whatever9 City - Columbus ---Title Partners --Adam---Christy---Joe ---Title Priciplals --Adam---Christy---Joe ---Title Senior Associates --Adam---Christy---Joe ---Title Associates --Adam---Christy---Joe City - Seattle All employee phone --Adam---Ghristy---Mric --Bob1HaronNran --Cdam---IhristyOric --Dob1JaronPran --Edam---Khristy---Qric --Fob1LaronRran City - Seattle ---Studio 23 --Adam---Christy---Eric --whatever1--whatever4 -whatever7 --whatever2--whatever5 -whatever8 --whatever3--whatever6 -whatever9 --Bob1--Daron-Fran --whatever1---whatever4 ---whatever7 --whatever2---whatever5 ---whatever8 --whatever3---whatever6 ---whatever9 City - Seattle ---Studio 78 --Adam---Christy---Eric --whatever1--whatever4 -whatever7 --whatever2--whatever5 -whatever8 --whatever3--whatever6 -whatever9 --Bob1--Daron-Fran --whatever1---whatever4 ---whatever7 --whatever2---whatever5 ---whatever8 --whatever3---whatever6 ---whatever9 City - Seattle ---Title Partners --Adam---Christy---Joe ---Title Priciplals --Adam---Christy---Joe ---Title Senior Associates --Adam---Christy---Joe ---Title Associates --Adam---Christy---Joe -paul -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 8:16 PM To: CF-Talk Subject: RE: output cf to html example query... SELECT state, city, firstName, lastName FROM myTable ORDER BY state, city, firstName, lastName -- cfoutput query=myQuery group=state #state#br cfoutput group=city ---#city#br cfoutput group=firstName --#firstName#br cfoutput -#lastName#br /cfoutput /cfoutput /cfoutput /cfoutput this will yield the following results: State1 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 State2 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 4:34 PM To: CF-Talk Subject: RE: output cf to html yeh... i think i understand that Bryan but when i am doing a count on the records then dividing them into say 3 generating separate columns of data say 3 that's where i get all messed up i can easily out put in to 3 columns from the top down then right down but if i want that out put to be grouped possibly sub grouped say on studio name then say title that's when it gets so funky that i just resort to dumb 3 column looped queries that i include 20+ times in a master page! argh! should be easy to figure out, but i cant thx -paul -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 6:40 PM To: CF-Talk Subject: RE: output cf to html simple lesson in query grouping... When you specify a group attribute like so... cfoutput query=myQuery group=firstName do whatever cfoutput do inner stuff
RE: output cf to html
Try something with temp variable and see if they change, you should only have to loop though the query once: ex: query SELECT state, city, firstName, lastName FROM myTable ORDER BY state, city, firstName, lastName /query Cfset statetemp = cfset citytemp = cfset firstnametemp = cfoutput query=myQuery cfif state neq statetemp #state#br cfset statetest = state cfif cfif city neq citytemp ---#citybr cfset citytemp=city /cfif cfif firstName neq firstNametemp --#firstName#br cfset firstNametemp = firstName /cfif -#lastName#br /cfoutput -- Sam -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 5:16 PM To: CF-Talk Subject: RE: output cf to html example query... SELECT state, city, firstName, lastName FROM myTable ORDER BY state, city, firstName, lastName -- cfoutput query=myQuery group=state #state#br cfoutput group=city ---#city#br cfoutput group=firstName --#firstName#br cfoutput -#lastName#br /cfoutput /cfoutput /cfoutput /cfoutput this will yield the following results: State1 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 State2 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 4:34 PM To: CF-Talk Subject: RE: output cf to html yeh... i think i understand that Bryan but when i am doing a count on the records then dividing them into say 3 generating separate columns of data say 3 that's where i get all messed up i can easily out put in to 3 columns from the top down then right down but if i want that out put to be grouped possibly sub grouped say on studio name then say title that's when it gets so funky that i just resort to dumb 3 column looped queries that i include 20+ times in a master page! argh! should be easy to figure out, but i cant thx -paul -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 6:40 PM To: CF-Talk Subject: RE: output cf to html simple lesson in query grouping... When you specify a group attribute like so... cfoutput query=myQuery group=firstName do whatever cfoutput do inner stuff /cfoutput /cfoutput it will loop over the results and will do whatever every time it finds a firstName that is different than the previous result. do inner stuff will process all the rows that have the same firstName as the previous row. Example: row firstName lastName 1. Adam Ant 2. Adam Apple 3. Anna Conda for the code above, do whatever will happen for rows 1 and 3. do inner stuff will happen for row 2. It is crucial that you ORDER BY whatever column you want to group by in your SELECT query. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:18 PM To: CF-Talk Subject: RE: output cf to html thanks guys... i will try it a few differnt way that you suggested. Now if i could only learn how to loop over my quries with a group with QaQ?? then i think i wouldnt even need to do this right now i have like 20 incldes a hiting the same data source many, many times just to get the output i want very convoluted amature... i know.. wish i knew more. __ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
Just schedule it on your CF server in Administration Tools. Delete the original file Create a new file Write the report + html coding to the file. Or am I missing the point? Margaret -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 2:35 PM To: CF-Talk Subject: output cf to html I have this Huge Honking report written in cf it shows exactly what i want. but i don't want a user to run this report every time they hit the page. i would like to know how to have cf-server run the page... but just save it to html every night. so that it gets updated basically once a day. instead of hitting the db every time some one views the cfm page.. any ideas? -paul __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
Hehe.. wouldn't ya know that you can do this with CFSchedule - take a look in cf admin (or can be set up programmatically) - let's you schedule a page, and optionally, save as html - sound like what you want? :-) --- Billy Cravens -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 4:35 PM To: CF-Talk Subject: output cf to html I have this Huge Honking report written in cf it shows exactly what i want. but i don't want a user to run this report every time they hit the page. i would like to know how to have cf-server run the page... but just save it to html every night. so that it gets updated basically once a day. instead of hitting the db every time some one views the cfm page.. any ideas? -paul __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
As another option you could cache the queries for 24hours. cfquery name=my_query datasource=my_datasource CachedWithin=#CreateTimeSpan(1,0,0,0)# -- Sam -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 2:35 PM To: CF-Talk Subject: output cf to html I have this Huge Honking report written in cf it shows exactly what i want. but i don't want a user to run this report every time they hit the page. i would like to know how to have cf-server run the page... but just save it to html every night. so that it gets updated basically once a day. instead of hitting the db every time some one views the cfm page.. any ideas? -paul __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
This is your most reliable option (CFschedule is flaky). At the top of the page that displays the report (report.cfm) put this line: cfset today = dateFormat(now(),mm_dd_yy) cfset fileName = #expandPath(./)#/report_#today#.htm cfif NOT fileExists(#fileName#) !--- query --- !--- loop through the query and create a string representing the entire HTML report--- cffile action=write file=#fileName# output=#htmlString# cflocation url=report.cfm /cfif cfinclude template=report_#today#.htm You may experience problems with the file not being registered with the file system after creating it the first time. This may lead to the page looping 2 or 3 times before it realizes the file exists. If this happens just remove the cflocation and put a META refresh on the page with a message like loading report Give it a 5 second reload time and you'll be set. This way the html report will be created fresh the first time it is called each day. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 2:35 PM To: CF-Talk Subject: output cf to html I have this Huge Honking report written in cf it shows exactly what i want. but i don't want a user to run this report every time they hit the page. i would like to know how to have cf-server run the page... but just save it to html every night. so that it gets updated basically once a day. instead of hitting the db every time some one views the cfm page.. any ideas? -paul __ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
thanks guys... i will try it a few differnt way that you suggested. Now if i could only learn how to loop over my quries with a group with QaQ?? then i think i wouldnt even need to do this right now i have like 20 incldes a hiting the same data source many, many times just to get the output i want very convoluted amature... i know.. wish i knew more. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
simple lesson in query grouping... When you specify a group attribute like so... cfoutput query=myQuery group=firstName do whatever cfoutput do inner stuff /cfoutput /cfoutput it will loop over the results and will do whatever every time it finds a firstName that is different than the previous result. do inner stuff will process all the rows that have the same firstName as the previous row. Example: row firstName lastName 1. Adam Ant 2. Adam Apple 3. Anna Conda for the code above, do whatever will happen for rows 1 and 3. do inner stuff will happen for row 2. It is crucial that you ORDER BY whatever column you want to group by in your SELECT query. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:18 PM To: CF-Talk Subject: RE: output cf to html thanks guys... i will try it a few differnt way that you suggested. Now if i could only learn how to loop over my quries with a group with QaQ?? then i think i wouldnt even need to do this right now i have like 20 incldes a hiting the same data source many, many times just to get the output i want very convoluted amature... i know.. wish i knew more. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
yeh... i think i understand that Bryan but when i am doing a count on the records then dividing them into say 3 generating separate columns of data say 3 that's where i get all messed up i can easily out put in to 3 columns from the top down then right down but if i want that out put to be grouped possibly sub grouped say on studio name then say title that's when it gets so funky that i just resort to dumb 3 column looped queries that i include 20+ times in a master page! argh! should be easy to figure out, but i cant thx -paul -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 6:40 PM To: CF-Talk Subject: RE: output cf to html simple lesson in query grouping... When you specify a group attribute like so... cfoutput query=myQuery group=firstName do whatever cfoutput do inner stuff /cfoutput /cfoutput it will loop over the results and will do whatever every time it finds a firstName that is different than the previous result. do inner stuff will process all the rows that have the same firstName as the previous row. Example: row firstName lastName 1. Adam Ant 2. Adam Apple 3. Anna Conda for the code above, do whatever will happen for rows 1 and 3. do inner stuff will happen for row 2. It is crucial that you ORDER BY whatever column you want to group by in your SELECT query. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:18 PM To: CF-Talk Subject: RE: output cf to html thanks guys... i will try it a few differnt way that you suggested. Now if i could only learn how to loop over my quries with a group with QaQ?? then i think i wouldnt even need to do this right now i have like 20 incldes a hiting the same data source many, many times just to get the output i want very convoluted amature... i know.. wish i knew more. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: output cf to html
example query... SELECT state, city, firstName, lastName FROM myTable ORDER BY state, city, firstName, lastName -- cfoutput query=myQuery group=state #state#br cfoutput group=city ---#city#br cfoutput group=firstName --#firstName#br cfoutput -#lastName#br /cfoutput /cfoutput /cfoutput /cfoutput this will yield the following results: State1 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 State2 ---City1 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 ---City2 --Adam -whatever1 -whatever2 -whatever3 --Bob -whatever1 -whatever2 -whatever3 -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 4:34 PM To: CF-Talk Subject: RE: output cf to html yeh... i think i understand that Bryan but when i am doing a count on the records then dividing them into say 3 generating separate columns of data say 3 that's where i get all messed up i can easily out put in to 3 columns from the top down then right down but if i want that out put to be grouped possibly sub grouped say on studio name then say title that's when it gets so funky that i just resort to dumb 3 column looped queries that i include 20+ times in a master page! argh! should be easy to figure out, but i cant thx -paul -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 6:40 PM To: CF-Talk Subject: RE: output cf to html simple lesson in query grouping... When you specify a group attribute like so... cfoutput query=myQuery group=firstName do whatever cfoutput do inner stuff /cfoutput /cfoutput it will loop over the results and will do whatever every time it finds a firstName that is different than the previous result. do inner stuff will process all the rows that have the same firstName as the previous row. Example: row firstName lastName 1. Adam Ant 2. Adam Apple 3. Anna Conda for the code above, do whatever will happen for rows 1 and 3. do inner stuff will happen for row 2. It is crucial that you ORDER BY whatever column you want to group by in your SELECT query. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Paul Ihrig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:18 PM To: CF-Talk Subject: RE: output cf to html thanks guys... i will try it a few differnt way that you suggested. Now if i could only learn how to loop over my quries with a group with QaQ?? then i think i wouldnt even need to do this right now i have like 20 incldes a hiting the same data source many, many times just to get the output i want very convoluted amature... i know.. wish i knew more. __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists