Public Sub SetResult(ByVal adst_result As DataSet)
If Not adst_result Is Nothing Then
adst_result.DataSetName = "customer"
adst_result.WriteXmlSchema("d:\xml\customer.xml") '把dataset寫成xml文件
Me.datagrid1.AllowSorting = False
Me.datagrid1.DataSource = adst_result.Tables(0)
Else
Me.datagrid1.DataSource = Nothing
End If
End Sub
Public Sub btn_click() Handles MyBase.click
Dim lrpt_customer As New Report_CustomerManagementQuery
lrpt_customer_management_query.SetDataSou(SetResult)
Dim lfrm_customer_report As New CusotmerManagementReport
'CusotmerManagementReport 是你放了CrystalReportViewer控件的from
lfrm_customer_report.crt_result.ReportSource = lrpt_customer
lfrm_customer_report.ShowDialog(Me)
End Sub