主要实现思路是在Detail_BeforePrint中动态修改控件的Visible 属性,如果还有其它属性需要修改也可以在该事件中进行,修改之后的代码如下:
- ''' <summary>
- ''' 印刷
- ''' </summary>
- ''' <remarks></remarks>
- Private Sub FncPrintOut()
- Dim wStrIdx As String = mUdtRpt._Name.Substring(7, 1)
- Dim wBlnRole As Boolean = False
- '■■?????を??????
- mClsRpt.Restart()
- ''■■帳票印刷????????権限????
- wBlnRole = FncHasAuthority()
- '■■共通帳票????????の初期化
- mFrmView = New frmExport(mUdtRpt._ExpFileNM & wStrIdx & CInt(mUdtRpt._ExpFileNo), wBlnRole)
- '■??????????の???????
- Call SubSetRptPreViewIni()
- '■Viewerの????設定
- mFrmView.Text = mUdtRpt._Title
- 'getDetailSection
- Dim report As New ActiveReport
- 'FncSetRptDetail(report)
- 'report.Restart()
- report = Activator.CreateInstance(mClsRpt.GetType(), True)
- report.DataSource = mClsRpt.DataSource
- report.DataMember = mClsRpt.DataMember
- For Each Item As DataDynamics.ActiveReports.Section In report.Sections
- If Item.Type <> SectionType.Detail Then
- report.Sections.Remove(Item)
- Else
- AddHandler Item.BeforePrint, AddressOf Detail_BeforePrint
- End If
- Next
- mFrmView.PActiveReport = report
- mFrmView.ActItem_xViewer.Document = mClsRpt.Document
- mFrmView.mStrRepId = mUdtRpt._Name
- '■■Viewerの表示
- mFrmView.Show()
- mClsRpt.Run()
- report.Run()
- End Sub
- Private Sub Detail_BeforePrint(ByVal sender As Object, ByVal e As System.EventArgs)
- Dim detail As DataDynamics.ActiveReports.Detail = sender
- For Each control As ARControl In detail.Controls
- If control.Visible = False Then
- control.Visible = True
- End If
- Next
- End Sub
复制代码
|