|
-
Nov 25th, 2001, 12:03 AM
#1
Thread Starter
New Member
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
-
Nov 25th, 2001, 12:23 AM
#2
Addicted Member
hi,
try to remove single quote( ') in your selection formula like this :
Code:
crtDistribute.SelectionFormula = "{tblDistribute.DistributeID}= " & txtDistributeID.Text
-
Nov 25th, 2001, 12:54 AM
#3
Thread Starter
New Member
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
-
Nov 25th, 2001, 01:10 AM
#4
Addicted Member
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.
-
Nov 25th, 2001, 02:20 AM
#5
Thread Starter
New Member
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 .
-
May 15th, 2002, 05:32 PM
#6
Try calling this before discarding data:
VB Code:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|