Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Nov 6, 2015 6:18:53 AM
Nov 6, 2015 6:18:53 AM
When creating templates for generating reports, you will sometimes want to present information with formatting as it appears in QlikView. Keeping Qlikview source formats is the default setting in NPrinting.
In other cases, you may want to apply CSS inline style elements as you create templates in the HTML Template Editor. In order to do this, you need to perform the following steps:
After you have added a QlikView object as a table:
This will cause the content for all cells in all columns of the table to be exported from QlikView without formatting. The application of CSS inline style elements that you set in the HTML template will be applied (See section further below: "Allow Application of CSS Inline Style Elements for Specific Columns").
Be sure that your table object is a straight table in QlikView. Qlikview pivot tables must be converted to straight tables before selecting them to be included under the NPrinting Tables node or you will not have access to individual fields/columns.
If you want to keep source formatting for the majority of columns, leave the "Keep Source Formats" box checked for the table as a whole and proceed as follows:
Refer to "Which Formats Can I Use in Columns?".
The Keep Source Formats box has been cleared Gross Profit column
This is the original table with Keep Source Formats cleared for the first and last columns, a heading row added, and the original table headings hidden for each and every column.
Here is the code in full:
<html>
<body>
<table cellspacing=0 style="border-collapse:collapse;">
<tr style="width:0*;
font-family:Verdana;
font-size:small;
font-variant:small-caps;">
<th style="border:grey dashed 1px;">
Product Name
</th>
<th style="border:grey dashed 1px;">
Total Sales
</th>
<th style="border:grey dashed 1px;">
Gross Profit
</th>
<th style="border:grey dashed 1px;">
GP%
</th>
<th style="border:grey dashed 1px;">
Quantity
</th>
</tr>
<tr>
<td style="width:0*;
font-family:Verdana;
font-size:small;
font-weight:bold;
font-variant:small-caps;">
%%ProductName%%
</td>
<td>
%%Total Sales%%
</td>
<td>
%%Gross Profit%%
</td>
<td>
%%GP%_1%%
</td>
<td style="width:0*;
color:red;
font-family:Georgia;
font-size-adjust:0.40;
background-color:Yellow;
border:green solid 2px;
text-align:right;">
%%Quantity_1%%
</td>
</tr>
</table>
</body>
</html>
This sample output is simple but it gives you an idea of the possibilities.
Nice post !! I assume, Current version has this feature to get Headers as well.
Yes, "Show Header" property works on both Qlik NPrinting 16.* (and older) and on 17.* and higer versions.
This tutorial, at all, is correct for both old 16.* (and older) and 17.* (and newer) versions.