section_text

DT ALM is Dunstan Thomas's Application Lifecycle Management solution. Established in 1986, Based in the UK, DT provides solutions across Europe and the USA.

section_grafx

Index

Wednesday, 15 August 2007

StyleVision - Not quite as stylish or visionary as I would have liked

We have been using the XSLT editor StyleVision from Altova since the start of this year. We use it to build the reports generated by our pension system, Imago Front Office, which provides a prospective or existing pension customer with an illustrative report. I have found that with using StyleVision, having the ability to easily and simply create conditional logic, to drag and drop XML tag values onto the design and to create dynamic designs, has been invaluable in the work that we do; there have been a number of weird and bizarre "quirks" of StyleVision which have resulted in an overwhelming desire on occasions to throw my laptop out of the window and into the waters of Portsmouth Harbour.

When asked to produce a blog, I thought that I would take the time to provide some solutions and work arounds for problems that I have encountered when using StyleVision.


Page breaks

When I was experiencing problems with page breaks whilst working on a project a couple of months back, I found very little information on the web about similar page break problems; so I hope that this will help.

The problem was that, on occasions, page breaks were causing the system to produce a blank page in the middle of the report. The page breaks had been in place within the style sheet for a number of years and this had not caused a problem before. Despite the fact that there was no space between the last element and the page break, when the last element before the page break encroached upon the end of the page, the page break inserted a blank page within the PDF. There did not seem to be a way to give the page break any sort of attribute to get it not to produce, what was in effect two page breaks. Having looked through the various options in the styles window, I spotted that there were a number of page break options under the "paged media" tab. However, despite having attempted to select the content and give it the attribute of avoid page break inside, it was having no effect.

By way of explanation - if you take the above paragraph as an example, with an enforced page break after it and a number of conditional pieces of text and tables above it, each containing multiple lines; the above paragraph could very easily be pushed to the bottom of the page and onto the next one. However, for certain circumstances, the text is pushed to the very end of the page, the page break would (with no logic around it) create the phantom page. It would be extremely difficult to write an XPath expression to produce validation around the page break, to incorporate the number of years that the illustrations was for, the number of funds that had been invested in or the various pieces of conditional text. In addition, any complex logic that had been written and rigorously tested would be wasted time if any of the spacing above the paragraph was changed at a later date. Through a great deal of trial and error, I eventually found the following solution.


  • If the problem is not caused by a table, you will need to create a table to place the text or condition onto as well as the page break

  • Highlight the table node in the design tree window

  • Under the HTML tab of the properties window, set the "rules" attribute to group

  • You will see that the table will have a defined line around it, this will not appear in the report

  • Now select the "paged media" tab on the styles window and set the "page-break-in" attribute to avoid


This will now mean that if the newly grouped table is not able to fit onto the end of the page it will start on the beginning of the next page. This will stop the page break ever coming into contact with the bottom of the page.

In the next exciting instalment of the DT StyleVision blog, I will be sharing with you the rather bizarre work around that I found for solving an issue with the column widths of tables generated by dragging a parent node onto the design. No matter what I set the column width percentages to, they were still showing 50/50.

Labels: , ,