2012년 9월 13일 목요일

FarPointSpread ClearRange

Spread에 출력되어 있는 모든 데이터를 초기화 하기 위해 다음과 같이 처리했다.


private void btnInit_Click(object sender, EventArgs e)
{
    _ActiveSheet.ClearRange(0, 0, _ActiveSheet.Rows.Count, _ActiveSheet.Columns.Count, true);
    _ActiveSheet.Rows.Count = 0;
}
 ClearRange는 다음과 같이 정의되어 있다.


 //
// 요약:
 //     Removes all of the data, formatting, formulas, and notes from a range of
//     cells on this sheet.
//
// 매개 변수:
//   row:
//     Row index of first cell in range
//
//   column:
//     Column index of first cell in range
//
//   rowCount:
//     Number of rows in range
//
//   columnCount:
//     Number of columns in range
//
//   dataOnly:
//     Whether to remove only data
public void ClearRange(int row, int column, int rowCount, int columnCount, bool dataOnly);

 _ActiveSheet.Rows.Count = 0; 처리를 하지 않으면 데이터는 초기화 되지만 빈 Spread가 그대로 남아있다.



댓글 없음:

댓글 쓰기