Embedding Static Reports using Markup
Static embedding allows you to embed a Logi report simply by manipulating the markup tags. This is done by adding the appropriate data-* attributes to the div container you've already created:
- <div id="div1" data-applicationUrl="yourLogiAppURL" data-report="yourReportName" data-autoSizing="all"></div>
The attributes are:
Example 1: Simple Static Embedded Report
- <body>
- div id="div1" data-applicationUrl="https://sampleapps.logianalytics.com/logiapp" data-report="EmbeddedReports.DataTable" data-autoSizing="all"></div>
- <script src="https://sampleapps.logianalytics.com/logiapp/rdTemplate/rdEmbedApi/rdEmbed.js"
type="text/Javascript"></script>- </body>
It's very important that the <script> statement that includes rdEmbed.js be the last line of code before the </body> tag in your HTML or else the API will not work.
Example 2: Static Embedded Report with Parameters for use in Query
Style can also be added to the div to give it a border and background color.
- <div id="div2" data-applicationUrl="https://sampleapps.logianalytics.com/logiapp" data-report="EmbeddedReports.DataTable data-autoSizing="all" data-linkParams="{'CustomerID' : 'VINET', 'StartDate' : '01/01/1996'}" class="divFrame" ></div>
Example 3: Using a Fixed-Size Layout
By default, embedded reports fill 100% of their div container. To control the report size, you can specify the div element's size with width and/or height style attributes. If the embedded report's physical size is greater than its div container, the report will automatically show scrollbars. You can hide the scrollbars by using style for the div element: overflow(-x | -y): none;.
- <div id="div3" style="width:350px; height:150px;" data-applicationUrl="https://sampleapps.logianalytics.com/logiapp" data-report="EmbeddedReports.DataTable" data-linkParams="{'CustomerID' : 'CHOPS'}" ></div>
When you specify a size in this way, you can skip the normally required data-autoSizing attribute.