KEMBAR78
SharePoint and Open XML | PPTX
SharePoint and Open XML
Using SharePoint as a Data Source for your
custom Open XML Documents
Presented by Becky Bertram
MCSD, MCAD, MCTS
www.beckybertram.com
What is Open XML?
• New format for Microsoft Office 2007
documents that can be opened as a
ZIP file.
• Allows document properties to be
stored separately from the
information in the document itself.
• Document contents themselves are
stored as XML.
Parts
• Provide modularity so you can easily swap
out portions of the document without
affecting the document as a whole.
• Some “parts” are common across all Office
documents; others are unique to a
particular application.
• These XML parts are referenced through
“relationship” files (much like a foreign
key in a database.)
Office UI Elements
• Ribbon
• Tab
• Add-Ins Tab
Office UI Elements
• Actions Pane
Scenario
• A college professor submits an InfoPath
Form with information regarding next
semester’s course.
• Someone from the registrar’s office
approves the information submitted.
• The person in charge of creating the
course catalog for the semester wants to
dynamically generate a Word document
based on the information stored in the
Form Library.
VSTO
Visual Studio Tools for Office
• Included with Visual Studio 2008
• VSTO Developer Center on MSDN:
http://msdn.microsoft.com/en-
us/vsto/default.aspx
• Office Developer Center on MSDN:
http://msdn.microsoft.com/en-
us/office/default.aspx
SharePoint Web Services
Referenced in the IIS Web Application
of your SharePoint site, in the
_vti_bin folder.
Lists Web Service
• Used for carrying out actions on lists.
• Could call Lists.GetListItems() Web
Method.
• Fields are returned using more of the
Search Column nomenclature (i.e.
ows_ColumnName).
• http://msdn.microsoft.com/en-
us/library/lists.aspx
List Data Retrieval Web Service
• Based on Data/Adapter methodology of
ADO.NET, Data Controls, etc.
• Returns columns as XML elements, where
each element is the name of the column.
• http://msdn.microsoft.com/en-
us/library/ms774413.aspx
• http://msdn.microsoft.com/en-
us/library/dd586758.aspx
List Data Retrieval Web Service
Parameters
• View Fields: CAML representation of
<ViewFields> to be returned
• Query: CAML Query (such as <Where>)
• QueryOptions: Options such as which
record do you want to start with; do you
want the results to be returned as
elements or attributes; etc.
Things to Keep in Mind
• Unlike coding SharePoint Features and
Solutions that will be deployed right onto
a SharePoint server, you’ll need to connect
to SharePoint using a Web Service since
the user will be access SharePoint from a
client machine.
• Pass in the proper credentials to ensure
they’ve got the permissions for the
SharePoint resource they’re accessing.
Access and Mail Merge
• Create an Access project that references
SharePoint lists
• Create a new Word document and start the
Mail Merge process with Access as the data
source.
• Reference columns from that SharePoint list in
your Word document.

SharePoint and Open XML

  • 1.
    SharePoint and OpenXML Using SharePoint as a Data Source for your custom Open XML Documents Presented by Becky Bertram MCSD, MCAD, MCTS www.beckybertram.com
  • 2.
    What is OpenXML? • New format for Microsoft Office 2007 documents that can be opened as a ZIP file. • Allows document properties to be stored separately from the information in the document itself. • Document contents themselves are stored as XML.
  • 3.
    Parts • Provide modularityso you can easily swap out portions of the document without affecting the document as a whole. • Some “parts” are common across all Office documents; others are unique to a particular application. • These XML parts are referenced through “relationship” files (much like a foreign key in a database.)
  • 4.
    Office UI Elements •Ribbon • Tab • Add-Ins Tab
  • 5.
  • 6.
    Scenario • A collegeprofessor submits an InfoPath Form with information regarding next semester’s course. • Someone from the registrar’s office approves the information submitted. • The person in charge of creating the course catalog for the semester wants to dynamically generate a Word document based on the information stored in the Form Library.
  • 7.
    VSTO Visual Studio Toolsfor Office • Included with Visual Studio 2008 • VSTO Developer Center on MSDN: http://msdn.microsoft.com/en- us/vsto/default.aspx • Office Developer Center on MSDN: http://msdn.microsoft.com/en- us/office/default.aspx
  • 8.
    SharePoint Web Services Referencedin the IIS Web Application of your SharePoint site, in the _vti_bin folder.
  • 9.
    Lists Web Service •Used for carrying out actions on lists. • Could call Lists.GetListItems() Web Method. • Fields are returned using more of the Search Column nomenclature (i.e. ows_ColumnName). • http://msdn.microsoft.com/en- us/library/lists.aspx
  • 10.
    List Data RetrievalWeb Service • Based on Data/Adapter methodology of ADO.NET, Data Controls, etc. • Returns columns as XML elements, where each element is the name of the column. • http://msdn.microsoft.com/en- us/library/ms774413.aspx • http://msdn.microsoft.com/en- us/library/dd586758.aspx
  • 11.
    List Data RetrievalWeb Service Parameters • View Fields: CAML representation of <ViewFields> to be returned • Query: CAML Query (such as <Where>) • QueryOptions: Options such as which record do you want to start with; do you want the results to be returned as elements or attributes; etc.
  • 12.
    Things to Keepin Mind • Unlike coding SharePoint Features and Solutions that will be deployed right onto a SharePoint server, you’ll need to connect to SharePoint using a Web Service since the user will be access SharePoint from a client machine. • Pass in the proper credentials to ensure they’ve got the permissions for the SharePoint resource they’re accessing.
  • 13.
    Access and MailMerge • Create an Access project that references SharePoint lists • Create a new Word document and start the Mail Merge process with Access as the data source. • Reference columns from that SharePoint list in your Word document.

Editor's Notes

  • #3  Explain how this is easier than coding Word documents in the past. No opening up binaries, needing to know the unique document structure of Office files, risk of corrupting files, etc. Create a new Word document and save it with a ZIP extension.
  • #4 This ability to insert information easily into a document will come in handy when we want to programmatically add content to our Word document.
  • #7 Walk through demo.
  • #8 Start building project.
  • #9 Show IIS site folder.
  • #10 Show Help document with XML snippet.
  • #11 Show XML file in VS project.
  • #12 Show XML file in VS project.