Concepts

Core concepts of Tableau.

Terminology

Basics

TermDefinition
WorkbookAn excel file.
A bundle of CSV files named with the same prefix seperated by #.
A XML file.
A YAML file.
WorksheetA sheet in a excel file.
A CSV file.
A root node of a XML file.
A document in YAML file.
MetasheetA worksheet named @TABLEAU to specify tableau parser options.
RowThe row in a sheet.
ColumnThe column in a sheet.
CellThe intersection of a row and a column.
In-cellThe inner-side of a cell.
Cross-cellContinuous cells of a row or a column.

Worksheet

TermDefinition
NamerowExact row number of column name definition at a worksheet.
⚠️ NOTE: each column name must be unique in a worksheet!
Default: 1.
TyperowExact row number of column type definition at a worksheet.
Default: 2.
NoterowExact row number of column note at a worksheet.
Default: 3.
DatarowStart row number of data at a worksheet.
Default: 4.
NamelineThe line number of column name definition in a cell. 0 means the whole cell.
Default: 0.
TypelineThe line number of column type definition in a cell. 0 means the whole cell.
Default: 0.
SepSeparator for:
1. separating in-cell list elements.
2. separating in-cell map items.
Default: ,.
SubsepSubseparator for separating in-cell map Key-Value pair.
Default: :.
NestedNested naming of the namerow.
Default: false.
LayoutIncell, vertical(cross-cell) or horizontal(cross-cell).
TransposeInterchanging the rows and columns of a given sheet.

Mappings to Protoconf

TermProtoconf
WorkbookOne protoconf(.proto) file.
WorksheetOne top-level message in a protoconf file, except the tableau metasheet named @TABLEAU.
columnOne field in a message

A simple mapping example

Input: an excel file

A workbook(HelloWorld.xlsx) with two data worksheets(ItemConf and ActivityConf) and an empty tableau metasheet(@TABLEAU).

IDNameType
map<uint32, Item>stringint32
Item’s ID.Item’s name.Item’s type.
1item1100
2item2200
3item3300
IDNameOpen
map<uint32, Activity>stringbool
Activity’s ID.Activity’s name.Activity is open?
1activity1true
2activity2false
3activity3

Output: a protoconf file

A protoconf file(hello_world.proto) with two top-level messages(ItemConf and ActivityConf).

hello_world.proto
// Generated by tableauc 0.2.1. DO NOT EDIT.
syntax = "proto3";
package protoconf;
option go_package = "github.com/tableauio/demo/examples/helloworld/protoconf";

import "tableau/protobuf/tableau.proto";

option (tableau.workbook) = {name:"HelloWorld.xlsx"};

message ItemConf {
  option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};

  map<uint32, Item> item_map = 1 [(tableau.field) = {key:"ID" layout:LAYOUT_VERTICAL}];
  message Item {
    uint32 id = 1 [(tableau.field) = {name:"ID"}];
    string name = 2 [(tableau.field) = {name:"Name"}];
    int32 type = 3 [(tableau.field) = {name:"Type"}];
  }
}

message ActivityConf {
  option (tableau.worksheet) = {name:"ActivityConf" namerow:1 typerow:2 noterow:3 datarow:4};

  map<uint32, Activity> activity_map = 1 [(tableau.field) = {key:"ID" layout:LAYOUT_VERTICAL}];
  message Activity {
    uint32 id = 1 [(tableau.field) = {name:"ID"}];
    string name = 2 [(tableau.field) = {name:"Name"}];
    bool open = 3 [(tableau.field) = {name:"Open"}];
  }
}