Incorporating ColdFusion with Microsoft Office.


84 views
Uploaded on:
Category: Education / Career
Description
Incorporating ColdFusion with Microsoft Office Samuel Neff November 19-21, 2003 About the Moderator Samuel Neff (sam@blinex.com) Senior Programming Engineer at B-Line Express Group Macromedia Volunteer for CF Before CF, three years particular involvement in Office dev
Transcripts
Slide 1

Coordinating ColdFusion with Microsoft Office Samuel Neff November 19-21, 2003

Slide 2

About the Presenter Samuel Neff (sam@blinex.com) Senior Software Engineer at B-Line Express Team Macromedia Volunteer for CF Before CF, three years particular involvement in Office dev Word, Excel, Visual Basic for Applications Integrating ColdFusion with Microsoft Office (SS216W)

Slide 3

Agenda Introduction – Why incorporate? Mechanization and Office Web Components OLE Document Properties Microsoft Jet HTML/XML/CSS Hybrid Pure XML Comparisons, choices, and assets Integrating ColdFusion with Microsoft Office (SS216W)

Slide 4

Why coordinate with Office? Predictable generation of reports Integrating ColdFusion with Microsoft Office (SS216W)

Slide 5

Why coordinate with Office? Give clients editable records Integrating ColdFusion with Microsoft Office (SS216W)

Slide 6

Why incorporate with Office? Influence elements of the Office suite Integrating ColdFusion with Microsoft Office (SS216W)

Slide 7

Why incorporate with Office? Increase control inaccessible with HTML Integrating ColdFusion with Microsoft Office (SS216W)

Slide 8

Why such a large number of alternatives? Extensive item Evolution of innovations Techniques proposed for particular mix situations "Flavor of the week" innovation Integrating ColdFusion with Microsoft Office (SS216W)

Slide 9

Why don\'t we educate only the best? All alternatives have upsides and downsides Trade off elements, execution, and many-sided quality Apply most fitting choice for circumstance not one size fits all Integrating ColdFusion with Microsoft Office (SS216W)

Slide 10

Automation Launch MS Office on the server Control through COM Most normal and most intense Can do anything an Office client can do Record Macro to learn office model Word, Excel, PowerPoint, 97—2003 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 11

Automation How-To Start or join with Excel Create or open an exercise manual Manipulate the information Save to a document Serve the document Example, make a pie graph 01_Autmation_Create_Excel_Chart.cfm Integrating ColdFusion with Microsoft Office (SS216W)

Slide 12

Automation Example < cfobject name =" xlApp " activity =" make " class =" Excel.Application "> < cfset xlWbs = xlApp.Workbooks > < cfset xlWb = xlWbs.add( "" ) > < cfset xlWs = xlWb.activeSheet > < cfset c = xlWs.range( " A2 " ) > < cfset c.value2 = " Tom "> < cfset c = xlWs.range( " B2 " ) > < cfset c.value2 = 120 > < cfset xlRange = xlWs.range( " A1:B4 " ) > < cfset xlCharts = xlWb.charts > < cfset xlChart = xlCharts.add() > < cfset xlChart.chartType = - 4102 > < cfset xlChart.setSourceData(xlRange, 2) > < cfset xlChart.location(1, " Sales By Employee " ) > < cfset xlWb.saveAs(fileName) > < cfset xlWb.close() > < cfcontent sort =" application/vnd.ms-exceed expectations " document =" #fileName# "> Integrating ColdFusion with Microsoft Office (SS216W)

Slide 13

Automation Drawbacks Slowest strategy Single threaded—not versatile Requires read/compose from document framework Requires Office and Windows on server Not alright for unattended execution "Microsoft does not right now prescribe, and does not bolster, Automation of Microsoft Office applications from any unattended, non-intuitive customer application or segment (counting ASP, DCOM, and NT Services), on the grounds that Office may show flimsy conduct and/or halt when keep running in this environment." http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 14

Office Web Components COM interface to MS Office information protests Much MS Office usefulness Safe for server side utilization Thread safe – Office XP & 2003 forms just Office 2000—2003 Spreadsheet, PivotTable, Chart Integrating ColdFusion with Microsoft Office (SS216W)

Slide 15

Office Web Components How-To Very like Automation Create a reference to an OWC segments Manipulate the item Save the record Serve the document Example, make a bar diagram 02_OWC_Chart_Image.cfm Integrating ColdFusion with Microsoft Office (SS216W)

Slide 16

