PDF option: Landscape vs Portrait

Post Reply
Rick.Allen
Posts: 23
Joined: 21 Jun 2012, 18:08

Some of the tables would render better if the PDF creator used landscape orientation rather than portrait.

Is there a means to control orientation? or 2 PDF buttons?

Thanks, Rick
Rick Allen
Enterprise Resource Planning (ERP) Analyst
Hamilton Police Services, Ontario, Canada
User avatar
neil.walsh
Posts: 444
Joined: 16 Feb 2009, 13:45
Contact:

Hi Rick,

It is indeed possible to reconfigure the buttons to print in landscape.

You'll need to tweak a bit of code in the XSL file you're interested in changing.

For example, in the Technology Product Catalogue (core_tl_tech_product_list_table.xsl) find the Data Tables script (e.g. Line 152) and change the following...

swap

Code: Select all

'pdfHtml5',
for

Code: Select all

{extend: 'pdfHtml5',orientation: 'landscape'},
We've set the defaults to be portrait but if you have a list of views where you think the tables would benefit from being landscape then let us know and we'll review them for a future release.

Thanks

Neil
Rick.Allen
Posts: 23
Joined: 21 Jun 2012, 18:08

Neil, thanks for the instructions on configuration to Landscape. It works but leads to another issue.

The columns that have line breaks in HTML do not have the same breaks in the Excel, PDF output.

Example: Business Function Service Model, a Service may have may multiple Actors, Consumers and Supporting Applications. The HTML renders each occurrence on a new line. However, the Excel and PDF generated as them as one string per service. Can this be altered?
Rick Allen
Enterprise Resource Planning (ERP) Analyst
Hamilton Police Services, Ontario, Canada
User avatar
neil.walsh
Posts: 444
Joined: 16 Feb 2009, 13:45
Contact:

Hi Rick,

Apologies, I missed this response....

Unfortunately, no. What the render is doing, is creating a simple table with plain text content. The list of elements in the other cells are often bulleted lists but the renderer just flattens these as plain text.

The only way to address the issue is to "flatten" the whole table whereby for every item in a bulleted list, we render a copy of the row. However, this is not always as simple as it sounds especially if there are multiple bulleted lists.

The functionality offered by the DataTables widget is useful but it's not always a good replacement for a dedicated view. Additionally, there's always the challenge of the data in documents falling out of date with the "live" version.

What are you looking to achieve with the export of these tables?

Thanks

Neil
Rick.Allen
Posts: 23
Joined: 21 Jun 2012, 18:08

Neil, Thanks for the response.

I was hoping to use the PDF to distribute the lists to other departments for verification that the modeling is correct.

Not everyone has access to the Web pages (or cares to look).

A PDF would have been easy to share.

Regards, Rick
Rick Allen
Enterprise Resource Planning (ERP) Analyst
Hamilton Police Services, Ontario, Canada
User avatar
neil.walsh
Posts: 444
Joined: 16 Feb 2009, 13:45
Contact:

Hi Rick,

One rather hack-y solution might be to temporarily disable javascript in your browser. This will display the whole table without the filtering etc, and then you could use the Print to PDF functionality on your system (if that's available).

There's no obvious fix for what you're looking for right now though we'll make a note to review that in the future.

Thanks

Neil
Post Reply