SpreadsheetML Basics.

Slides:



Advertisements
Similar presentations
PresentationML.
Advertisements

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
The following 10 questions test your knowledge of client site assignment in Configuration Manager Configuration Manager 2007 Client Site Assignment.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
The following 10 questions test your knowledge of Internet-based client management in Configuration Manager Configuration Manager 2007 Internet-Based.
Preface Demo A Quick Thank You How Did We Do It?
The following 10 questions test your knowledge of desired configuration management in Configuration Manager Configuration Manager Desired Configuration.
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
WordprocessingML Basics
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Integrating data and documents
Open XML Developer Workshop DrawingML Basics. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current.
SpreadsheetML Advanced
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Open XML Developer Workshop PresentationML. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current.
DrawingML Basics.
© 2014 Microsoft Corporation. All rights reserved.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Open XML Developer Workshop SpreadsheetML Advanced.
Office Open XML Developer Workshop Office Open XML Overview Štěpán Bechynský.
Open XML Developer Workshop SpreadsheetML Advanced.
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication.
Session 1.
Vital Signs: Performance Monitoring Windows Server
Office Open XML Developer Workshop SpreadsheetML Basics.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Conditions and Terms of Use
© 2012 Microsoft Corporation. All rights reserved.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Office Open XML Developer Workshop WordprocessingML Basics.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

Office Open XML Developer Workshop Custom XML Integrating data and documents.
customer.
Office Open XML Developer Workshop DrawingML Basics.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Open XML Developer Workshop WordprocessingML Basics.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Open XML Developer Workshop XSLT and Open XML. Open XML Developer Workshop Disclaimer The information contained in this slide deck represents the current.
Event Title Event Date. Module 02—Introduction to Dimensional Modeling Techniques Name Title Microsoft Corporation.
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
Event Title Event Date. Module 05—Publishing and Accessing Reports with Reporting Services Name Title Microsoft Corporation.
Office 365 Development July 2014.
Using Parallelspace TEAM Models to Design and Create Custom Profiles
5/22/2018 3:04 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
XSLT and Open XML.
Microsoft Build /9/2018 8:04 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Parallelspace PowerPoint Template for ArchiMate® 2.1 version 1.1
Parallelspace PowerPoint Template for ArchiMate® 2.1 version 2.0
Возможности Excel 2010, о которых следует знать
Title of Presentation 12/2/2018 3:48 PM
Excel Rest API Sudhi Ramamurthy Program Manager, Office Extensibility
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Presentation transcript:

SpreadsheetML Basics

Disclaimer The information contained in this slide deck represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This slide deck is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this slide deck may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this slide deck. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this slide deck does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred. © 2006 Microsoft Corporation. All rights reserved. Microsoft, 2007 Microsoft Office System, .NET Framework 3.0, Visual Studio, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Objectives This module covers the core concepts used in SpreadsheetML documents: Workbook Architecture Rows, columns, values Formulas SpreadsheetML design goals Strings: inline strings, shared strings, rich text Tables

SpreadsheetML Workbook properties styles sharedStrings calcChain sheet1..N sheet1..N sheet1..N sheet1..N Explain the contents of these parts. table chart sheet1..N sheet1..N sheet1..N drawing

The minimal XLSX Required: workbook.xml, the document “start part” Required: at least one sheet, worksheet.xml Required: one relationship part (.rels) Must be in a _rels folder Required: [Content_Types].xml Required part for all Open XML documents Three content types must be defined: SpreadsheetML main document (for the start part) Worksheet Package relationships (for the required relationships) Everything else is optional Worksheet <sheetdata> is required, but may be empty

Minimal Workbook/Worksheet workbook.xml: <workbook> <sheets> <sheet name="Sheet1" sheetId="1" r:id="rId1"/> </sheets> </workbook> sheet1.xml: <worksheet> <sheetData/> </worksheet> relationship

Cell Table: <sheetData> element Row Cell Shared formulas Strings Values Reference attribute Style index Cell data type DEMO

Worksheet Part – Main Sections Sheet properties (everything before sheetData) Viewing: selected tab, active cell, etc. Print options: orientation, resolution, page margins, etc. Miscellaneous: default row height, sheet protection, etc. The cell table (sheetData, empty if not a worksheet) Row, cells, values, strings (shared-strings indexes), formulas

Sample Sheet =‘C:\[ExternalBook.xlsx]Sheet1’!$A$1 Notice that cells A2 and A3 contain text. Cell B1 contains a formula linking to another workbook, whose value is '1'. Cell B2 contains a formula as well, which also appears in the formula bar (top of picture) because it is the active cell. Cells D5:H5 contain bold-faced text which serves as headers for the table of data residing in D6:H11. The table of data has a filter feature applied to it (evidenced by drop down arrows in the header row), and columns G and H have different types of conditional formatting applied. Finally, cells D13:H14 are part of a merged cell feature, where a series of cells behave together as a single, larger cell.

mergeCells Store cell data (value, formatting, formula, etc) in top left cell

Formulas: example <row> <c> <v>1</v> <f>SUM(A1:A3)</f> DEMO

