複合罫線を設定するとPDFファイルへのエクスポート時に罫線が少しはみ出ることがある
対象製品
SPREAD for Windows Forms 8.0J
状況
修正済み
詳細
複合罫線を設定するとPDFファイルへのエクスポート時に罫線が少しはみ出ることがあります。
【手順】
1.新規フォームにSPREADとButtonを配置します
2.下記サンプルコードをコピーし、アプリケーションを実行します
3.Buttonをクリックします
--PDFファイルの罫線の右辺が少しはみ出ます
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 20
FpSpread1.ActiveSheet.RowCount = 20
Dim cb As New FarPoint.Win.ComplexBorderSide(True, Color.Black, 2, Drawing2D.DashStyle.Solid, {FarPoint.Win.ComplexBorderSideStyle.MediumLine}, Nothing)
For i As Integer = 1 To FpSpread1.ActiveSheet.RowCount - 1
FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.ComplexBorder(Nothing, cb, Nothing, Nothing)
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
FpSpread1.ActiveSheet.PrintInfo.UseMax = False
FpSpread1.ActiveSheet.PrintInfo.PdfFileName = "..¥¥..¥¥test.pdf"
FpSpread1.ActiveSheet.PrintInfo.PrintToPdf = True
FpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub
【手順】
1.新規フォームにSPREADとButtonを配置します
2.下記サンプルコードをコピーし、アプリケーションを実行します
3.Buttonをクリックします
--PDFファイルの罫線の右辺が少しはみ出ます
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 20
FpSpread1.ActiveSheet.RowCount = 20
Dim cb As New FarPoint.Win.ComplexBorderSide(True, Color.Black, 2, Drawing2D.DashStyle.Solid, {FarPoint.Win.ComplexBorderSideStyle.MediumLine}, Nothing)
For i As Integer = 1 To FpSpread1.ActiveSheet.RowCount - 1
FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.ComplexBorder(Nothing, cb, Nothing, Nothing)
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
FpSpread1.ActiveSheet.PrintInfo.UseMax = False
FpSpread1.ActiveSheet.PrintInfo.PdfFileName = "..¥¥..¥¥test.pdf"
FpSpread1.ActiveSheet.PrintInfo.PrintToPdf = True
FpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub
回避方法
Service Pack 3(v8.0.3505.2008)で修正済み。
Service Pack 3(v8.0.3505.2008)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
ComplexBorderの代わりにLineBorderを使います。
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 20
FpSpread1.ActiveSheet.RowCount = 20
Dim cb As New FarPoint.Win.ComplexBorderSide(True, Color.Black, 2, Drawing2D.DashStyle.Solid, {FarPoint.Win.ComplexBorderSideStyle.MediumLine}, Nothing)
For i As Integer = 1 To FpSpread1.ActiveSheet.RowCount - 1
'FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.ComplexBorder(Nothing, cb, Nothing, Nothing)
' 回避策
FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.LineBorder(Color.Black, 2, False, True, False, False)
Next
End Sub
Service Pack 3(v8.0.3505.2008)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
ComplexBorderの代わりにLineBorderを使います。
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.ColumnCount = 20
FpSpread1.ActiveSheet.RowCount = 20
Dim cb As New FarPoint.Win.ComplexBorderSide(True, Color.Black, 2, Drawing2D.DashStyle.Solid, {FarPoint.Win.ComplexBorderSideStyle.MediumLine}, Nothing)
For i As Integer = 1 To FpSpread1.ActiveSheet.RowCount - 1
'FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.ComplexBorder(Nothing, cb, Nothing, Nothing)
' 回避策
FpSpread1.ActiveSheet.Rows(i).Border = New FarPoint.Win.LineBorder(Color.Black, 2, False, True, False, False)
Next
End Sub