找回密码
 立即注册

QQ登录

只需一步,快速开始

jinqiong
论坛元老   /  发表于:2013-10-21 16:38  /   查看:17161  /  回复:23
1.vb6中
activeReport1.Printer = activeReport2.Printer
现在在vb.net中报错,因为它是ReadOnly的,这个该如何修改?

2.vb6中
activeReport.Zoom = -2
这个属性在vb.net中应该对应哪个?

3.vb6中
activeReport.Printer.Copies
在vb.net中应该如何对应

谢谢。

23 个回复

倒序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-21 17:59:00
沙发
1、需要设置Printer.PrintName

2、viewer1.Zoom

3、Document.Printer.PrinterSettings.Copies
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-22 09:31:00
板凳
2、viewer1.Zoom
viewer1这个在我们的程序里面没有用到,
现在是如果要用的话,是不是一定要追加引用啊?
那这个viewer1的命名空间是什么啊

3.activeReport.Printer.Orientation
这个的话在Document.Printer.PrinterSettings下面没有找到
但在activeReport.PageSettings.Orientation下面找到了,
但是不知道是否对应是正确的
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-22 13:48:00
地板
2. 需要添加GrapeCity.ActiveReports.Viewer.Win.v7命名空间

3.Orientation是通过PageSettings.Orientation进行设置的
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-22 14:41:00
5#
不好意思,我想确认一下,
viewer1是在GrapeCity.Viewer.Common.ViewModel.ViewTypeViewModel这个类下面吗?
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-22 14:58:00
6#
追加问题
1.activeReport.Export(xls)
这个在vb.net中对应的的方法是什么

2.activeReport.ShowDialog()
这个是否可以用activeReport.run()

3.Unload(activeReport)
vb.net没有Close方法,这个要改成什么呢

4.activeReport.Document.Printer.PrintDialog(form.Handle.ToInt32)
因为Printer下面的Print()方法是没有参数的,
那这个是否是直接把参数去掉,改成Print()方法就好了?

谢谢。
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-22 16:02:00
7#
1. 通过 XlsExport 进行导出,或者 Viewer.Export 导出
  1. // Export the report in XLSX format.
  2. GrapeCity.ActiveReports.Export.Excel.Section.XlsExport xlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
  3. // Set the file format of the exported excel file to Xlsx to support Microsoft Excel 2007 and newer versions.
  4. xlsExport1.Export(rpt.Document, Application.StartupPath + "\\XLSExpt.xlsx");
复制代码


2. 需要通过Viewer来显示报表

3..NET中无需此功能

4.调用Document.Print()方法即可
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-23 14:49:00
8#
2. 需要通过Viewer来显示报表
是什么意思?
有没有例子之类的
因为以前从来没有接触过,所以麻烦啦,谢谢。

viewer是在GrapeCity.Viewer.Common.ViewModel.ViewTypeViewModel这个类下面的吗?
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-10-23 14:55:00
9#
在使用 VB.NET 开发WinForms应用程序时,打开Form设计界面在工具箱中可以找到 Viewer 控件,此控件是用于显示报表使用的。

也就是说将 Viewer 添加到 Form 上,然后通过后台代码创建报表对象并传递给 Viewer
  1.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  2.         Dim rpt As New SectionReport1
  3.         rpt.DataSource = New DataTable()
  4.         rpt.Run()
  5.         Viewer1.Document = rpt.Document
  6.     End Sub
复制代码
回复 使用道具 举报
jinqiong
论坛元老   /  发表于:2013-10-23 14:55:00
10#
4.activeReport.Document.Printer.PrintDialog(form.Handle.ToInt32)
vb6里面返回的是个Boolean类型的

但是Document.Print()方法没有返回值
回复 使用道具 举报
123下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部