Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Line Height Bug??

  1. #1
    Join Date
    Jan 2014
    Posts
    28

    Default Line Height Bug??

    I am trying to adjust the line height of a text-field that I have set the attribute "rich-text-type" to "text/html". I believe there may be a bug in PRD and am wondering if someone can help me figure out if I am doing something wrong or if there is a bug. And if there is a bug how to get this fixed. It is very difficult to explain this but I will try my best.

    This is what I have found. In PRD when I change the attribute "rich-text-type" from "text/plain" to "text/html" the styling no longer allows me to manipulate the font "family" and "font-size" using the style tab. This is expected behavior.

    In order to change the font family and font-size I need to insert in the attribute "value" an expression. Since I want the font to be Times New Roman with a font-size of 10 and the field I am working with is called data1, I insert the following expression into the attribute "value".

    ="<html><body><span style=""font-family: 'Times New Roman'; font-size: 10pt; "">" & [data1] & " <span></body></html>"

    Now my font family and font size come out as I want them (i.e. Times New Roman and font-size 10).

    If I want to create more space between the lines I can increase the style "line-height" (although if my text field is under an inline band I need to change the "line-height" of the band). But I can only decrease the space between the lines to a certain amount. This is expected behavior as the line-height can not be smaller than the font. But when I go all the way down to "0" for "line-height" the space between lines when I am using a relatively small font size like 10pt is larger than it should be. Again this behavior occurs when I have set the attribute "rich-text-type" to "text/html". It is even more dramatic if I use a smaller font size like 5pt. Then it is very easy to see that the spacing between the lines is larger than should be.

    See this document, which shows reports from the different examples I explained above (Sorry I wan't able to upload an attachment to the pentaho forum site).

    What I think is happening here is that when the attribute "rich-text-type" is set to "text/html" PRD picks a default font and font-size. Although one can latter modify the font and font-size PRD still won't allow the line spacing to be smaller than the default font-size. Therefore if one sets the font-size smaller than the default the line spacing will be too big.

    So is this a bug? I really need to be able to reduce the line spacing to 0.

    Please let me know if I can explain this any better. Thanks.
    Last edited by David We; 12-12-2016 at 07:38 PM.

  2. #2
    Join Date
    Jan 2014
    Posts
    28

    Default

    Is there a way I can get support from Pentaho regarding this issue? I am willing to pay if needed. Thanks.

  3. #3
    Join Date
    Aug 2015
    Posts
    29

    Default

    Try setting the font size property to 0 at the master report level (Structure tab -> Master Report -> font size)

    Note: If you have existing fields which don't have a specific font size then they will shrink to 0. This is also the case for any new fields.

  4. #4
    Join Date
    Jan 2014
    Posts
    28

    Default

    I tried this and I got an error. So I went ahead and created a new database and just entered one text-field (and set its attributes as mentioned below). I then set the font size property to 0 at the master report level. This did not make a difference (i.e. the line spacing was still too large). I also tried to set the line-height property to 0 at the master report level. This also did not make a difference.

    Other thoughts?
    Last edited by David We; 12-16-2016 at 01:06 PM.

  5. #5
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    Quote Originally Posted by David We View Post
    Is there a way I can get support from Pentaho regarding this issue? I am willing to pay if needed. Thanks.
    Their phone number is in the top-right corner of this page. You can phone them...

  6. #6
    Join Date
    Jan 2014
    Posts
    28

    Default

    I finally got through to Pentaho. Unfortunately they want $60,000 to $70,000 US annually for the enterprise edition which comes with support. That is clearly beyond my budget.

    Is there anyone out there that would be interested in contracting with me to help solve the issue I am dealing with. Like I mentioned before I am willing to pay something for some assistance.

  7. #7
    Join Date
    Aug 2015
    Posts
    29

    Default

    It looks like you will need to do a bit more coding to get your desired results.....

    When PRD generates the report it is putting your field into an html table. You can see this if you run the report to html and then view source. You will notice that your line of text has been given a style class something like style-2
    <tr style="height: 64pt">
    <td valign="top" class="style-1"><span class="style-2">Hello World Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore</span> <span class="style-2">et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea</span> <span class="style-2">commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla</span> <span class="style-2">pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est</span> <span class="style-2">laborum.</span></td>
    </tr>

    Steps to resolve:

    1. Firstly you need to remove the font-size and font-family from your html, we will add this later via CSS. So your "value" should something like
    <html><body><span>Hello World <span></body></html>

    2. Now go to Master Report -> html -> append header

    Add a style which will be used for the table row
    <style type="text/css">
    .tr {font-family: Times New Roman;
    font-size: 5pt;
    line-height: 100%;}
    </style>

    This will be used to control the html style for your field.

    3. Select your field -> Attributes -> html -> class and add tr as the value of the class item. This means that the generator should now use your CSS rather than the default.

    4. Run your report to HTML and your text should be displayed as your CSS definition. To check this view source in a browser and you should see a reference to the CSS label
    class="tr style-1"><span>Hello World .....

    Note that preview in PRD doesn't reflect the changes. Running to HTML and viewing the source was the best way of debugging.

    Sample file attached. First field is using the CSS and the second field has the font-size and font in the value item of the field.

    html_line_spacing.prpt

    Refer to this post for a better explanation - http://forums.pentaho.com/showthread...eport-Designer

    Hope this helps!

    Cheers
    Eric

  8. #8
    Join Date
    Jan 2014
    Posts
    28

    Default

    Thanks Eric for working on this!

    I took a close look at what you wrote. It does work but like you mentioned only if you run it to HTML. I am trying to run it to PDF. When I run it to a PDF the styles for the CSS are not respected.

    Although I have data that has HTML tags I want my final report to be a PDF. Is it possible to have the CSS styles respected even when I have the rich-text-type set to text/html and I run the report to a PDF?

    Thanks
    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.