Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports with Parameters

Status
Not open for further replies.

carl0957

Programmer
Apr 15, 2003
1
US
I am trying to interface PB8 with Crystal. The example code from crystaldecisions shows several API calls from crpe.dll, but the PEOpenPrintJob (called right after opening the print engine successfully) is returning an error. I have run the debugger and confirmed the filename passed in to the routine is correct, and the .rpt file runs by itself.
any thoughts or sample code or URL would be greatly appreciated.
thanks in advance
 
I have found that crystal does not do a very good job looking for a file, try using a complete path name, not just the file name.
 
i have done this successfully...just see to it that ur global external functions are properly defined. the report name will be sufficient to open the print job. try capturing the error code and look out in the developers help as to what the error code means.
 
Hi, it seems i am having the same problem. Crystal 9 engine with Powerbuilder 8. PeOpenPrintjob returns 0, but the Report *does* exist. Using full path with reportname makes no difference.

We are doing this:

crtp_VInfo.structsize = 316
crtp_PInfo.structsize = 1438

msgstr = "PEOpenEngine"
crtp_rcode = PEOPenEngine()
if crtp_rcode <> 1 then
messagebox(msgstr, "Can't open engine")
end if
messagebox("in open", GetCurrentDirectory ( ))

l_value = GetFileOpenName("Open Report"/* this is the title of the dialog box*/, &
+ l_docname, /* path*/ &
+ l_named, /* filename*/ &
+ "rpt", /* extension*/ &
+ "Reports (*.RPT),*.RPT," &
+ "All Files (*.*),*.*")
IF l_value = 1 Then
crtp_job = PEOpenPrintJob(l_docname)
sle_rtppfad.text = l_docname
if crtp_job <= 0 then
messagebox ("PeOpenPrintJob ", crtp_job)
e_value = PEGetErrorCode (crtp_job)

e_value = PEGetHandleString(ei,e_msg,e_count)

messagebox("Error bei Open Printjob", string(pegeterrorcode(crtp_job)))
end if
else
cb_start.enabled = false
end if

Any ideas?
 
In the meantime i have tested the same program on another machine on which a full crystal reports 9 is installed and not only the runtime files, as on the first machine.

And what do you guess? Yes, it works. No more errors.

The second machine is Win XP, the buggy is a W2K-Server but i dont think that should matter.

It seems i have got a runtime-installation problem.

I have checked the registry key on
HKEY_LOCAL_MACHINE/Software/Crystal Decisions/9.0/Crystal Reports/CommonFiles

It points correctly to the place where my runtime-dlls are installed.

Installed CR9-Servicepack 3 and copied the runtime-files to that folder on my W2K-Machine -> no difference.

Application does not complain about any missing DLLs or something like that. Everything seems fine. The runtime-DLLs are loading properly during application startup.

Any suggestions on this one are much appreciated. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top