Results 1 to 6 of 6

Thread: HELP ! (Crystal Report Version 8.5)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    BANGKOK
    Posts
    14

    Question HELP ! (Crystal Report Version 8.5)

    I need to use crystal report to generate the distribution report
    but when I try this code :


    Private Sub cmdDistIssuePaper_Click()

    crtDistribute.DataFiles(0) = App.Path & "\aungkee.mdb"
    crtDistribute.ReportFileName = App.Path & "\Distribute_Report.rpt
    crtDistribute.Destination = crptToWindow
    crtDistribute.SelectionFormula = "{tblDistribute.DistributeID}= '" & txtDistributeID.Text & "'"
    crtDistribute.Action = 1

    End Sub

    it doesn't work and the error statement show that

    "ERROR in file C:\Test_Aungkee\Distribute_Report.rpt:
    "ERROR in formular <Record Selection>.
    '{tblDistribute.DistributeID)' ='7"
    A number is required here.

    ** My report file name is Distribute_Report (Created by Crystal Report Version 8.5 and located in folder Test_Aungkee.

    Did I miss something? require to do this code ?
    or dis I make some mistake in SelectionFormular ?

    If anybody know about this please let me know, this code is urgetnly require !! help me

    Linn
    Sunanta K.

  2. #2
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    hi,
    try to remove single quote( ') in your selection formula like this :

    Code:
    crtDistribute.SelectionFormula = "{tblDistribute.DistributeID}= " & txtDistributeID.Text

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    BANGKOK
    Posts
    14

    hi E-Link

    At first I would liket to thank you for yr help

    but now after i'd try to delete(') , it can work but I face with another problem . The error statement tell that "Cannot open SQL Server " so, how can I solve this problem
    Sunanta K.

  4. #4
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    do u use crviewer or Crystal report ocx ?

    try open ur report in Seagate , and refresh u'r report. usually seagete will prompt you a login server window. type ur user name and password. and then save u'r report. try to open it with VB.


  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    BANGKOK
    Posts
    14

    hi again Mr. E-link

    I try to use both of them.
    I'd created an report.rpt (by Crystal Report Version 8.5) and I try to link it with the last code that I show you, but it doesn't work, an error find that "Can not open SQL server "

    Now I try to use CRViewer ,so I want to ask some important step about seagate which you'd recommened me.

    Anyway I'll try

    Thank you .
    Sunanta K.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Try calling this before discarding data:
    VB Code:
    1. Report.Database.LogOnServer "SQLOLEDB1", ServerName, DatabaseName, UserName, Password

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