Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can create your own API Endpoints using BellaDati Extensions feature. This tutorial describes how to create an endpoint which exports public Report to PDF.

 You can download complete Extension with and endpoint here and import it to BellaDati Extensions. Refer to Importing Extensions section in Extensions documentation.

Preconditions

  • You have BellaDati instance in version 2.8.6.1+.
  • You have role Super Admin in multi-domain environment or Domain Admin in single-domain environment.
  • You are familiar with Java/Groovy.
  • You have a public Report. Refer to Public Report section in Sharing Report documentation.

...

Code Block
languagejs
https://service.belladati.com/extension/detail:endpoint/104/exportReportToPDF?reportId=12345

Example usage in HTML:

1.

Code Block
languagexml
<!--Use relative URL in BellaDati Extension-->
<!--Clicking on the button will open the PDF in browser built-in PDF reader if supported-->
<a href="/extension/detail:endpoint/104/exportReportToPDF?reportId=12345">
	<div class="my-button">
	Export to PDF
	</div>
</a>

2.

Code Block
languagexml

 
<!--Using download attribute-->
<!--Clicking on the button will save the file without opening it-->
<a 
	href="/extension/detail:endpoint/104/exportReportToPDF?reportId=12345"
	download
>
	<div class="my-button">
	Export to PDF
	</div>
</a>