Private Sub DeptPremiumBreakupDetail_ReportStart(sender As Object, e As System.EventArgs) Handles Me.ReportStart
Dim objConnection As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("MainDB-ConnectionString").ConnectionString)
Dim objDA As New SqlDataAdapter
Dim ds As DataSet = New DataSet
Dim objCommand As New System.Data.SqlClient.SqlCommand()
Try
If _Fromdate <> "" And _Todate <> "" Then
SQL = "Select SDPCD,DCR_TYPE,DCR_NO,DOC_GRP,CONVERT(VARCHAR(10),DCR_DATE, 112) as DCR_DATE,DCR_POLNO,DCR_AMT from Poldocs WHERE 1=1 And (Doc_grp='PO' Or Doc_grp='EN') And Dcr_type<>'R' "
If _Fromdate <> "" And _Todate <> "" Then
SQL = SQL & "AND CONVERT(VARCHAR(10), Poldocs.Dcr_date, 112) >='" & strFromdate & "' and CONVERT(VARCHAR(10), Poldocs.Dcr_date, 112) <= '" & strTodate & "'"
End If
If _Dept <> "" Then
SQL = SQL & "AND Deptcd= '" & _Dept & "' "
End If
objCommand.Connection = objConnection
objCommand.CommandText = SQL
objConnection.Open()
''objCommand.ExecuteNonQuery()
objDA.SelectCommand = objCommand
objDA.Fill(ds)
''sqlDBDataSource1.SQL = resources.GetString("sqlDBDataSource1.SQL")
Me.DataSource = ds
Me.DataMember = ds.Tables(0).TableName
Me.txtSDPCD.DataField = "SDPCD"
Me.txtDocType.DataField = "DCR_TYPE"
Me.txtDocNo.DataField = "DCR_NO"
Me.txtDocGroup.DataField = "DOC_GRP"
Me.txtDocDate.DataField = "DCR_DATE"
Me.txtPolNo.DataField = "DCR_POLNO"
Me.txtPremium.DataField = "DCR_AMT"
Me.txtTotPremium.DataField = "DCR_AMT"
End If
Catch ex As Exception
objCommand.Dispose()
objConnection.Close()
objConnection.Dispose()
Finally
objCommand.Dispose()
objConnection.Close()
objConnection.Dispose()
End Try
End Sub
Приведенный выше код извлекает более 9 л записей, если моя дата колеблется с 2004 года по настоящее время.
Private Sub getreport()
If txtDateFrom.Text <> "" And txtDateTo.Text <> "" Then
Session("ViewerType") = ActiveReports.Web.ViewerType.RawHtml
WebViewer1.ViewerType = DirectCast(Session("ViewerType"), ActiveReports.Web.ViewerType)
If isvaliddate() Then
WebViewer1.Visible = True
Dim rpt As New DeptPremiumBreakupDetail(txtDateFrom.Text, txtDateTo.Text, txtDeptCode.Value, txtDeptName.Value, usercode, DateTime.Now.ToString)
WebViewer1.Report = rpt
Else
MessageBoxShow("To Date Should be Greater than From Date !!!!!")
End If
Else
MessageBoxShow("Please Provide To and From Date !!!!!")
End If
End Sub
Приведенный выше код предназначен для извлечения данных и их отображения в веб-браузере. Теперь проблема, с которой я сталкиваюсь. значение не отображается В функции reportstart данные загружаются в набор данных. но пока он передается в веб-просмотрщик, он не отображается.