代码附上:
Protected Sub SavePDF_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SavePDF.Click
Dim strFileName As String
strFileName = "机械制造统辖部2014年资产经费金额汇总表"
'创建PrintInfo
Dim info As New PrintInfo
info.Orientation = PrintOrientation.Landscape
info.ZoomFactor = 0.71
info.Margin = New FarPoint.Web.Spread.PrintMargin(20, 10, 0, 15, 40, 0)
info.ShowGrid = False
info.Footer = " /c/P/ /PC"
FpSpread.Sheets(0).PrintInfo = info
'导出PDF文件
FpSpread.SavePdfToResponse(Server.UrlEncode(strFileName) + ".pdf")
End Sub |