Presentation is loading. Please wait.

Presentation is loading. Please wait.

Office Open XML Developer Workshop SpreadsheetML Advanced.

Similar presentations


Presentation on theme: "Office Open XML Developer Workshop SpreadsheetML Advanced."— Presentation transcript:

1 Office Open XML Developer Workshop SpreadsheetML Advanced

2 Office Open XML Developer Workshop 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, addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, 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.

3 Office Open XML Developer Workshop TABLES

4 Office Open XML Developer Workshop SpreadsheetML Tables SpreadsheetML tables provide structure and formatting for worksheet information Design goals for SpreadsheetML tables: 1.Separate presentation and data Data stays in the worksheet Table definition is in a separate part (referenced via a relationship) 2.Cell definition lightweight but extensible Complex type with future storage capabilities Named ranges written in their own collection instead of on each cell 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)

5 Office Open XML Developer Workshop SpreadsheetML Table: simple example DEMO Headings = shared strings Worksheet (sheet1.xml) Table definition (table1.xml)

6 Office Open XML Developer Workshop Header Row No Totals Row Header Row No Totals Row No Header Row (merged cells) Totals Row Typical Tables Table #1 Table #3 Table #2

7 Office Open XML Developer Workshop Table #1

8 Office Open XML Developer Workshop Table #2

9 Office Open XML Developer Workshop Table #3

10 Office Open XML Developer Workshop autoFilter definition In worksheet part (sheet1.xml):

11 Office Open XML Developer Workshop AutoFilter Result

12 Office Open XML Developer Workshop conditionalFormatting

13 Office Open XML Developer Workshop Cells with Conditional Formatting >.5 Data Bars

14 Office Open XML Developer Workshop COMMENTS

15 Office Open XML Developer Workshop Comment Example Typical comment Key concepts: Comments are not stored in the worksheet Each worksheet may have a comment part Contains all comments for that worksheet Each comment is attached to a cell (A1 notation) Drawing/rendering information is stored separately VML-based legacy format Implicit worksheet relationships point to comment part and drawing part

16 Office Open XML Developer Workshop Comment part (comment1.xml) John Smith John: Why is shipping so high on this item? Comment for cell D4 Author 0 (from the list) Rich text formatting

17 Office Open XML Developer Workshop Comments: vmlDrawing1.vml Defines how to render the comment Uses VML (legacy schema being replaced by DrawingML)

18 Office Open XML Developer Workshop STYLES

19 Office Open XML Developer Workshop Styles & Themes We have seen examples of direct formatting Rich text settings in the run properties element Applied directly to cell contents or comment text Formatting can also be specified by a style Named collection of formatting elements Style types: cell style, table style, pivotTable style A style may refer to a theme definition Themes define a set of colors, font information, and shape effects Direct formatting may also refer to a theme Picking a different theme changes the styles/formatting that refer to it

20 Office Open XML Developer Workshop Style part (styles.xml) Contents of the element: DescriptionTag Number Format Expressions Font Definitions Fill Definitions Border Definitions Master Records – Cell Styles Master Records – Formatting Cell Styles Differential Formatting Records Custom Table Styles

21 Office Open XML Developer Workshop Number Format Expressions Cell number format definitions The numFmtId attribute uniquely identifies each entry Number formats don’t use 0-based index like other style definitions Example (for currency formatting): May not reference theme definitions # of formats defined Formatting expression ID for this formatting style (predefined in the spec)

22 Office Open XML Developer Workshop Font Definitions Referenced by index (fontId) from master records Properties may reference theme definitions Color 1 from theme definition Indexed color reference Bold version of above font fontId=0 fontId=1 fontId=2

23 Office Open XML Developer Workshop Fill Definitions Referenced by index (fillId) from master records ST_PatternType fill patterns documented in § Color 4 from theme definition

24 Office Open XML Developer Workshop Border Definitions Referenced by index (borderId) from master records Define presence/absence of borders, weight, color, etc. Left/right borders: medium, color 64 top, bottom, diagonal borders: none DEMO

25 Office Open XML Developer Workshop Master Record – Cell Styles Groups together a specific combination of style settings for use in a cellStyle definition Master records are referenced by index (xfId) Border definition (0-based index) Fill definition (0-based index) Font definition (0-based index) Number format expression (unique ID)

26 Office Open XML Developer Workshop Master Record – Formatting Groups together a specific combination of style settings for use in directing formatting from a cell NOTE: master records are referenced by index and not xfId (§ ). For example, to reference the 2 nd master record above (i.e., index=1): 0

27 Office Open XML Developer Workshop Master Record Direct Formatting

28 Office Open XML Developer Workshop Cell Styles Collection of the cell styles used in the workbook

29 Office Open XML Developer Workshop Differential Formatting Records Groups of formatting information that can be applied as a differential/additive style Referenced by index (0-based) from a tableStyle element When applied, only the specified properties are changed and all other formatting properties retain their values Change font to bold and change color, leave other font properties unchanged

30 Office Open XML Developer Workshop Custom Table Styles Only custom-defined styles are saved – predefined Table/PivotTable styles are not saved Predefined Table/PivtoTable styles – see § table regions can be formatted 15 additional PivotTables regions All predefined styles reference themes Custom styles may reference themes Apply the 7 th differential formatting record to the “whole table” region

31 Office Open XML Developer Workshop Custom Table Style Styles part: Table definition:

32 Office Open XML Developer Workshop Style & Formatting Example Left set of numbers have direct & themed formatting Table has a table style applied PivotTable has a table style applied

33 Office Open XML Developer Workshop Vary The Theme Since all colors are specified as theme colors, they change when a different theme is selected Cells with non-theme colors specified wouldn’t change color with theme changes

34 Office Open XML Developer Workshop NAMED RANGES

35 Office Open XML Developer Workshop Named Ranges This workbook-level element defines names for: Cells Named ranges Formulas Constants Names can’t be in the range A1 – XFD Names can’t begin with _xlnm Predefined names: _xlnm.Print_Area, _xlnm.Sheet_Title, etc. Best practice: use named ranges

36 Office Open XML Developer Workshop Named Range Attributes Name – required Description – user-viewable Comment – internal documentation Function/hidden/vbProcedure – booleans Scope defined by localSheetId Other attributes – see §3.2.5 DEMO SUM(Sheet3!$B$2:$B$9) Sheet3!$A$1:$C$12 Sheet5!$A$1:$T$47

37 Office Open XML Developer Workshop PIVOT TABLES

38 Office Open XML Developer Workshop Pivot Tables Pivot tables simplify large data sets Aggregate information by rows/columns Two components must be defined: 1.The pivot cache definition Defines the data source Workbook has a relation to the pivot cache definition 2.The pivot table definition Defines the appearance Worksheet has a relationship to the pivot table definition Sheet Workbook PivotCacheDefinition PivotTable Row axis Column axis Values nn n n

39 Office Open XML Developer Workshop Pivot Cache Definition Defines data source (may be internal or external) Defines pivot-table fields and pivot values Data source Cache field Pivot values

40 Office Open XML Developer Workshop Pivot Table Definition Defines the look & feel of the pivot table ... ... Associated cache definition (ID from workbook part) Location of the pivot table within the worksheet DEMO


Download ppt "Office Open XML Developer Workshop SpreadsheetML Advanced."

Similar presentations


Ads by Google