Recently, when exporting excel files in. net, the customer needs to print out the symbols with the box and the box with the check box. There are countless questions online and there is no result. Later, the problem was solved using HSSFRichTextString. Using NPOI. HSSF. UserModel; using NPOI. SS. UserModel; this is a reference required to export the excel document. The following key parts. First, we need to export the above image and print the symbol according to the actual situation. The following describes the procedure (taking office2010 as an example): 1. open excel, click Insert> symbol, and find the above box with or without a check box, such as 2. after insertion, the two symbols appear in the excel table: select the two symbols respectively and change the font, for example,, and then change them to r£4, these special symbols are converted into letters or numbers by changing the font. 3. key code: [csharp] var a = new HSSFRichTextString ("R principal owner"); var font1 = (HSSFFont) sheet. workbook. createFont (); font1.FontName = "Wingdings 2"; font1.FontHeightInPoints = 14;. applyFont (0, 1, font1); sheet. getRow (3 ). getCell (1 ). setCellValue (a); var a = new HSSFRichTextString ("R principal owner"); var font1 = (HSSFFont) sheet. workbook. createFont (); font1.FontName = "Wingdings 2"; font1.FontHeightInPoints = 14; A. applyFont (0, 1, font1); sheet. getRow (3 ). getCell (1 ). setCellValue (a); the Code above means to use the Rich Text object HSSFRichTextString and then define a font. The font type is "Wingdings 2", which is the font corresponding to the symbol selected above. ApplyFont (, font1) is used to set the first letter in the string "R principal owner" to font1. The method parameter is ApplyFont (int startIndex, int endIndex, font font) then obtain a cell in excel and set its value to this Rich Text object. Other special symbols will be output, which can be output in phase.