Page 1 of 1

PDF option: Landscape vs Portrait

Posted: 13 Jun 2016, 19:54
by Rick.Allen
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

Re: PDF option: Landscape vs Portrait

Posted: 15 Jun 2016, 09:17
by neil.walsh
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

Re: PDF option: Landscape vs Portrait

Posted: 29 Jun 2016, 17:54
by Rick.Allen
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?

Re: PDF option: Landscape vs Portrait

Posted: 07 Jul 2016, 14:55
by neil.walsh
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

Re: PDF option: Landscape vs Portrait

Posted: 08 Jul 2016, 15:43
by Rick.Allen
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

Re: PDF option: Landscape vs Portrait

Posted: 08 Jul 2016, 15:54
by neil.walsh
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