Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## application.workbooks.workbook.worksheets.worksheet
Class Scenario

    java.lang.Object
      application.workbooks.workbook.worksheets.worksheet.Scenario

public class Scenario
extends java.lang.Object

该类定义了对方案进行操作的一些方法。

Method Summary
`java.lang.String` | `getCellDescription()` 返回方案描述字符串所属单元格位置
`java.lang.String[]` | `getCellValue()` 取得存放可变单元格的数组
`java.lang.String` | `getMemo()` 返回备注
`java.lang.String` | `getName()` 取得方案的名字
`void` | `setCellDescription(java.lang.String rangeAddress)` 设置方案描述字符串的单元格位置
`void` | `setCellValue(java.lang.String[] values)` 设置存储可变单元格的值
`void` | `setMemo(java.lang.String memo)` 设置备注
`void` | `setName(java.lang.String name)` 设置方案的名字
`void` | `showCellValue()` 显示可变单元格中值 Worksheet sheet = Application.getWorkbooks().getActiveWorkbook() .getWorksheets().getActiveWorksheet(); sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06"); Scenario scenario = sheet.getScenario("bbb"); scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"}); scenario.showCellValue();

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getCellDescription

    public java.lang.String getCellDescription()

  返回方案描述字符串所属单元格位置

  Returns:
    description

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         String des = scenario.getCellDescription();
         System.out.println("des is "+des);

### getCellValue

    public java.lang.String[] getCellValue()

  取得存放可变单元格的数组

  Returns:
    String[]

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         String[] values = scenario.getCellValue();
         for (int i = 0 ; i <  values.length;i++)
         {
                 System.out.println("values is "+values[i]);
         }

### getMemo

    public java.lang.String getMemo()

  返回备注

  Returns:
    备注

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         String memo = scenario.getMemo();
         System.out.println("memo is "+memo);

### getName

    public java.lang.String getName()

  取得方案的名字

  Returns:
    名字

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         String name = scenario.getName();
         System.out.println("name is "+name);

### setCellDescription

    public void setCellDescription(java.lang.String rangeAddress)

  设置方案描述字符串的单元格位置

  Parameters:
    `rangeAddress` - description Worksheet sheet = Application.getWorkbooks().getActiveWorkbook() .getWorksheets().getActiveWorksheet(); sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06"); Scenario scenario = sheet.getScenario("bbb"); scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"}); scenario.setCellDescription("a1:d5");

### setCellValue

    public void setCellValue(java.lang.String[] values)

  设置存储可变单元格的值

  Parameters:
    `values` - 可变单元格的值

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         sheet.createSummary("$B$20");

### setMemo

    public void setMemo(java.lang.String memo)

  设置备注

  Parameters:
    `memo` - 备注

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         Scenario scenario = sheet.getScenario("bbb");
         scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         scenario.setMemo("创建者 zzz 日期 2004-08-06");

### setName

    public void setName(java.lang.String name)

  设置方案的名字

  Parameters:
    `name` - 名字

    例子：

         Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
        			.getWorksheets().getActiveWorksheet();
         sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
         sheet.getScenario("bbb").setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
         sheet.getScenario("bbb").setName("aaa");

### showCellValue

    public void showCellValue()

  显示可变单元格中值

       Worksheet sheet = Application.getWorkbooks().getActiveWorkbook()
      			.getWorksheets().getActiveWorksheet();
       sheet.addScenario("bbb","$H$10:$I$13","创建者 aaa 日期 2000-08-06");
       Scenario scenario = sheet.getScenario("bbb");
       scenario.setCellValue(new String[]{"1","2","3","4","5","6","7","8"});
       scenario.showCellValue();

Overview | Package | Class | Tree | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

版权所有 2001-2004 无锡永中科技有限公司