找回密码
 立即注册

QQ登录

只需一步,快速开始

jinqiong
论坛元老   /  发表于:2013-10-17 10:59  /   查看:5073  /  回复:7
vb6中的ActiveReport的版本是2.0
vb.NET中现在用的是7.0
那在vb6中
Dim Rpt As ActiveReport
现在对应的版本7.0中的ActiveReport的这个类的的dll是什么

7 个回复

倒序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-17 12:03:00
沙发
AR2.0 中的 ActiveReport 类型,在 ActiveReports 7 中与之对应的是 GrapeCity.ActiveReports.SectionReport,该类型在GrapeCity.ActiveReports.v7.dll中
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-17 12:49:00
板凳
那之前vb6中使用的ActiveReport的属性,比如Printer属性和PrintReport方法现在对应的应该是什么
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-17 13:40:00
地板
ActiveReport 类型下的属性和方法,现在对应的是 SectionReport
  1.         Dim rpt As New SectionReport1
  2.         rpt.Document.Printer.PrinterName = ""
  3.         rpt.Document.Print()
复制代码
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-17 15:54:00
5#
谢谢。
vb6中的ARExportPDF的一个属性FileName,
在vb.NET中如何对应。
我添加了GrapeCity.ActiveReports.Export.Pdf.v7.dll
但是没有找到相应的属性
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-17 18:00:00
6#
请参考以下代码:
  1. Dim rpt As New GrapeCity.ActiveReports.SectionReport()
  2. ' For the code to work, report.rpx must be placed in the bin\debug folder of your project.
  3. Dim xtr As New System.Xml.XmlTextReader(Application.StartupPath + "\report.rpx")
  4. rpt.LoadLayout(xtr)
  5. rpt.Run()
  6. ' Export the report in HTML format.
  7. Dim htmlExport1 As New GrapeCity.ActiveReports.Export.Html.Section.HtmlExport()
  8. htmlExport1.Export(rpt.Document, Application.StartupPath + "\\HTMLExpt.html")
  9. ' Export the report in PDF format.
  10. Dim pdfExport1 As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport()
  11. pdfExport1.Export(rpt.Document, Application.StartupPath + "\\PDFExpt.pdf")
  12. ' Export the report in RTF format.
  13. Dim rtfExport1 As New GrapeCity.ActiveReports.Export.Word.Section.RtfExport()
  14. rtfExport1.Export(rpt.Document, Application.StartupPath + "\\RTFExpt.rtf")
  15. ' Export the report in text format.
  16. Dim textExport1 As New GrapeCity.ActiveReports.Export.Xml.Section.TextExport()
  17. textExport1.Export(rpt.Document, Application.StartupPath + "\\TextExpt.txt")
  18. ' Export the report in TIFF format.
  19. Dim tiffExport1 As New GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport()
  20. tiffExport1.Export(rpt.Document, Application.StartupPath + "\\TIFFExpt.tiff")
  21. ' Export the report in Excel format.
  22. Dim xlsExport1 As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport()
  23. xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx
  24. ' Set the file format of the exported excel file to Xlsx to support Microsoft Excel 2007 and newer versions.
  25. xlsExport1.Export(rpt.Document, Application.StartupPath + "\\XLSExpt.xlsx")
复制代码


同时,在AR7帮助文档的这个章节有更详细的介绍:ActiveReports Developer 7 > ActiveReports Developer Guide > How To > Section Report How To > Export a Section Report
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-21 14:56:00
7#
好的,谢谢。
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-21 16:19:00
8#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部