Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2003
    Location
    India
    Posts
    12

    Unanswered: My VB App - CrystalReport hangs 1st time in client pc, 2nd time shows data correctly

    Hai All,

    If this is not the appropriate place for this post, then sorry. I have a Serious issue. Without solving this scenario i can't implement my project. I am getting hanged because of this for a long time.

    I will explain the problem here. Kindly view this issue and suggest me. The issue follows.

    Here i attatched my Picture of Form and the Crystal Report 8.5 while it is in Design View , Runtime View, and the Report when hanging and the 8.5 Control pictures are attached with this post. Open it wiht Paint. its Bmp files. The database here is MsSql, I am only developing the front end in VB, I am using the Crystal Report 8.5 Control to show the Reports from vB
    The Report Hangs for the first time it shows only the blank screen, then the user need to close the Application Manually (i.e) through EndTask program. Then after closing the Application when tries for the Second time the Report is shown with the Data's correctly. All our clients are using WinXP.
    The Report shows for the Second time or third time and Further.
    The project is compiled in the machine where it is devoloped [Advanced 2000 Server] and also tested by changing the project to WinNt Server and installed VB6 there and compile the porject from there. Win2000 AdvancedServer or WinNT both are servers. While runnging the VB it shows the Report without any interuption, where as when i am running from the client system it hangs for the First time, some times hangs for first 2 times (Usually I compile the project and run the Setup file in the Client machine and then create the Shortcut of the exe for them)
    The Print Command Button in the Form contains the following Code.
    Private Sub Printe_Click()
    If optProduct.Value = True Then
    Call optPpwise
    ElseIf optItem.Value = True Then
    Call optPitemwise
    ElseIf optInvoice.Value = True Then
    Call optInvoice
    ElseIf optSlsmanwise.Value = True Then
    Call optPsalessum
    ElseIf optcsum.Value = True Then
    Call optPcsum
    ElseIf optPcustName.Value = True Then
    Call Pcustname
    ElseIf optCustdetail.Value = True Then
    Call optPcustdetail
    ElseIf optCust.Value = True Then
    Call optPcstwise
    ElseIf optcsumvalue.Value = True Then
    Call PCsumListbyValue
    Else
    MsgBox "Choose Option !", vbExclamation, "Option - Missing"
    End If
    End Sub

    If the User Clicks the Invoicewise Option Button and press PrintButton then the following code will fire the Function optInvoice() code will execute. that is shown below
    Private Function optInvoice()
    CrystalReport1.GroupSelectionFormula = ""
    Dim i As Integer
    Dim pfdt As Date
    Dim ptdt As Date
    Dim strsf As String

    For i = 1 To 25
    CrystalReport1.Formulas(i) = ""
    Next i
    pfdt = txtpfrom.Text
    ptdt = txtpto.Text

    If Len(cmbPprod.Text) <= 0 Or cmbPprod.Text = "All" Then
    CrystalReport1.ReportFileName = App.Path & "\invoicewiseitemwgt.rpt"
    strsf = "{ST030100.ST03015} in Date(" & _
    Format(pfdt, "YYYY,M,D") & ") to Date(" & _
    Format(ptdt, "YYYY,M,D") & ")"
    CrystalReport1.ReplaceSelectionFormula (strsf)
    CrystalReport1.Formulas(1) = "fdt='" & Format(pfdt, "DD/MM/YYYY") & "'"
    CrystalReport1.Formulas(4) = "tdt='" & Format(ptdt, "DD/MM/YYYY") & "'"
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.PrintReport
    Else
    CrystalReport1.ReportFileName = App.Path & "\invoicewiseitem.rpt"
    strsf = "{ST030100.ST03015} in Date(" & _
    Format(pfdt, "YYYY,M,D") & ") to Date(" & _
    Format(ptdt, "YYYY,M,D") & ")"
    CrystalReport1.ReplaceSelectionFormula (strsf)
    CrystalReport1.GroupSelectionFormula = "{ST030100.ST03018}='" & cmbPprod.Text & "'"
    CrystalReport1.Formulas(1) = "fdt='" & Format(pfdt, "DD/MM/YYYY") & "'"
    CrystalReport1.Formulas(4) = "tdt='" & Format(ptdt, "DD/MM/YYYY") & "'"
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.PrintReport
    End If
    End Function

    As below in the FormLoad event I am connecting Crstal Report to Database
    Private Sub Form_Load()
    CrystalReport1.Connect = "DSN=scalaDB;UID=scala;PWD=scala"
    End Sub
    I also check the Server Performance while the user clicks the Print Button to view the Report. The ODBC are properly configured in the Client machine and the Devoloped machine. Even the Report which has less Reports getting hanged sometimes.
    The Server is not loaded. Eventhough the CPU usage is 0% its hanging. Kindly consider this issue as impartant and reply me.

    Thank you very much,
    Chock.
    Attached Files Attached Files
    Chock

Posting Permissions

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