Office Web Components Example < cfset chSpace = createObject( " com " , " OWC10.ChartSpace " ) > < cfset chChart = chSpace.Charts.Add() > < cfset chChart.Type = 0 > < cfset chSer = chChart.SeriesCollection.Add() > < cfset chSer.SetData(1, - 1, valueList(salesData.name)) > < cfset chSer.SetData(2, - 1, valueList(salesData.sales)) > < cfset chSer.Caption = " Sales "> < cfset chSpace.Border.Color = - 2 > < cfset chChart.HasLegend = True > < cfset chChart.HasTitle = True > < cfset chSpace.ExportPicture(absPath, " gif " , 600, 512) > < img src =" #relPath# " width =" 600 " tallness =" 512 " outskirt =" 0 "/> Integrating ColdFusion with Microsoft Office (SS216W)

Slide 17

Office Web Components Drawbacks Requires Office and Windows on server Office 2000 form not intended for server use http://support.microsoft.com/default.aspx?scid=kb;en-us;Q317316 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 18

OLE Properties COM interface to any OLE compound archive Simple two-path exchange of little measures of information Word, Excel, PowerPoint, 97—2003 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 19

OLE Properties How To Instantiate a PropertyReader article Get a reference to the report properties Read or set properties as fancied Release the COM article WARNING: There is no "close" system The document is shut when the item is discharged Can just be done on-order in CFMX 6.1 Example, read the writer of records 03_DSO_List_With_Info.cfm Integrating ColdFusion with Microsoft Office (SS216W)

Slide 20

OLE Properties Example < cfset fileName = expandPath( " files\03_DSO_List\FlashForCFers.ppt " ) > < cfobject action =" make " type =" com " class =" DSOleFile.PropertyReader " name =" propReader "> < cfset fileProps = propReader.GetDocumentProperties(fileName) > < cfoutput > #fileName# is composed by #fileProps.author# </cfoutput > < cfset releaseComObject(fileProps) > < cfset releaseComObject(propReader) > Integrating ColdFusion with Microsoft Office (SS216W)

Slide 21

OLE Properties Drawbacks Appropriate just for little particular information Often obliges VBA code inside of the archive layout Requires existing document as format for make Requires Windows on the server Integrating ColdFusion with Microsoft Office (SS216W)

Slide 22

Jet Engine Familiar database association Efficient read and compose of information Excel 97—2003 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 23

Jet Engine How-To Create a datasource to an unfilled MS Access database Proxy datasource, utilized for element associations Query the Excel document as though it\'s a database Specify association information in the FROM proviso Example, perusing transferred information 04_Jet_Read.cfm Integrating ColdFusion with Microsoft Office (SS216W)

Slide 24

Jet Engine Example < cfset tempFile = expandPath( " files\04_Jet_Read_Temp.xls " ) > < cffile action = " transfer " fileField = " fileName " destination = " #tempFile# " nameConflict = " overwrite "> < cfquery name =" excelData " datasource =" intermediary "> SELECT Salesperson, SalesAmount FROM "Excel 8.0; DATABASE = #tempFile#; HDR = YES".[Sales$] </cfquery > Integrating ColdFusion with Microsoft Office (SS216W)

Slide 25

Jet Engine Drawbacks Very particular arranging prerequisites Highly subject to client mistake, especially perusing Requires existing record as format for make Requires Windows server Technically attainable on Unix boxes, yet obliges extraordinary drivers Integrating ColdFusion with Microsoft Office (SS216W)

Slide 26

HTML/XML/CSS Fast and well known advancements Code is all the more regularly reusable Create most basic records Easy to make samples of target yield Save as HTML Does not oblige much else besides ColdFusion on server Even chips away at Unix servers! Word, Excel, PowerPoint, 2000—2003 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 27

HTML/XML/CSS How-To Create HTML Document Include MS Office particular CSS and XML as required Serve to HTML Example, make mailing names 05_HTML_Labels.cfm Integrating ColdFusion with Microsoft Office (SS216W)

Slide 28

HTML/XML/CSS Example < style > @page Section1 { size:8.5in 11.0in; margin:.5in 13.6pt 0in 13.6pt; } div.Section1 { page:Section1; } p { margin:0in 5.3pt 0in 5.3pt; mso-pagination:widow-vagrant; textual style size:12.0pt; textual style family:"Times New Roman"; } </style > < cfcontent sort =" application/msword " reset =" no "> < cfheader name =" Content-Disposition " esteem =" connection; filename=Labels01.doc "> ...html... Coordinating ColdFusion with Microsoft Office (SS216W)

Slide 29

HTML/XML/CSS Drawbacks Limited documentation Can\'t replicate all usefulness Charts, shapes, a few marks Some components oblige Web Archive channel in Office 2000 Integrating ColdFusion with Microsoft Office (SS216W)

Slide 30

XML Pure XML execution Create almost any record Easy to make samples of target yield Save as XML Does not oblige much else besides ColdFusion on server Even takes a shot at Unix servers! Exceed expectations 2002, Word, Excel, Power

Recommended
View more...