Your SlideShare is downloading. ×
0
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Coldfusion with Keith Diehl
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Coldfusion with Keith Diehl

200

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
200
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. How ColdFusion saved mefrom a week of grunt work Using SQL Server and Coldfusionto generate 600 Word Documents.
  • 2. Buy One Class – Get One Class 50% off until December 15
  • 3. Why ColdFusion?• Quick learning curve• Similar style to HTML with opening and closing tags• Supported by Adobe and frequently updated with new features• ColdFusion isn’t free but also not that expensive• Hosted ColdFusion accounts are about $30 a month• Free Developer Edition
  • 4. Can you guess what this does? <cfloop index="i" from="1" to="10"> <cfoutput> <p> #i# </p> </cfoutput> </cfloop>
  • 5. Can I get this outline as a Word Doc? Ummm… No.
  • 6. <cfoutput> <h1>#database.h1#</h1> <h2>#database.h2#</h2> #database.classOutline#</cfoutput>
  • 7. I need all of our outlines in Word … super.
  • 8. Can ColdFusion come to my rescue? Yup!
  • 9. Step 1: Get the info from the database<cfquery name="allOutlines" datasource="datasource" username="username" password="password"> SELECT ID, Name, Days, H1, ClassOutline, FileName FROM classroomTable ORDER BY Name</cfquery>
  • 10. Step 2: Output class info into a variable<cfoutput query="allOutlines"> <cfsavecontent variable="myDocument"> <html xmlns:w="urn:schemas-microsoft-com:office:word"> <!--- Head tag instructs Word to start up a certain way, specifically in print view. ---> <head> <xml> <w:WordDocument> <w:View>Print</w:View> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml> </head>
  • 11. Step 3: Write variable into Word Doc<body> <cfoutput> <h1>#allOutlines.Name#</h1> <p>#allOutlines.Days# <cfif allOutlines.Days GT "1">days<cfelse>day</cfif></p> #allOutlines.classOutline# </cfoutput></body></html></cfsavecontent><cfscript> FileWrite("Server:word-outlines#allOutlines.ID#-#allOutlines.FileName#.doc", "#myDocument#");</cfscript></cfoutput>
  • 12. This is my lonely directory
  • 13. my directory with lots of friends…
  • 14. SUPER CODER!

×