Lenka.Guo 发表于 2016-3-1 14:10:00

不同的报表模板有不同的创建方法,您使用的是ActiveReports哪个版本?

Dim rpt As New ReportName()


具体创建方法可参考文档:http://www.gcpowertools.com.cn/docs/ActiveReports/AR9Guide/#!Documents/_36.htm

情难舍 发表于 2016-3-1 15:57:00

回复 11楼Lenka.Guo的帖子

ActiveReport 7版本我需要创建的是ActiveReport中的基于代码的报表,后缀名是.vb。 “Dim xtr As New System.Xml.XmlTextReader(Application.StartupPath +"\report.rpx")”这段代码只能读取基于XML的报表。
如果我要读取基于代码的报表应该怎样实现呢   非常感谢

情难舍 发表于 2016-3-1 16:18:00

回复 11楼Lenka.Guo的帖子


Dim sectionReport As New SectionReport1()

      Dim xlsExport1 As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport()
      xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx
      xlsExport1.Export(sectionReport.Document, Application.StartupPath + "\\xxx.xlsx")

数组越界错误

Lenka.Guo 发表于 2016-3-1 17:15:00

代码修改为:
Dim sectionReport As New SectionReport1()
sectionReport.Run();
      Dim xlsExport1 As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport()
      xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx
      xlsExport1.Export(sectionReport.Document, Application.StartupPath + "\\xxx.xlsx")

如果仍然报错,您可以在开始菜单,找到GrapeCity ->本机示例程序—>Professional 文件夹下打开EndUserDesigner 示例程序,运行之后,使用EndUserDesigner, 打开您所设计的报表,选择预览,看看是否能正常导出。

情难舍 发表于 2016-3-1 17:20:00

回复 14楼Lenka.Guo的帖子

非常感谢,这种东西没有接触过真的没得一点办法。。。OK 解决了。。。谢谢

Lenka.Guo 发表于 2016-3-1 17:29:00

回复 15楼情难舍的帖子

不客气~~欢迎您随时提问~~~
页: 1 [2]
查看完整版本: ActiveReport 打印在Excel上