PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Call "*rpt/runreport;Run_Call"  (Read 195 times)

Sonia Cruz

  • Member
  • **
  • Posts: 8
    • View Profile
Call "*rpt/runreport;Run_Call"
« on: April 22, 2021, 12:44:01 AM »
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
« Last Edit: April 23, 2021, 07:05:36 PM by Sonia Cruz »

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3476
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Call "*rpt/runreport;Run_Call"
« Reply #1 on: May 07, 2021, 04:50:46 PM »
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:

Code: [Select]
  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)