Scalar

This guide demonstrates different features of excel scalar type.

Scalar

A worksheet Apple in HelloWorld.xlsx:

IDNameDesc
uint32stringstring
Item’s IDItem’s NameItem’s Description
1AppleA kind of delicious fruit.

In this worksheet, three scalar fields are defined:

  1. ID: uint32
  2. Name: string
  3. Desc: string

Generated:

hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};

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

  uint32 id = 1 [(tableau.field) = {name:"ID"}];
  string name = 2 [(tableau.field) = {name:"Name"}];
  string desc = 3 [(tableau.field) = {name:"Desc"}];
}
Apple.json
{
    "id": 1,
    "name": "Apple",
    "desc": "A kind of delicious fruit."
}

Note

Scalar type is usually used to define fields of struct type. Struct →