SpreadsheetML Design Goal: Performance SpreadsheetML has been optimized in many ways, based on analysis of real-world spreadsheet usage patterns: Small tag size (often a single character) Shared strings Shared formulas Sparse table markup allowed Optional r=“A1” attribute for faster loading DEMO DEMO

Strings

Strings in SpreadsheetML Two ways a string can be stored: Inline strings Provided for ease of translation/conversion Useful in XSLT scenarios Excel and other consumers may convert to shared strings An entry in the shared-strings table May be either a simple string or formatted text These approaches may be mixed/combined

Inline Strings Inline string support provides a very simple mechanism for programmatically populating a worksheet Especially useful in XSLT scenarios Excel 2007 converts to shared strings on save If you’re consuming Open XML documents, you must handle both cases: inline strings and/or shared strings To convert our shared-strings example to inline strings, just replace sheetdata: Also deleted the sharedStrings.xml part and the relationship to it. <sheetData> <row><c t="inlineStr"><is><t>Paris</t></is></c></row> <row><c t="inlineStr"><is><t>Seattle</t></is></c></row> <row><c t="inlineStr"><is><t>London</t></is></c></row> <row><c t="inlineStr"><is><t>Copenhagen</t></is></c></row> </sheetData>

Shared Strings By default, strings are stored in a shared-strings part: Each unique string is stored once Cells store the index (0-based) of the string This design is based on analysis of typical spreadsheet contents: highly repetitive strings are very common Benefits: Users: reduced file size, improved performance Developers: all strings are in one part, simplifying search, localization, and other common string-handling objectives

Shared Strings: example Worksheet contents: sharedStrings.xml contents: 6 string references, 4 unique strings <sst xmlns="..." count="6" uniqueCount="4"> <si> <t>Paris</t> </si> <t>Seattle</t> <t>London</t> <t>Copenhagen</t> </sst> Paris = string 0 Count and uniquecount are optional. <row r="1" spans="1:1"> <c r="A1" t="s"> <v>0</v> </c> </row>

Rich Text Strings Stored in sharedStrings.xml <sst xmlns=“…" count="1" uniqueCount="1"> <si> <r> <t xml:space="preserve">This cell contains </t> </r> <rPr> <b/> <sz val="11"/> <color theme="1"/> <rFont val="Calibri"/> <family val="2"/> <scheme val="minor"/> </rPr> <t>bold</t> <t xml:space="preserve"> and </t> <i/> <sz val="11"/><color theme="1"/> <t>italics</t> <t xml:space="preserve"> text.</t> </si> </sst> Stored in sharedStrings.xml One entry for the entire cell Note run properties <rPr> Cell refers to string 0: Excel adds rich-text properties to all runs after the first one, including runs that are reverting back to the default (such as the words “and” and “text” in this example), but you don’t have to do that in your code. Note that the same markup you generate for a runs in paragraphs of a WordprocessingML document can be used for runs in cells of a SpreadsheetML document. <row r="1" spans="1:1"> <c r="A1" t="s"> <v>0</v> </c> </row>

Tables

SpreadsheetML Tables SpreadsheetML tables provide structure and formatting for worksheet information Separation of presentation and data: Data stays in the worksheet Table definition in separate part (implicit relationship) Open XML has different types of tables for each document type, optimized for different scenarios: WordprocessingML has its tbl element SpreadsheetML has its table element PresentationML uses DrawingML tables (tbl inside graphicData)

SpreadsheetML Table: simple example Worksheet (sheet1.xml) <sheetData> <row r="1" spans="1:2"> <c r="A1" t="s"><v>0</v></c> <c r="B1" t="s"><v>1</v></c> </row> <row r="2" spans="1:2"> <c r="A2"><v>1</v></c> <c r="B2"><v>4</v></c> <row r="3" spans="1:2"> <c r="A3"><v>2</v></c> <c r="B3"><v>5</v></c> <row r="4" spans="1:2"> <c r="A4"><v>3</v></c> <c r="B4"><v>6</v></c> </sheetData> ... <tableParts count="1"> <tablePart r:id="rId2"/> </tableParts> Headings = shared strings Data remains in sheetData Table definition (table1.xml) <table … ref="A1:B4” …> <autoFilter ref="A1:B4”/> <tableColumns count="2"> <tableColumn id="1" name="Column1" /> <tableColumn id="2" name="Column2" /> </tableColumns> <tableStyleInfo …/> </table> Revise demo to use inline strings. DEMO

Typical Tables Table #1 Table #2 Table #3 Header Row No Header Row (merged cells) Totals Row No Totals Row Table #3 Header Row No Totals Row

Table #1

Table #2

Table #3

autoFilter definition Specify range of cells, and filtering options are dynamically generated from the data Also can define custom filters based on operators (lessThan, lessThanOrEqual, equal, greaterThan, greaterThanOrEqual) <worksheet> <sheetData/> <autoFilter ref=“A1:D10”/> </worksheet> Autofilters: use tables, which have them built in, unless you need Excel 2003 compatibility, then use autofilters on a spreadsheet. <autoFilter ref=“A1:D10”> <filterColumn colId=“0”> <customFilters and=“1”> <customFilter operator=“greaterThan” val=“0”/> <customFilter operator=“lessThan” val=“0.5”/> </customFilters> </filterColumn> </autoFilter> DEMO