forked from tableau/js-api-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exportToPDF.html
34 lines (26 loc) · 888 Bytes
/
exportToPDF.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<title>Export to PDF</title>
<script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script>
<script type="text/javascript">
var viz;
function initViz() {
var containerDiv = document.getElementById("vizContainer"),
url = "http://public.tableau.com/views/RegionalSampleWorkbook/Obesity",
options = {
hideTabs: true
};
viz = new tableau.Viz(containerDiv, url, options);
// Create a viz object and embed it in the container div.
}
function exportToPDF() {
viz.showExportPDFDialog();
}
</script>
</head>
<body onload="initViz();">
<div id="vizContainer"></div>
<button onclick="exportToPDF();">Export</button>
</body>
</html>