Catalogues export pdf

Post Reply
Rajaraman
Posts: 137
Joined: 02 May 2018, 12:20
Contact:

We have View: Application Catalogue as Table, where we are showing a list of columns.

But when we want to export as pdf, i want all/more columns (additional columns that is not appearing in the page, but from the same class ex Composite_Application_Provider)

How to achieve the same?

Is there a facility to create reports using the data?
JohnM
Posts: 478
Joined: 17 Feb 2009, 20:19

You could extend the report. We use datatables so in the code if you look for the columns section, you can add to the columns here, see below:
catalogueTable = $('#dt_apps').DataTable({
......
columns: [
{ "width": "20%" },
{ "width": "40%" },
{ "width": "25%" },
{ "width": "15%", "type": "html",}
],
.....
});

You then need to add <th></th> for the new column to the table itself and update the code to add the data you want as another <td></td> when you create the table row.

If you use the older versions of catalogues then the <td> is created in the template, in the latest version you need to add the td item to the JSON structure then map it to the td in the Javascript via the dataTableRow.push(YOUR ITEM).

Once you do this then the pdf export will pick up the new columns
Rajaraman
Posts: 137
Joined: 02 May 2018, 12:20
Contact:

I dont want those additional column appear in the screen but only in pdf
JohnM
Posts: 478
Joined: 17 Feb 2009, 20:19

add 'visible': false to the column and it will hide in the view but print in the pdf:
{ "width": "15%" },
{ "width": "15%" },
{ "width": "15%", "visible": false },
{ "width": "15%", "visible": false },.....

The last 2 columns will be hidden
Post Reply