Call "*rpt/runreport;Run_Call"

Started by Sonia Cruz, April 22, 2021, 12:44:01 AM

Previous topic - Next topic

Sonia Cruz

Hello All,

Is there a way to change by programming the source data file set in the Report Writer before run and generate the reports through the following call program ? 

CALL "*rpt/runreport;Run_Call",RPTFILE$,TMP_HTML_NAME$

Any idea will be appreciated. 

Thanks in Advance!

Regards,

Sonia Cruz

Mike King

Sonja

Yes -- You can open the report object, tell it the report file, open a print channel and pass that to the object, then run the report.  Something like this where ReportPath$ is the pathname to the pvr file:

  objReport=new("*rpt/pvxReport" for program)
!
  if objReport'open(ReportPath$)=0 \
   then msgbox "Could not open report file:"+sep+sep+msg(err)+sep+msg(-1),"Initialization error","!";
        exit 12
!
  open (hfn)"*pdf*;view;ORIENTATION=landscape"
  print_fl=lfo
!
  objReport'OutputPrint(print_fl)
!
  objReport'runReport()
  objReport'close()
!
  drop object objReport,err=*next
  objReport=0
!
  close (print_fl,err=*next)
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com