Click to See Complete Forum and Search --> : unable to load report


aakheeb
August 1st, 2005, 08:09 AM
hi

i am calling crystal report from visual basic6.
on buttion_click i wrote following code
but it showing error message like "unable to load report"
where is the problem
can anyone help me

button_click

'cr1 is crystal reprot viewer control
MDIForm1.cr1.ReportFileName = App.Path + "\reports\report1.rpt"
MDIForm1.cr1.connect = ";Pwd=" & "system"

MDIForm1.cr1.RetrieveDataFiles -- error at this line

MDIForm1.cr1.DiscardSavedData = True
MDIForm1.cr1.ReportSource = 0
MDIForm1.cr1.WindowTitle = " Purchase Summary "
MDIForm1.cr1.WindowState = crptMaximized
Unload Me
On Error Resume Next
Inventrymain.cr1.Action = 1

mkrayirath
August 2nd, 2005, 04:55 AM
After the connection string

if u use this it will work...and i am giving u with a dsr report which u can add to vb through designviewer...

MDIForm1.cr1.DiscardSavedData = True
MDIForm1.cr1.ReportSource = report1
MDIForm1.cr1.WindowTitle = " Purchase Summary "
MDIForm1.cr1.WindowState = crptMaximized

u have to define this report1 as with that report name(dsr name) and no need of using retreivedatafiles