Hitachi Vantara Pentaho Community Forums
Results 1 to 12 of 12

Thread: Send Table output content into Mail body not as attachment

  1. #1
    Join Date
    Oct 2013
    Posts
    216

    Post Send Table output content into Mail body not as attachment

    Hi,

    I want to mail the file output of one table as a mail body not as attachment,
    I already used with text output file, but there is a missing of border and content not displaying well.

    Can anyone help me to solved out this ?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You can send HTML mail by enabling option "Use HTML format in mail body" and tagging your rows and fields.
    Attached Files Attached Files
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Dec 2010
    Posts
    193

    Default

    Hey ,

    Your transformation runs in Unix machine or Windows ? Then , you want table output in mail body of a job or trans ?
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

  4. #4
    Join Date
    Oct 2013
    Posts
    216

    Default

    Thanks marabu !!

    Really U did a very nice Transformation, Very helpful to solve my problem .


  5. #5
    Join Date
    Oct 2013
    Posts
    216

    Default

    Dear Marabu ,

    How to change format in this job?
    I want that in column all numbers as right align and Name as left allign. What to do ?

  6. #6
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    If it's an HTML page, you can google about HTML table formatting.
    -- Mick --

  7. #7
    Join Date
    Oct 2013
    Posts
    216

    Default

    Yes !! I Did. Thanks.

  8. #8
    Join Date
    Nov 2013
    Posts
    382

    Default

    I was trying to create a table with some attributes using the excellent marabu transformation ... without succes

    I wasn't able to add neither a table 'colour' nor a column 'colour' (just using them as a test to understand how it works).

    What am I misising?
    Attached Files Attached Files

  9. #9
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    AFAICS you managed to add a colour attribute to the table and tr elements.
    This is what is generated:

    Code:
    <table border="3" colour="blue">
       <tr colour="purple"><td>1</td><td>Do you remember Grandma's lye soap,</td></tr>
       <tr colour="purple"><td>2</td><td>Good for everything in the home.</td></tr>
       <tr colour="purple"><td>3</td><td>And the secret was in the scrubbing,</td></tr>
        <tr colour="purple"><td>4</td><td>It wouldn't suds and couldn't foam.</td></tr>
    </table>
    So what exactly is missing - another colour attribute on the first td element or a colgroup or something else?
    So long, and thanks for all the fish.

  10. #10
    Join Date
    Nov 2013
    Posts
    382

    Default

    What I would like is to set an attribute for a specific cell:

    <table border="3" colour="blue">
    <tr><td>1</td><td><font color="purple">Do you remember Grandma's lye soap,</font></td></tr>
    <tr><td>2</td><td><font color="purple">Good for everything in the home.</font></td></tr>
    <tr><td>3</td><td><font color="purple">And the secret was in the scrubbing,</font></td></tr>
    <tr><td>4</td><td><font color="purple">It wouldn't suds and couldn't foam.</font></td></tr>
    </table>

  11. #11
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Okay, let's check up our toolbox:

    • Add XML allows to build flat XML row reprasentations, i.e. a sequence of "field" elements with optional attributes wrapped up in a "row" element.
    • XML Join allows to insert multiple XML document fragments into a single target document at a specified insertion point.
    • XML Output is an Output step in the first place, writing an XML document to a file, with or without an XML declaration. On second glance it packs "Add XML" features minus attribute handling. Finally, "XML Join" is mimicked, but with a fixed insertion point.

    So what's your use-case again? You want to add an attributed child element to an XML document fragment (previously built with "Add XML").
    Well, there seems to be no straight forward way to achieve this with the XML steps at hand: You can insert multiple elements into a single document, but not a single element into multiple document fragments.

    What else can we do?
    Treating markup as an ordinary string in a "Replace in string" step will provide the intended result, but it's unprofessional.
    With no other suitable step to use, we must resort to scripting.
    (I might be able to design some clumsy solution involving a job, additional transformations, but I don't care to because there is a limit to avoiding scripting)
    I chose to replace the "Add XML" step responsible for building the row markup with a MJSV step.
    Attached Files Attached Files
    So long, and thanks for all the fish.

  12. #12
    Join Date
    Nov 2013
    Posts
    382

    Default

    Thanks! That made the trick.

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.