You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If integrating with Reporting via a custom UI, the following job parameters must be Rison encoded and posted to
7
-
the aforementioned generate job url:
6
+
A configuration for a PDF or PNG report job is represented with an interface that includes the `BaseParams` and the following
7
+
fields. To create a request for one of these report types, these required job parameters are encoded into a query string variable
8
+
of the report generation URL:
8
9
9
10
----
10
-
interface jobParameters {
11
-
objectType: string;
12
-
title: string;
13
-
browserTimezone: string;
14
-
relativeUrls: string[];
11
+
interface BaseParamsPDFV2 {
15
12
layout: {
16
-
id: string;
13
+
id: string; <1>
17
14
dimensions: {
18
15
height: number;
19
16
width: number;
20
17
};
21
18
};
19
+
locatorParams: LocatorParams[]; <2>
22
20
}
23
-
----
24
-
25
-
`jobParameters.browserTimezone` is a string that appears in the tz database
26
-
`jobParameters.layout.id` presently only accepts "print" and "preserve_layout"
27
-
`jobParameters.layout.dimensions` is only currently used by "preserve_layout"
28
-
29
-
[float]
30
-
==== `export-config` directive
31
-
If integrating with Reporting via the `export-config` directive, the AngularJS controller that contains
32
-
the directive should expose the following methods and the `export-config` directive will POST them to the
33
-
reporting API:
34
-
35
-
----
36
-
37
-
function getSharingType(): string;
38
-
39
-
function getSharingTitle(): string;
40
21
22
+
interface BaseParamsPNGV2 {
23
+
layout: {
24
+
id: string; <3>
25
+
dimensions: {
26
+
height: number;
27
+
width: number;
28
+
};
29
+
};
30
+
locatorParams: LocatorParams; <4>
31
+
}
41
32
----
42
-
43
-
The `export-config` directive will use the browser's current URL and timezone when generating the job
44
-
parameters automatically. The `export-config` directive will also grab the height/width of the element
45
-
with the `data-shared-items-container` attribute and use this as the dimensions.
33
+
<1> The available `layout.id` options for PDF exports are `preserve_layout`, `print`, and `canvas`. These control how dashboard
34
+
panels are captured and positioned into pages in the PDF file.
35
+
<2> The `locatorParams` value is controlled by the application loaded in the browser for which a screenshot will be captured. The
36
+
parameters to generate a PDF report allow an array of `locatorParams` to support multi-page PDF reports.
37
+
<3> The only available `layout.id` option for PNG exports is `preserve_layout`.
38
+
<4> The parameters to generate a PNG report allow a single value for `locatorParams`.
46
39
47
40
[float]
48
-
==== Screenshot capturing attributes
49
-
When generating the PDF, reporting looks for a number of attributes in the DOM to determine which elements
50
-
should have their screenshot taken and when the Visualizations are done rendering.
41
+
==== How applications make themselves screenshot-capable
42
+
When generating the PDF, the headless browser launched by the Reporting export type runs a script that looks for a number of
43
+
attributes in the DOM to determine which elements should have their screenshot taken and when the Visualizations are done
44
+
rendering.
51
45
52
46
The print layout takes a screenshot of every element with the `data-shared-item` attribute and includes the
53
47
individual screenshots in the PDF. The print layout also uses the `data-title` and `data-description`
@@ -58,10 +52,12 @@ reporting will resize the element with the `data-shared-items-container` to be t
58
52
The preserve layout also uses the `data-title` and `data-description` attributes on the HTMLElement with the
59
53
`data-shared-items-container` attribute to specify the title/description for the entire PDF.
60
54
61
-
Reporting needs to determine when all of the visualizations have completed rendering, so that it can begin taking screenshots.
62
-
If there are multiple visualizations, the `data-shared-items-count` attribute should be specified to let Reporting know how
63
-
many Visualizations to look for. Reporting will look at every element with the `data-shared-item` attribute and use the corresponding
64
-
`data-render-complete` attribute and `renderComplete` events to listen for rendering to complete. When rendering is complete for a visualization
65
-
the `data-render-complete` attribute should be set to "true" and it should dispatch a custom DOM `renderComplete` event.
55
+
Reporting needs to determine when all of the visualizations have completed rendering, so that it can begin taking screenshots. If
56
+
there are multiple visualizations, the `data-shared-items-count` attribute should be specified to let Reporting know how many
57
+
Visualizations to look for. Reporting will look at every element with the `data-shared-item` attribute and use the corresponding
58
+
`data-render-complete` attribute and `renderComplete` events to listen for rendering to complete. When rendering is complete for a
59
+
visualization the `data-render-complete` attribute should be set to "true" and it should dispatch a custom DOM `renderComplete`
60
+
event.
66
61
67
-
If the reporting job uses multiple URLs, before looking for any of the `data-shared-item` or `data-shared-items-count` attributes, it waits for a `data-shared-page` attribute that specifies which page is being loaded.
62
+
If the reporting job uses multiple URLs, before looking for any of the `data-shared-item` or `data-shared-items-count` attributes,
63
+
it waits for a `data-shared-page` attribute that specifies which page is being loaded.
0 commit comments