Results 1 to 1 of 1

Thread: when running VB6exe & try to show CrystReport hangs 1st time & 2nd time shows correct

Threaded View

  1. #1

    Thread Starter
    Addicted Member chockku's Avatar
    Join Date
    Sep 2003
    Posts
    174

    when running VB6exe & try to show CrystReport hangs 1st time & 2nd time shows correct

    Hai All,

    Here i written the porblem and attatched my Picture of Form with this mail. Kindly when you have time see and reply me. Without finishing this problem I can't implement this Project. As you know the database here is MsSql, developing the front end in VB, I am using the Crystal Report 8.5 tool 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. All our clients are using WinXP.
    Where as the Report shows for the Second time and further.
    Here the Form picture is attached with this Mail. 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()
    On Error Resume Next
    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.

    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

    Thank you very much,
    Chock.
    Attached Files Attached Files
    HAVE A NICE DAY

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