Problem in showing output of Data report.

Reply

Join Date: Nov 2007
Posts: 58
Reputation: guest11 is an unknown quantity at this point 
Solved Threads: 2
guest11 guest11 is offline Offline
Junior Poster in Training

Problem in showing output of Data report.

 
0
  #1
Sep 9th, 2008
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:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function ShowReport(ByVal Criteria As String)
  2. Dim rsReport As ADODB.Recordset
  3.  
  4. On Error GoTo ErrorHandler
  5. qry = "Select * from TemporaryTable"
  6. Set rsReport = GetRecord(qry)
  7.  
  8. If rsReport.RecordCount > 0 Then
  9. If strTerritory = "State Wise" Then
  10. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "State" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
  11. ElseIf strTerritory = "Branch Wise" Then
  12. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "Branch" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
  13. ElseIf strTerritory = "District Wise" Then
  14. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), "District" & " / Industry Wise " & strReportType & " Report : Year - " & intYear & " "
  15. End If
  16. 'formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label1"), strTerritory & "/Industry Wise " & strReportType & " Report For Year " & intYear & " "
  17. If strCustType = "All" Then
  18. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label17"), strCustType
  19. Else
  20. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label17"), strCustTypeCode '& " - " & strCustType
  21. End If
  22. If strReportVal <> "" Then
  23. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label18"), strReportVal
  24. Else
  25. formatLabel DtrptIndWiseAnalysis.Sections(1).Controls.Item("Label18"), "All"
  26. End If
  27.  
  28. If strTerritory = "State Wise" Then
  29. formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "State" & "/Industry Wise"
  30. ElseIf strTerritory = "Branch Wise" Then
  31. formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "Branch" & "/Industry Wise"
  32. ElseIf strTerritory = "District Wise" Then
  33. formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), "District" & "/Industry Wise"
  34. End If
  35. 'formatLabel DtrptIndWiseAnalysis.Sections(2).Controls.Item("Label3"), strTerritory & "/Division Wise"
  36. If strReportType = "Customer Sales" Then
  37. DtrptIndWiseAnalysis.Sections(4).Controls.Item("Label19").Visible = True
  38. Else
  39. DtrptIndWiseAnalysis.Sections(4).Controls.Item("Label19").Visible = False
  40. End If
  41.  
  42. DtrptIndWiseAnalysis.caption = strTerritory & " Division Analysis............."
  43.  
  44. Set DtrptIndWiseAnalysis.DataSource = rsReport
  45. DtrptIndWiseAnalysis.Show
  46. MDIForm1.cmdExport.Visible = True
  47. Else
  48. Screen.MousePointer = vbDefault
  49. MsgBox "No Record.", vbInformation, "Report File"
  50. MDIForm1.cmdExport.Visible = False
  51. End If
  52. ErrorHandler:
  53. If Err.Number <> 0 Then
  54. MsgBox Err.Number & " : " & Err.Description
  55. End If
  56. End Function

Please help me.
Thanks in advance

Regards
Guest11
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC