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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Control Viwer in PB

Status
Not open for further replies.

vulcanjena

Programmer
May 22, 2003
39
PR
Can any body tell me how can I view the OLE object ( Crystal report ) within a Parent window . Right now the report is getting opened but in minimize form.I have to specifically open it by clicking on it , which I don't want to do.

here is the Pb script :


string lsDBMS, lsDB, lsSVR, lsUID, lsPass, lsConStr, lsSubRptName
long llSubRptCount, lli, llLogOn


lsDBMS=SQLCA.DBMS
lsDB=SQLCA.Database
lsSVR=SQLCA.ServerName
lsUID=SQLCA.LogId
lsPass=SQLCA.LogPass
lsConStr="DSN="+lsSVR+";UID="+lsUID+";PWD="+lsPass+";DSQ="+lsDB

if FileExists(lsReportPath+'rpt') then

TRY
w_rep__caller.ole_1.Object.Reset()

w_rep__caller.ole_1.Object.ReportFileName(lsReportPath+'rpt')
w_rep__caller.ole_1.Object.WindowState = 0


//Modifico la connecion del reporte y envio el # de Job
w_rep__caller.ole_1.Object.Formulas[0] ="JobId=" + string(w_main.is_report.job)
w_rep__caller.ole_1.Object.Connect = lsConStr

//Modifico la coneccion de los subreportes
llSubRptCount=w_rep__caller.ole_1.Object.GetNSubreports
for lli=0 to llSubRptCount - 1
lsSubRptName=w_rep__caller.ole_1.Object.GetNthSubreportName(lli)
w_rep__caller.ole_1.Object.SubreportToChange=lsSubRptName
w_rep__caller.ole_1.Object.Connect = lsConStr
next
w_rep__caller.ole_1.Object.SubreportToChange=''

//Ejecuto el reporte
w_rep__caller.ole_1.Object.Action =1
w_rep__caller.ole_1.Object.Destination = 0 //Added by JENA

CATCH (runtimeerror er)
MessageBox("ITS Runtime Error", string(w_rep__caller.ole_1.object.lasterrorstring))

END TRY
else
messagebox ('Error','Error launching '+lsReportPath+'rpt')
end if
w_rep__caller.ole_1.Object.Reset()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top