陈永亮 发表于 2018-10-6 08:52:22

vb.net如何为RDLX绑定datatable

ASP.NET+VB.NET RDLX文件绑定datatable,并生成EXCEL文件下载找了半天帮助文档里的都是C#的,可否做一个VB.NET的demo
多谢

KearneyKang 发表于 2018-10-8 09:41:12

绑定datateble都是一样的VB和C#都是一样的,你是想要VB的下载Excel的代码吗?
VB导出Excel的代码:
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport()Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)

' Create an output directory.
Dim outputDirectory As New System.IO.DirectoryInfo("C:\MyExcel")
outputDirectory.Create()

' Provide settings for your rendering output.
Dim excelSetting As New GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings()
excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls
Dim setting As GrapeCity.ActiveReports.Extensibility.Rendering.ISettings = excelSetting

' Set the rendering extension and render the report.
Dim excelRenderingExtension As New GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension()
Dim outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name))

' Overwrite output file if it already exists.
outputProvider.OverwriteOutputFile = True

reportDocument.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings())

陈永亮 发表于 2018-10-8 21:26:34

好,了解

KearneyKang 发表于 2018-10-9 09:16:41

好的,有问题在随时咨询
页: [1]
查看完整版本: vb.net如何为RDLX绑定datatable