PowerTools SPREAD for ASP.NET 8.0J パフォーマンスガイドライン
9. インスタンスの生成を最小限にする

セル型やスタイルの設定をする際、セル単位にインスタンスの生成やセル型の設定を行っている場合等は、サーバー側の処理速度が遅くなることがあります。セル型やスタイルの設定をする際には、インスタンスの生成を最小限として、同じ設定をするセルに対しては、より広い範囲を対象として設定した方がスタイルの設定を共通化することができ、リソースを軽減することができます。

実装コード

for( int i = 0; i < FpSpread1.ActiveSheetView.RowCount; i++ )
{
    FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType();
    FpSpread1.ActiveSheetView.Cells[i, 1].CellType = txt;
}
For i As Integer = 0 To FpSpread1.ActiveSheetView.RowCount - 1
    Dim txt As New FarPoint.Web.Spread.TextCellType()
    FpSpread1.ActiveSheetView.Cells(i, 1).CellType = txt
Next
FarPoint.Web.Spread.TextCellType txt = new FarPoint.Web.Spread.TextCellType();
for( int i = 0; i < FpSpread1.ActiveSheetView.RowCount; i++ )
{
    FpSpread1.ActiveSheetView.Cells[i, 1].CellType = txt;
} 
Dim txt As New FarPoint.Web.Spread.TextCellType()
For i As Integer = 0 To FpSpread1.ActiveSheetView.RowCount - 1
    FpSpread1.ActiveSheetView.Cells(i, 1).CellType = txt
Next

関連トピック

 

 


Copyright © 2003-2015 GrapeCity inc. All rights reserved.