ASF Bugzilla – Attachment 4144 Details for
Bug 15324
[PATCH] Cell Styles are not applied to formula records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test Java Main program to generate a styled formula cell
TestFormula.java (text/plain), 1.81 KB, created by
Danny Mui
on 2002-12-12 18:16:25 UTC
(
hide
)
Description:
Test Java Main program to generate a styled formula cell
Filename:
MIME Type:
Creator:
Danny Mui
Created:
2002-12-12 18:16:25 UTC
Size:
1.81 KB
patch
obsolete
>/* > * TestFormula.java > * > * Created on December 11, 2002, 6:10 PM > */ > >import java.io.FileOutputStream; >import org.apache.poi.hssf.usermodel.HSSFCell; >import org.apache.poi.hssf.usermodel.HSSFCellStyle; >import org.apache.poi.hssf.usermodel.HSSFFont; >import org.apache.poi.hssf.usermodel.HSSFRow; >import org.apache.poi.hssf.usermodel.HSSFSheet; >import org.apache.poi.hssf.usermodel.HSSFWorkbook; >import org.apache.poi.hssf.util.HSSFColor.RED; > > > >/** > * > * @author dmui > */ >public class TestFormula >{ > > /** Creates a new instance of TestFormula */ > public TestFormula() > { > } > > /** > * @param args the command line arguments > */ > public static void main(String[] args)throws Exception > { > HSSFWorkbook wb = new HSSFWorkbook(); > HSSFSheet sheet1 = wb.createSheet("new sheet"); > //HSSFSheet sheet2 = wb.createSheet("second sheet"); > //FileOutputStream fileOut = new FileOutputStream("workbook.xls"); > //wb.write(fileOut); > //fileOut.close(); > HSSFCellStyle cs = wb.createCellStyle(); > HSSFFont f = wb.createFont(); > f.setFontHeightInPoints((short) 20); > f.setColor((short) RED.index); > f.setBoldweight(f.BOLDWEIGHT_BOLD); > f.setFontName("Arial Unicode MS"); > cs.setFillBackgroundColor((short)3); > cs.setFont(f); > > HSSFRow r = sheet1.createRow(0); > HSSFCell c= r.createCell( (short) 1 ); > c.setCellStyle( cs ); > c.setCellFormula( "SUM(A1,B1)") ; > > HSSFCell c2= r.createCell( (short) 0 ); > c2.setCellValue("test"); > c2.setCellStyle(cs); > > FileOutputStream fileOut = new FileOutputStream("e:\\development\\poi-test\\workbook.xls"); > wb.write(fileOut); > fileOut.close(); > System.out.println("done"); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15324
: 4144 |
4164
|
4165