M
muhammadanzar
Guest
HI,
I get this code form youtub. The Instructor work have create a problem, Report shows the all Records in Database, but i want report show only those records from (northwind database) which i type in textbox, from the textbox Particular order detail record show which order_id given in text box.
Option Explicit On
Imports System.Windows.Forms
Imports Microsoft.Reporting.WinForms
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Order_DetailsTableAdapter.Fill(Me.OrdersDataSet.Order_Details)
Me.OrdersTableAdapter.Fill(Me.OrdersDataSet.Orders)
AddHandler Me.ReportViewer1.LocalReport.SubreportProcessing, AddressOf odsubreporteventhandler
Me.ReportViewer1.RefreshReport()
End Sub
Public Sub odsubreporteventhandler(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim tblorderdetail As DataTable
tblorderdetail = Me.OrdersDataSet.Tables("Order Details")
Dim strfilter As String
strfilter = e.Parameters("OrderID").Values.First()
Me.Order_DetailsTableAdapter.FillOrderDetails(Me.OrdersDataSet.Order_Details, strfilter) '
e.DataSources.Add(New ReportDataSource("Order Details", tblorderdetail))
End Sub
End Class
MUHAMMAD ANZAR E-mail : muhammadanzar@hotmail.com Mobile # :0092-3215096959
Continue reading...
I get this code form youtub. The Instructor work have create a problem, Report shows the all Records in Database, but i want report show only those records from (northwind database) which i type in textbox, from the textbox Particular order detail record show which order_id given in text box.
Option Explicit On
Imports System.Windows.Forms
Imports Microsoft.Reporting.WinForms
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Order_DetailsTableAdapter.Fill(Me.OrdersDataSet.Order_Details)
Me.OrdersTableAdapter.Fill(Me.OrdersDataSet.Orders)
AddHandler Me.ReportViewer1.LocalReport.SubreportProcessing, AddressOf odsubreporteventhandler
Me.ReportViewer1.RefreshReport()
End Sub
Public Sub odsubreporteventhandler(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
Dim tblorderdetail As DataTable
tblorderdetail = Me.OrdersDataSet.Tables("Order Details")
Dim strfilter As String
strfilter = e.Parameters("OrderID").Values.First()
Me.Order_DetailsTableAdapter.FillOrderDetails(Me.OrdersDataSet.Order_Details, strfilter) '
e.DataSources.Add(New ReportDataSource("Order Details", tblorderdetail))
End Sub
End Class
MUHAMMAD ANZAR E-mail : muhammadanzar@hotmail.com Mobile # :0092-3215096959
Continue reading...