Results 1 to 4 of 4

Thread: Datas In Crystal Reports Are Jumbling....

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    8

    Red face Datas In Crystal Reports Are Jumbling....

    Dear Friends,

    We're using Crystal Reports 8.5 to generate a report from MS Access.
    I'd sorted using a numeric Field (SlNo.) for a crystal report controller named 'CRP' in VB 6.0 as follows,

    Code:
      Rs.Open "Select * From <tablename> Order By SlNo",<database name>,adopendynamic,adlockoptimistic
    
      CRP.reset
      CRP.DataFileName(0)=<database path>
      CRP.ReportFileName=<report path.rpt>
      CRP.Action=1
    
    Rs.Close
    While executing the above coding to display the field 'SlNo' Only the record get jumbled...As follows....


    1
    2
    3
    4
    10
    11
    5
    6
    7
    8
    9
    12
    and so on.....

    Is There any remedy To Overcome This problem or it's just a problem of mine....

    NOTE: While opening the database table, The datas are arranged in sama manner as our expectation (without any jumbling.)
    Last edited by Winsoft Solutions; Jan 19th, 2009 at 05:23 AM.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Datas In Crystal Reports Are Jumbling....

    It would be better if you post the real vb code
    Wich way do you relate the opened recordset with crystal reports' report
    If they are not, then you can Sort the rows by that field inside the report itself, using menu / report / sort records

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    8

    Re: Datas In Crystal Reports Are Jumbling....

    The Following Is The Actual Code
    Code:
            Dim RsTmp As ADODB.Recordset
            Dim No As Double
            Set RsTmp = New ADODB.Recordset
            No = 0
            
            db.Execute "Delete * From TmpAddRpt"
            
            RsTmp.Open "Select * From TmpAddRpt Order By SlNo", db, adOpenDynamic, adLockOptimistic
                For i = 1 To GridDisplay.Rows - 1
                    For j = 0 To GridDisplay.Cols - 2
                    If Trim(GridDisplay.TextMatrix(i, j)) <> "" And Trim(GridDisplay.TextMatrix(i, j)) <> "Nil" Then
                        RsTmp.AddNew
                            RsTmp.Fields("SlNo") = Val(No)
                                If j = 0 Then
                                    If Trim(GridDisplay.TextMatrix(0, j)) = "Order No." Then
                                        RsTmp.Fields("Field1") = Val(i) & ".) Order No:" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Amount" Then
                                        RsTmp.Fields("Field1") = Val(i) & ".) Amount  :" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Received" Then
                                        RsTmp.Fields("Field1") = Val(i) & ".) Received:" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Balance" Then
                                        RsTmp.Fields("Field1") = Val(i) & ".) Balance :" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Receipts" Then
                                        RsTmp.Fields("Field1") = Val(i) & ".) Rec. Nos:" & Trim(GridDisplay.TextMatrix(i, j))
                                    Else
                                        RsTmp.Fields("Field1") = Val(i) & ".) " & Trim(GridDisplay.TextMatrix(i, j))
                                    End If
                                Else
                                    If Trim(GridDisplay.TextMatrix(0, j)) = "Order No." Then
                                        RsTmp.Fields("Field1") = "Order No:" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Amount" Then
                                        RsTmp.Fields("Field1") = "Amount  :" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Received" Then
                                        RsTmp.Fields("Field1") = "Received:" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Balance" Then
                                        RsTmp.Fields("Field1") = "Balance :" & Trim(GridDisplay.TextMatrix(i, j))
                                    ElseIf Trim(GridDisplay.TextMatrix(0, j)) = "Receipts" Then
                                        RsTmp.Fields("Field1") = "Rec. Nos:" & Trim(GridDisplay.TextMatrix(i, j))
                                    Else
                                        RsTmp.Fields("Field1") = Trim(GridDisplay.TextMatrix(i, j))
                                    End If
                                End If
                        No = Val(No) + 1
                        RsTmp.Update
                    End If
                Next j
                RsTmp.AddNew
                    RsTmp.Fields("SlNo") = Val(No)
                    RsTmp.Fields("Field1") = "____________________________"
                    No = Val(No) + 1
                RsTmp.Update
                Next i
                
                RsTmp.Requery
                CRP.Reset
                CRP.DataFiles(0) = App.Path + "\" + MyCom.ID + "\ADDRESS.mdb"
                CRP.Formulas(0) = "Company='" & UCase(MyCom.Name) & "'"
                CRP.Formulas(1) = "Title='" & Trim(UCase(LblTitle.Caption)) & " From " & Trim(TxtFrom.Text) & " TO " & Trim(TxtTo.Text) & "'"
                CRP.Formulas(2) = "Date='As On " & Format(Date, "dd-MMM-yyyy") & "'"
                CRP.Formulas(3) = "TitOrdDate='Report Dated From " & Format(DtpFrom.Value, "dd-MM-yyyy") & " TO " & Format(DtpTo.Value, "dd-MM-yyyy") & "'"
                
                CRP.ReportFileName = App.Path + "\OrdColRpt.rpt"
                CRP.Password = vbCrLf + "map1tg2"
                CRP.PrinterSelect
                CRP.WindowState = crptMaximized
                CRP.PrintFileName = App.Path + "\OrdCol.doc"
                CRP.PrintFileType = crptRTF
                CRP.Destination = crptToFile
                CRP.Action = 1
            RsTmp.Close
    Please Help Us, If you can provide me the solution...........

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    8

    Resolved Re: Datas In Crystal Reports Are Jumbling....

    Dear Admin,

    I Got my problems regarding the Crystal reports are resolved. Thanks for your help. My doubt is ''How to mark this thread as 'resolved'?''

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width