hi all,
I am using data report tool for showing my reports.
Everything is working well i am accessing records from table but when i set datasource to datareport it shows all records excluding last record. I don't understand why this happens.
Can anybody tell me about this problem.
If possible plz reply me today only its urgent.
the code i use is as follows:
Public Function ShowReport(ByVal Criteria As String)
Dim rsReport As ADODB.Recordset
On Error GoTo ErrorHandler
qry = "Select * from TemporaryTable"
Set rsReport = GetRecord(qry)
If rsReport.RecordCount > 0 Then
If strTerritory = "State Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "State" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
ElseIf strTerritory = "Branch Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "Branch" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
ElseIf strTerritory = "District Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "District" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
End If
'formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), strTerritory & "/Industry Wise " & strReportType & " Report For Year " & intYear & " "
If strCustType = "All" Then
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label17"), strCustType
Else
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label17"), strCustTypeCode '& " - " & strCustType
End If
If strReportVal <> "" Then
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label18"), strReportVal
Else
formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label18"), "All"
End If
If strTerritory = "State Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "State" & "/Industry Wise"
ElseIf strTerritory = "Branch Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "Branch" & "/Industry Wise"
ElseIf strTerritory = "District Wise" Then
formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "District" & "/Industry Wise"
End If
'formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), strTerritory & "/Division Wise"
If strReportType = "Customer Sales" Then
DtrptIndWiseAnalysis.Sections(4).Controls.Item("Label19").Visible = True
Else
DtrptIndWiseAnalysis.Sections(4).Controls.Item("Label19").Visible = False
End If
DtrptIndWiseAnalysis.caption = strTerritory & " Division Analysis............."
Set DtrptIndWiseAnalysis.DataSource = rsReport
DtrptIndWiseAnalysis.Show
MDIForm1.cmdExport.Visible = True
Else
Screen.MousePointer = vbDefault
MsgBox "No Record.", vbInformation, "Report File"
MDIForm1.cmdExport.Visible = False
End If
ErrorHandler:
If Err.Number <> 0 Then
MsgBox Err.Number & " : " & Err.Description
End If
End Function
Please help me.
Thanks in advance
Regards
Guest11