PowerTools SPREAD for Windows Forms 8.0J 移行ガイド
Excelエクスポート時に、コンボボックス型セルの項目が[データの入力規則]のリストとしてエクスポートされる


ステータス

バージョン ID 機能分類 対応策
5.0.2007.2008 50071 Excel

詳細

旧バージョンでは、Excel エクスポート時にコンボボックス型セルの値のみがエクスポートされていました。旧バージョンと同様の動作を実現するには、ComboDataOnlyフラグを指定してSaveExcelメソッドを呼び出します。

private void Form1_Load(object sender, EventArgs e)
{
    FarPoint.Win.Spread.CellType.ComboBoxCellType cmbocell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
    cmbocell.Items = new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
    fpSpread1.ActiveSheet.Cells[1, 1].CellType = cmbocell;
    fpSpread1.ActiveSheet.SetValue(1, 1, "Feb");
}

private void button1_Click(object sender, EventArgs e)
{
    // コンボボックス型セルのデータのみを出力
    fpSpread1.SaveExcel("..\\..\\Book1.xls", FarPoint.Excel.ExcelSaveFlags.ComboDataOnly);
}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cmbocell As New FarPoint.Win.Spread.CellType.ComboBoxCellType()
    cmbocell.Items = New String() {"Jan", "Feb", "Mar", "Apr", "May", "Jun"}
    FpSpread1.ActiveSheet.Cells(1, 1).CellType = cmbocell
    FpSpread1.ActiveSheet.SetValue(1, 1, "Feb")
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' コンボボックス型セルのデータのみを出力 
    FpSpread1.SaveExcel("..\..\Book1.xls", FarPoint.Excel.ExcelSaveFlags.ComboDataOnly)
End Sub

関連トピック

 

 


© 2004-2015, GrapeCity inc. All rights reserved.