You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
					
						
							7.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							7.5 KiB
						
					
					
				Format attributes
Cell attributes table
| Attribute value | Full name | Explanation | Example value | Aspose method or attribute | 
| ct | celltype | Cell value format: text, time, etc. | Cell format | |
| bg | background | background color | #fff000 | setBackgroundColor | 
| ff | fontfamily | Font | 0 Microsoft Yahei, 1 Song, 2 ST Heiti, 3 ST Kaiti, 4 ST FangSong, 5 ST Song, 6 Chinese New Wei, 7 Chinese Xingkai, 8 Chinese Lishu, 9 Arial, 10 Times New Roman, 11 Tahoma, 12 Verdana | Style.Font object's Name property. | 
| fc | fontcolor | font color | #fff000 | Style.Font object's Color property | 
| bl | bold | Bold | 0 Regular, 1 Bold | Style.Font object's IsBold property to true. | 
| it | italic | Italic | 0 Regular, 1 Italic | |
| fs | fontsize | font size | 14 | Style.Font object's Size property. | 
| cl | cancelline | Cancelline | 0 Regular, 1 Cancelline | Style.Font object's Underline property | 
| vt | verticaltype | Vertical alignment | 0 middle, 1 up, 2 down | setVerticalAlignment | 
| ht | horizontaltype | Horizontal alignment | 0 center, 1 left, 2 right | setHorizontalAlignment | 
| mc | mergecell | Merge Cells | {rs: 10, cs:5} indicates that the cells from this cell to 10 rows and 5 columns are merged. | Merge | 
| tr | textrotate | Text rotation | 0: 0、1: 45 、2: -45、3 Vertical text、4: 90 、5: -90 | setRotationAngle | 
| tb | textbeak | Text wrap | 0 truncation, 1 overflow, 2 word wrap | 2: setTextWrapped 0和1: IsTextWrapped = true | 
| v | value | Original value | ||
| m | monitor | Display value | ||
| f | function | formula | setFormula setArrayFormula workbook.calculateFormula(); | 
The following is the storage of 3 cells:
[
    {
        "r": 10,
        "c": 11,
        "v": {
            "f": "=MAX(A7:A9)",
            "ct": {
                "fa": "General",
                "t": "n"
            },
            "v": 100,
            "m": "100"
        }
    },
    {
        "r": 0,
        "c": 1,
        "v": {
            "v": 12,
            "f": "=SUM(A2)",
            "bg": "#fff000"
        }
    },
    {
        "r": 10,
        "c": 11,
        "v": "值2"
    }
]
Cell format
ReferenceAspose.Cells
The format is set to:
{
    "ct": {
        "fa": "General",
        "t": "g"
    },
    "m": "2424",
    "v": 2424
}
| Parameter | Explanation | Usage | 
|---|---|---|
| v | value, shortcut setting value in Aspose | var currencyStyle = book.CreateStyle();currencyStyle.Number = 8; | 
| f | Format: format definition string $#,##0;$-#,##0 | var currencyStyle = book.CreateStyle();currencyStyle.Custom  = "#,##0 SEK"; | 
| t | Type: 0: General 1: Decimal 2: Currency 3: Percentage 4: Scientific 5: Fraction 6: Date 7: Time 8: Accounting 9: Text 10: DateTime | The type is the format distinguished by the front end. When importing excel, the type is distinguished according to the keyword of the format character: 1. YYYY, MM, DD is 6 | 
Aspose is set as follows:
| Value | Type | Format String | 
|---|---|---|
| 0 | General | General | 
| 1 | Decimal | 0 | 
| 2 | Decimal | 0.00 | 
| 3 | Decimal | #,##0 | 
| 4 | Decimal | #,##0.00 | 
| 5 | Currency | $#,##0;$-#,##0 | 
| 6 | Currency | $#,##0;$-#,##0 | 
| 7 | Currency | $#,##0.00;$-#,##0.00 | 
| 8 | Currency | $#,##0.00;$-#,##0.00 | 
| 9 | Percentage | 0% | 
| 10 | Percentage | 0.00% | 
| 11 | Scientific | 0.00E+00 | 
| 12 | Fraction | # ?/? | 
| 13 | Fraction | # / | 
| 14 | Date | m/d/yy | 
| 15 | Date | d-mmm-yy | 
| 16 | Date | d-mmm | 
| 17 | Date | mmm-yy | 
| 18 | Time | h:mm AM/PM | 
| 19 | Time | h:mm:ss AM/PM | 
| 20 | Time | h:mm | 
| 21 | Time | h:mm:ss | 
| 22 | Time | m/d/yy h:mm | 
| 37 | Currency | #,##0;-#,##0 | 
| 38 | Currency | #,##0;-#,##0 | 
| 39 | Currency | #,##0.00;-#,##0.00 | 
| 40 | Currency | #,##0.00;-#,##0.00 | 
| 41 | Accounting | _ * #,##0_ ;_ * "_ ;_ @_ | 
| 42 | Accounting | _ $* #,##0_ ;_ $* "_ ;_ @_ | 
| 43 | Accounting | _ * #,##0.00_ ;_ * "??_ ;_ @_ | 
| 44 | Accounting | _ $* #,##0.00_ ;_ $* "??_ ;_ @_ | 
| 45 | Time | mm:ss | 
| 46 | Time | h :mm:ss | 
| 47 | Time | mm:ss.0 | 
| 48 | Scientific | ##0.0E+00 | 
| 49 | Text | @ | 
Import/export only considers the data style that the user sees. For example, the way to process the date format in excel is to convert the date into a number: 42736 represents 2017-1-1.