登记单位:_$CompanyName$______________
登 记 人:____________________________
登记日期:____________________________
上面上行是同在一个单元格的, 现在我要把$CompanyName$(其实$CompanyName$是有下划线的,贴上来就看不到了)替换别的字符串, 而且是有下划线的, 请问这个是怎么弄出来的, 在网上看了很多资料没有弄出来, 请好心人帮帮忙. 谢谢!!
1 个解决方案
#1
//cell with rich text
Cell cell3 = sheet1.CreateRow(5).CreateCell(1);
HSSFRichTextString richtext = new HSSFRichTextString("Microsoft OfficeTM");
//apply font to "Microsoft Office"
Font font4 = hssfworkbook.CreateFont();
font4.FontHeightInPoints = 12;
richtext.ApplyFont(0, 16, font4);
//apply font to "TM"
Font font3=hssfworkbook.CreateFont();
font3.TypeOffset = (short)FontSuperScript.SUPER;
font3.IsItalic = true;
font3.Underline = 1;
font3.Color = HSSFColor.BLUE.index;
font3.FontHeightInPoints=8;
richtext.ApplyFont(16, 18,font3);
cell3.SetCellValue(richtext);
#1
//cell with rich text
Cell cell3 = sheet1.CreateRow(5).CreateCell(1);
HSSFRichTextString richtext = new HSSFRichTextString("Microsoft OfficeTM");
//apply font to "Microsoft Office"
Font font4 = hssfworkbook.CreateFont();
font4.FontHeightInPoints = 12;
richtext.ApplyFont(0, 16, font4);
//apply font to "TM"
Font font3=hssfworkbook.CreateFont();
font3.TypeOffset = (short)FontSuperScript.SUPER;
font3.IsItalic = true;
font3.Underline = 1;
font3.Color = HSSFColor.BLUE.index;
font3.FontHeightInPoints=8;
richtext.ApplyFont(16, 18,font3);
cell3.SetCellValue(richtext);