R
Rehman Bhatti
Guest
If ComboBox6.Text = "Blank" Then
mCustomerName = ""
Else
mCustomerName = " AND {RPT_DELIVERY_CHALLAN_HEADER.ACC_TITLE} = '" & ComboBox6.Text & "'"
End If
If ComboBox4.Text = "Blank" Then
mDoCode = ""
Else
mDoCode = " AND {RPT_DELIVERY_CHALLAN_HEADER.DO_CODE} = '" & ComboBox4.Text & "'"
End If
mFormula = "{RPT_DELIVERY_CHALLAN_HEADER.CREATED_DATE} >= #" & CDate(DateTimePicker1.Text).ToString("yyyy-MM-dd HH:mm") & "# and {RPT_DELIVERY_CHALLAN_HEADER.CREATED_DATE} <= #" & CDate(DateTimePicker2.Text).ToString("yyyy-MM-dd HH:mm") & "#" & mCustomerName & mDoCode
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim mylogonInfo As New CrystalDecisions.Shared.TableLogOnInfo
rptdcsummary.DataSourceConnections.Clear()
For Each myTable In rptdcsummary.Database.Tables
With mylogonInfo.ConnectionInfo
.ServerName = "35.231.01.160"
.DatabaseName = "DTL_DOTNET"
.UserID = "sa"
.Password = "abcd"
End With
myTable.LogOnInfo.ConnectionInfo.AllowCustomConnection = True
myTable.ApplyLogOnInfo(mylogonInfo)
Next
rptdcsummary.RecordSelectionFormula = mFormula
CrystalReportViewer1.ReportSource = rptdcsummary
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Continue reading...
mCustomerName = ""
Else
mCustomerName = " AND {RPT_DELIVERY_CHALLAN_HEADER.ACC_TITLE} = '" & ComboBox6.Text & "'"
End If
If ComboBox4.Text = "Blank" Then
mDoCode = ""
Else
mDoCode = " AND {RPT_DELIVERY_CHALLAN_HEADER.DO_CODE} = '" & ComboBox4.Text & "'"
End If
mFormula = "{RPT_DELIVERY_CHALLAN_HEADER.CREATED_DATE} >= #" & CDate(DateTimePicker1.Text).ToString("yyyy-MM-dd HH:mm") & "# and {RPT_DELIVERY_CHALLAN_HEADER.CREATED_DATE} <= #" & CDate(DateTimePicker2.Text).ToString("yyyy-MM-dd HH:mm") & "#" & mCustomerName & mDoCode
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim mylogonInfo As New CrystalDecisions.Shared.TableLogOnInfo
rptdcsummary.DataSourceConnections.Clear()
For Each myTable In rptdcsummary.Database.Tables
With mylogonInfo.ConnectionInfo
.ServerName = "35.231.01.160"
.DatabaseName = "DTL_DOTNET"
.UserID = "sa"
.Password = "abcd"
End With
myTable.LogOnInfo.ConnectionInfo.AllowCustomConnection = True
myTable.ApplyLogOnInfo(mylogonInfo)
Next
rptdcsummary.RecordSelectionFormula = mFormula
CrystalReportViewer1.ReportSource = rptdcsummary
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Continue reading...