vb.net 水晶报表 导出Excel

vb.net 水晶报表 导出Excel,第1张

概述    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load         Try             p_strNendo = Session("p_strNendo")             'フォーム・CrystalReportViewerのサイズを設 Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.Load Try p_strNendo = Session("p_strNendo") 'フォーム・CrystalReportVIEwerのサイズを設定 'crvShiwakecho.Height = Common_AppSet.g_intHRptVIEwerHeight 'crvShiwakecho.WIDth = Common_AppSet.g_intHRptVIEwerWIDth 'レポートビューアに表示 Dim objDtbl As Datatable = Session("dsShiwakecho").tables("dt21_Shiwakecho") Dim objCR As Reportdocument = New Reportdocument() objCR.Load(Common_AppSet.g_strReportTemplate & "rpt21_Shiwakecho.rpt") objCR.SetDataSource(objDtbl) 'crvShiwakecho.ToolPanelVIEw = ToolPanelVIEwType.None crvShiwakecho.ReportSource = objCR 'パラメータフィールドに値を設定 Dim pfFIElds As New CrystalDecisions.Shared.ParameterFIElds Dim pfNendo As New CrystalDecisions.Shared.ParameterFIEld Dim pvNendo As New CrystalDecisions.Shared.ParameterdiscreteValue pfNendo.ParameterFIEldname = "prmNendo" pvNendo.Value = p_strNendo pfNendo.CurrentValues.Add(pvNendo) pfFIElds.Add(pfNendo) crvShiwakecho.ParameterFIEldInfo = pfFIElds Dim opts As CrystalDecisions.Shared.diskfileDestinationoptions = New CrystalDecisions.Shared.diskfileDestinationoptions() opts.diskfilename = "C:\PPPWebLoader\234.xls" Dim myExportoptions As CrystalDecisions.Shared.Exportoptions = objCR.Exportoptions myExportoptions.Destinationoptions = opts myExportoptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.diskfile Response.ContentType = "application/vnd.ms-excel" myExportoptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel For i As Integer = 0 To pfFIElds.Count - 1 objCR.SetParameterValue(pfFIElds.Item(i).name,pfFIElds.Item(i).CurrentValues) Next objCR.Export() Response.End() Catch ex As Exception Throw New Exception("仕訳帳の出力に失敗しました。" & vbCrLf & ex.StackTrace & vbCrLf & ex.Message) End Try End Sub 总结

以上是内存溢出为你收集整理的vb.net 水晶报表 导出Excel全部内容,希望文章能够帮你解决vb.net 水晶报表 导出Excel所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1287882.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存