Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Mail step in transformation. It doesn't attach files

  1. #1
    Join Date
    May 2016

    Default Mail step in transformation. It doesn't attach files

    Hi all,
    I'm trying to run a transformation that executes a report exporting the result to a file (csv, for example) and then sending a mail with the file exported attached to it. To send the mail I have used the Mail step inside the transformation, instead of creating a job to run the transformation and then send the mail.
    My problem is I'm not able to attach the file generated to the mail, the file is generated correctly, but the mail step, instead of attaching the file as is, it is looking for the file I say to attach in the Content fieldname and then creates a text file with the Content fieldname and attaches it to the mail, for example, if a say that the Report output is the file /home/AnaGH/test/Test.csv, the mail sent has a file Test.csv (the value I put in the Filename fieldname parameter) that is a text file with /home/AnaGH/test/Test.csv in it, instead of the report output that the Pentaho Reporting Output step generates.
    I'm attaching an example of what I'm trying to achieve, to make it work in your PC you have to set the mail parameters and maybe adjust the Modified Java Script Value step to get rid of the initial characters, the substr function varies depending on your OS, in Linux I need to trim the first 7 characters, in Windows you need to trim the first 6, I don't know in OS X.
    Edit: I've realized you'll also need to clean the Logging tab in the properties of the transformation, I've set to store the logging messages in a database and you won't have it configured. I'm not going to attach a new file cleaning that information, sorry!

    I'm able to send the mail with the attachment if I use a job, but I would prefer to use just a transformation if possible.

    Attached Files Attached Files
    Last edited by Ana GH; 02-13-2017 at 02:34 PM.

  2. #2
    Join Date
    Jun 2012


    I'm sure there's a misunderstanding.

    If you want to attach one or more files, you use configuration section "Attached filenames" i.e. "Names of files to be attached".
    In your case you would enable option "Dynamic filenames" and set "Filename field" to Report_Output.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    May 2016


    Thanks a lot!, marabu
    I was sure it was something stupid I was doing wrong. The option Dynamic filenames mislead me, as I had a fixed filename I thought it was the options above the ones I had to select.

Tags for this Thread

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.