cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save report as PDF using HTTP Request

Carl_Morphet
Dynatrace Mentor
Dynatrace Mentor

Hello,

Is it possible to generate a URL and saves it as a PDF?

Something like: http://localhost/lsEntryName=Report+Name&dmiAction...

Background:

I'm trying to create a batch file launched on alert which sends the alert email with a DMI PDF attachment, I have the former but am struggling to generate a PDF report on demand

Any insight would be greatly appreciated,

Kind Regards,

Carl

5 REPLIES 5

adam_gardner
Dynatrace Champion
Dynatrace Champion
@Brett Barrett

is this something your DCRUM REST solution could help with / be extended to encorporate?

I don't believe so because the REST interface is generally for building queries. What Carl needs is to be able to access the generatePDF() method on demand from an external API call. Maybe there's a way to hack the CAS to make it work or, more simply, a way to make it understand the format=pdf?

Actually there is a way to do that 🙂 Here is an example:

https://apm.gdn.demo.dynatrace.com:8082/LSSaveAs?d...

How to construct it:

1. Load a report from menu or dashboard - You will have something like

/LSServlet?dmiAction=Generate&lsAction=LoadByName&lsEntryName=Your+Report+Name

2. Change LSServlet => LSSaveAs

3. Add

&format=pdf&formatDiscover=direct 

to URL

4. Generate UID (with /DiagConsole#/diag/UID+GENERATE ) and append to URL

&uid=$UID

Nice!! Thanks, Sebastian, I'm going to save this for later.

Thanks Sebastian, nice "trick" 🙂