|
-
Apr 24th, 2005, 05:10 AM
#1
Thread Starter
Addicted Member
error in viewing a report
hi,,
i have this code for viewing a report from my application but when i run the program and click on the report buttin i get this error:
report not found..
the kine colored in red is the one that i get the error in:
Code:
Private Sub Command1_Click()
CrystalReport1.ReportFileName = App.Path & "rent.rpt"
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles
CrystalReport1.ReportSource = 0
CrystalReport1.SQLQuery = "select * from rent order by {serial}"
CrystalReport1.WindowTitle = "Rent system"
CrystalReport1.Destination = crptToWindow
CrystalReport1.PrintFileType = crptCrystal
CrystalReport1.WindowState = crptMaximized
CrystalReport1.SelectionFormula = "IsNull({Document.rent})"
CrystalReport1.Action = 1
End Sub
any help please?
-
Apr 24th, 2005, 05:18 AM
#2
Re: error in viewing a report
App.Path does not include an ending \ (unless the app is in the root directory of a drive). Add a \ to the file name.
CrystalReport1.ReportFileName = App.Path & "\rent.rpt"
-
Apr 24th, 2005, 05:50 AM
#3
Thread Starter
Addicted Member
Re: error in viewing a report
i did what you told me and i get this error :
error in formula the error is in red)
Code:
Private Sub Command1_Click()
CrystalReport1.ReportFileName = App.Path & "\rent.rpt"
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles
CrystalReport1.ReportSource = 0
CrystalReport1.SQLQuery = "select * from rent order by {serial}"
CrystalReport1.WindowTitle = "Rent system"
CrystalReport1.Destination = crptToWindow
CrystalReport1.PrintFileType = crptCrystal
CrystalReport1.WindowState = crptMaximized
CrystalReport1.SelectionFormula = "IsNull({Document.rent})"
CrystalReport1.Action = 1
End Sub
-
Apr 25th, 2005, 11:53 PM
#4
Thread Starter
Addicted Member
Re: error in viewing a report
can someone help me please?
-
Apr 26th, 2005, 06:15 AM
#5
Re: error in viewing a report
What is the code for your formula?
That would appear to be what Crystal doesn't like, but as I don't know what that code is, I can't, at the moment, offer any suggestions.
-
Apr 26th, 2005, 03:04 PM
#6
Re: error in viewing a report
You specified Document.Rent in the formula. Document is the table name and Rent is the field name. Document is not a table in your Selection formula. Rent is however.
Should the formula be
CrystalReport1.SelectionFormula = "IsNull({Rent.rent})"
or
CrystalReport1.SelectionFormula = "IsNull({Rent.????? Some other field})"
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
|