com.acesoft.aceoffix
Class ExcelResCell

java.lang.Object
  extended by com.acesoft.aceoffix.ExcelResCell

public class ExcelResCell
extends java.lang.Object

Represents a cell. Fills data into cell and controls behavior of cell. You can only use the ExcelResSheet.openCell or ExcelResSheet.openCellRC method to obtain a ExcelResCell object.

Version:
3.0
Author:
Acesoft Corporation

Method Summary
 void setBackColor(java.awt.Color value)
          Sets the back color of the cell.
 void setForeColor(java.awt.Color value)
          Sets the fore color of the cell.
 void setFormula(java.lang.String value)
          Sets the formula of the cell.
 void setReadOnly(boolean value)
          Sets a value that indicates whether the cell is read-only.
 void setSubmitName(java.lang.String value)
          Sets the SubmitName of the cell.
 void setValue(java.lang.String value)
          Sets the value of the cell.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setValue

public void setValue(java.lang.String value)
              throws java.io.IOException
Sets the value of the cell.

Throws:
java.io.IOException

setFormula

public void setFormula(java.lang.String value)
                throws java.io.IOException
Sets the formula of the cell. The formula uses A1-style notation which is defined in Microsoft Excel.

Throws:
java.io.IOException

setBackColor

public void setBackColor(java.awt.Color value)
                  throws java.io.IOException
Sets the back color of the cell.

Throws:
java.io.IOException

setForeColor

public void setForeColor(java.awt.Color value)
                  throws java.io.IOException
Sets the fore color of the cell.

Throws:
java.io.IOException

setReadOnly

public void setReadOnly(boolean value)
                 throws java.io.IOException
Sets a value that indicates whether the cell is read-only.

If the value is true, the editable cell will be read-only. And if the value is false, the read-only cell will be editable. Only when OpenMode is OpenModeType.xlsSubmitForm, the ReadOnly property is valid.

Throws:
java.io.IOException

setSubmitName

public void setSubmitName(java.lang.String value)
                   throws java.lang.Exception,
                          java.io.IOException
Sets the SubmitName of the cell. The SubmitName is used to mark the cell to be submitted.

If you do not want to get value of the cell when saving document, you can ignore the SubmitName property. If you assign the SubmitName property, it means that the value of the cell should be submitted. When saving document, you must use the SubmitName as the parameter of ExcelReqSheet.openCell method to get the value of this cell. When SubmitName is defined and OpenMode is OpenModeType.xlsSubmitForm, the cell will automatically be editable. If you want the cell to be read-only, you should assign true to the ReadOnly property of this cell.

The following code example shows how to mark cells to be submitted.

 ExcelResponse er = new ExcelResponse();
 ExcelResSheet sheet1 = er.openSheet("sheet1");
 sheet1.openCell("C1").setValue("Hello world."); // This cell will not be submitted.
 
 sheet1.openCell("C2").setValue(""); // Initializes the value of cell.
 sheet1.openCell("C2").setSubmitName("CompanyName"); // This cell will be submitted.
 
 sheet1.openCell("D2").setSubmitName("ProductName"); // This cell will be submitted.
 sheet1.openCellRC(2, 5).setSubmitName("ProductCode"); // This cell will be submitted.
 
 aceCtrl1.setServerPage("../aceserver.do"); //Required
 aceCtrl1.setSaveDataPage("savedata.jsp");
 aceCtrl1.bind(er);
 aceCtrl1.openDocument("doc/test.xls", OpenModeType.xlsSubmitForm, "Jack");
 aceCtrl1.setTagId("AceoffixCtrl1"); //Required
 

Parameters:
value - The SubmitName is a name for submitting and is defined by developer. It will be used as the parameter of the ExcelReqSheet.openCell method.

Typically, you can use a data field name as the SubmitName. The SubmitName must be unique in one worksheet. The default value is an empty string which means this cell will not be submitted.

The SubmitName is case-sensitive.

Throws:
java.lang.Exception
java.io.IOException