作成日: 2015/04/07 最終更新日: 2015/09/16
文書種別
不具合
状況
修正済み
詳細
XLSheetオブジェクトのDefaultRowHeightプロパティに設定した値が反映されず、行の高さがデフォルトの高さで出力されます。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Dim book As New C1XLBook()
Dim sheet As XLSheet = book.Sheets(0)
sheet.DefaultRowHeight = C1XLBook.PixelsToTwips(10)
Dim stCurrentDir As String = System.IO.Directory.GetCurrentDirectory()
book.Save(stCurrentDir & "/hello.xls")
Dim sheet As XLSheet = book.Sheets(0)
sheet.DefaultRowHeight = C1XLBook.PixelsToTwips(10)
Dim stCurrentDir As String = System.IO.Directory.GetCurrentDirectory()
book.Save(stCurrentDir & "/hello.xls")
◎サンプルコード(C#)
C1XLBook book = new C1XLBook();
XLSheet sheet = book.Sheets[0];
sheet.DefaultRowHeight = C1XLBook.PixelsToTwips(10);
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
book.Save(stCurrentDir + "/hello.xls");
XLSheet sheet = book.Sheets[0];
sheet.DefaultRowHeight = C1XLBook.PixelsToTwips(10);
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
book.Save(stCurrentDir + "/hello.xls");
回避方法
この問題はバージョン4.20152.74で修正されました。
修正版の適用方法については、アップデートの方法を参照してください。
修正版を適用しない場合の回避方法は次のとおりです。
XLSheetオブジェクトのRowsのHeightプロパティに高さを設定します。
この方法では対象となる全ての行に高さを設定する必要があります。そのため任意の値にて行をループし、高さを設定します。
◎サンプルコード(VB)
◎サンプルコード(C#)
修正版の適用方法については、アップデートの方法を参照してください。
修正版を適用しない場合の回避方法は次のとおりです。
XLSheetオブジェクトのRowsのHeightプロパティに高さを設定します。
この方法では対象となる全ての行に高さを設定する必要があります。そのため任意の値にて行をループし、高さを設定します。
◎サンプルコード(VB)
Dim book As New C1XLBook()
Dim sheet As XLSheet = book.Sheets(0)
For i As Integer = 0 To 199
sheet.Rows(i).Height = C1XLBook.PixelsToTwips(10)
Next
Dim stCurrentDir As String = System.IO.Directory.GetCurrentDirectory()
book.Save(stCurrentDir & "/hello.xls")
Dim sheet As XLSheet = book.Sheets(0)
For i As Integer = 0 To 199
sheet.Rows(i).Height = C1XLBook.PixelsToTwips(10)
Next
Dim stCurrentDir As String = System.IO.Directory.GetCurrentDirectory()
book.Save(stCurrentDir & "/hello.xls")
◎サンプルコード(C#)
C1XLBook book = new C1XLBook();
XLSheet sheet = book.Sheets[0];
for (int i = 0; i < 200; i++) {
sheet.Rows[i].Height = C1XLBook.PixelsToTwips(10);
}
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
book.Save(stCurrentDir + "/hello.xls");
XLSheet sheet = book.Sheets[0];
for (int i = 0; i < 200; i++) {
sheet.Rows[i].Height = C1XLBook.PixelsToTwips(10);
}
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
book.Save(stCurrentDir + "/hello.xls");
旧文書番号
81240