Click to See Complete Forum and Search --> : Problems while porting


Souza
July 23rd, 1999, 01:18 AM
Dim StrServerPath
Dim lIndex

StrServerPath = "\\compaq\ash\file1.mdb"
CrystalReport2.ReportFileName = App.Path & "testing.rpt"
For lIndex = 0 To 16
CrystalReport2.DataFiles(lIndex) = StrServerPath
Next
CrystalReport2.SelectionFormula = VAR3
CrystalReport2.Action = 1


this is the code i've used to print a report. when i make an installable and try to run this on an other client, it doesn't recognize the report, giving an error "report not found" error number being 20504. but the values are getting updated in the respective tables. what cud be the problem ?

Ravi Kiran
July 23rd, 1999, 02:06 AM
Try this: It may work:
change the line

CrystalReport2.ReportFileName = App.Path & "testing.rpt"



to

if right$(App.path,1) = "\" then
CrystalReport2.ReportFileName = App.Path & "testing.rpt"
else
CrystalReport2.ReportFileName = App.Path & "\testing.rpt"
end if



Some times the App.Path will not have the last back-slash. (like then current working dir is not same as app.path or something like that!)