Scripting Functions (system.report.executeReport)

Hi,

I did test the system.report.executeReport() function based on the tutorial Scripting Functions Video at Inductive University

Can anyone guide me any mistakes I made, thanks.

Regards

Jian

Does you report work in preview mode? Is there data shown on the report? Any errors in the diagnostic console for the designer?

It’s possible MyReport is unsaved (based on it being in italics)... I would save and close all windows and try again. Reports and Named Queries sometimes need some extra saves for changes to take effect throughout.

Hi, Mate

I ran the script in the Script Console and followed the tutorial exactly, but I'm still encountering issues.

MyReport got nothing to configure except an empty parameter –‘functionName’

I guess this error is fine. I have configured the event in the button.

BTW, I put my code below for your trial.

reportBytes = system.report.executeReport(path='MyReport',project='myProject',\
	parameters={'functionName': 'Using executeReports()'}, fileType='pdf')
name = "executeReport() Report"
event.source.parent.getComponent('PDF Viewer').loadPDFBytes(reportBytes,name)

The report itself, is there data in it? When you run the report in preview mode in the designer is there data showing in the report?

Hi, Mate.

No, I did save it. It’s an empty report.

But when I switch to the window, the text became italics again.

I have pasted the code below; you can change the project name accordingly and try it in your software.

reportBytes = system.report.executeReport(path='MyReport',project='myProject',\
	parameters={'functionName': 'Using executeReports()'}, fileType='pdf')
name = "executeReport() Report"
event.source.parent.getComponent('PDF Viewer').loadPDFBytes(reportBytes,name)

Thanks.

Jian

If the report is empty... Then it might be showing the report. Just empty.

Add some static text or something to the report then you can tell if you are generating the report.

1 Like

Hi, Mate

It works. Thanks :slight_smile:

:+1:

Regards

Jian