HTML reports containing tables

Tables exported from QlikView or Qlik Sense can be displayed with or without the original headings. You can hide the headings that were exported, and then create your own custom headings. This is also true for tables constructed by putting together columns generated from data fields.

The following example shows how to create an HTML report with tables.

Testing

You can use our sample files to create your app. To download these files, see: Sample files.

Adding tables to an HTML template

Do the following:

  1. Click Edit template to open the Template Editor.

  2. Right-click the Tables node, and then select Add objects.
  3. Select an object from the list.

  4. Click OK.
  5. Right-click the object node, and then select Properties.
    Note: If the Properties window is already in view , the Properties option will not be shown when you right-click a node.
  6. Select the Keep Source Formats and Show Headers check boxes in the Properties panel.

  7. Drag the table node tag into the template and drop it onto an empty table data container.

     <html>
            <body>
                  <table>
                        <tr>
                         	<td>
                          		<h1 style="text-align:center">
                           	Top 10 Products<br /br>
                           	with QlikView Heading
                          		</h1>
                         		%%yourtableobject%%
                         </td>
                         <td>
                         		 <h1 style="text-align:center">
                           	  Top 10 Products<br> </br>
                           	  Hidden QlikView Heading
                         		 </h1>
                           </td>
                        </tr>
                    </table>
    		...

    Two versions of the table are displayed side by side. The left table has headings visible, and the right table has the headings hidden. The table is embedded as a unit in both cases.

  8. Add the same table to the template again.
  9. Open the Properties pane for the new table object, and then set the Show Headers property to Hide.
  10. Drag the table node tag into the template and drop it onto the appropriate empty line:

    <html>
       	<body>
        		<table>
        			 <tr>
          				<td>
           				<h1 style="text-align:center">
            				Top 10 Products<br /br>
            				with QlikView Heading
           				</h1>
            				%%yourtableobject%%
          				</td>
          				<td>
          					 <h1 style="text-align:center">
            				  Top 10 Products<br /br>
            				   Hidden QlikView Heading
          					 </h1>
           				%%yourtableobject_1%%
          				</td>
         			</tr>
        		</table>
        ...
  11. Expand the table node.
  12. Drag and drop each column, one at a time, onto the template in the appropriate HTML container.

    This third version of the table is reconstructed column-by-column in a separate HTML table. Each table heading and table data cell can have inline style elements added individually. The inline style elements for each table data cell will have an effect on the whole column below the heading.

  13. Add custom headings.

  14. Here is the HTML code for the reconstruction of the last version of CH184_1 - Top 10 Products in another table:

    <table>
       	<tr>
        		<th style="width:125px;">
     		Product
        		</th>
          		<th style="width:60px;">
            	 Sales
          		</th>
          		<th style="width:60px;">
             	Profit
          		</th>
          		<th style="width:100px;">
            	 Profit Percentage of Sales
          		</th>
         	 </tr>
            <tr>
          		<td>
          		</td>
          		<td style="width:125px;">
            	 %%ProductName_1%%
          		</td>
          		<td style="width:60px;">
             	%%Total Sales_1%%
          		</td>
          		<td style="width:60px;">
            	 %%Gross Profit_1%%
          		</td>
          		<td style="width:100px;">
            	 %%GP%_1%%
          		</td>
          		<td>
          		</td>
         	  </tr>
        </table>
       </body>
    </html>
    
Note:

QlikView sheet objects that have calculated dimensions or null values can be used as levels. However, you cannot nest other objects inside them, except for fields from that sheet object. Qlik Sense visualizations with calculated dimensions cannot be used as levels.

Preview and save

Do the following:

  1. Click Preview.
  2. Check the report, close it, and then edit the template again if necessary.
  3. Click Save and Close to save the template and close the Template Editor.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?