忘了修改
![dvubb](images/emot/em73.gif)
Private Sub CustomDesign_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'通过设定设计器控件的属性,自定义外观与行为
'AxGRDesigner1.OnlyLayout = True
'AxGRDesigner1.ShowExplorer = False
'AxGRDesigner1.ShowInspector = False
AxGRDesigner1.Report = Report
openFileDialog1.InitialDirectory = ProjectPath
If OpenReportFile IsNot Nothing Then
Report.LoadFromFile(OpenReportFile)
AxGRDesigner1.Reload()
End If
End Sub
[此贴子已经被作者于2021/6/30 14:29:45编辑过]
以下是引用linyunu在2021/6/30 14:26:00的发言:忘了修改
Private Sub CustomDesign_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'通过设定设计器控件的属性,自定义外观与行为
'AxGRDesigner1.OnlyLayout = True
'AxGRDesigner1.ShowExplorer = False
'AxGRDesigner1.ShowInspector = False
AxGRDesigner1.Report = Report
openFileDialog1.InitialDirectory = ProjectPath
If OpenReportFile IsNot Nothing Then
Report.LoadFromFile(OpenReportFile)
AxGRDesigner1.Reload()
End If
End Sub
[此贴子已经被作者于2021/6/30 14:29:45编辑过]
成了,谢谢!
另一种写法
去除
Public Sub New(ByVal OpenReportFile As String)
MyBase.New()
InitializeComponent()
Me.OpenReportFile = OpenReportFile
End Sub
Private OpenReportFile As String = Nothing ' Private 改为 Public
打开模版
Dim fm As CustomDesign = new CustomDesign()
fm.OpenReportFile = ProjectPath & "出库单.grf" 模版路径
fm.Show()
[此贴子已经被作者于2021/7/1 0:23:29编辑过]
以下是引用linyunu在2021/7/1 0:17:00的发言:另一种写法
去除
Public Sub New(ByVal OpenReportFile As String)
MyBase.New()
InitializeComponent()
Me.OpenReportFile = OpenReportFile
End Sub
Private OpenReportFile As String = Nothing ' Private 改为 Public
打开模版
Dim fm As CustomDesign = new CustomDesign()
fm.OpenReportFile = ProjectPath & "出库单.grf" 模版路径
fm.Show()
[此贴子已经被作者于2021/7/1 0:23:29编辑过]
好的,好的。这样更容易理解,再次谢谢。![dvubb 图片点击可在新窗口打开查看](images/emot/em253.gif)
还有问题请教,上面做的是打开报表设计器同时打开一个报表模板。
现在想再进一步就是:在设计器已经打开的情况下,如何用代码打开另外一个模板?(当然这个可以用设计器的工具栏菜单按钮完成,但在狐表中使用并不直接)
[此贴子已经被作者于2021/7/1 9:45:48编辑过]
知道了,原文件全局代码中就有。
还是不行。如果我想已有按钮中使用,如何做?(现在是用动态生成按钮完成)
[此贴子已经被作者于2021/7/1 10:07:09编辑过]