Answers.Body: <p>Yes, if the problem is the stdout being sent to cron, I can avoid it appending "1>/dev/null 2>/dev/null" to the end of the command in the cron script called. This makes both stdout and stderr to be sent to null.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-14T14:17:02.350Z
Answers.Text: This is odd behaviour. Would it not make more sense to have a parameter configurable via the UI to enable/disable output via stdout?
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T18:03:47.007Z
Answers.LastActivityDate: 2015-06-11T18:03:47.007Z
Answers.UserDisplayName: diegov
Body: <p>When configuring a Mail Report to be sent via Scheduled Jobs, using 'mail_report' API call, I need to pass the 'instanceId' and 'format' parameters. </p>
  
  <p>For the 'format' parameter I have the options 'csv' (to output the report as a CSV file), 'print' (to output the report as printer-friendly HTML) or if I ignore the parameter, I have a PDF report.</p>
  
  <p>Also, I can input a sendmail=0, that tells the job NOT to email the report, so I can use this in combination with print or csv format to only write report to stdout.</p>
  
  <p>If I use the 'format=print', the job always write to stdout. My problem is that stdout, in this case, is the server's cron, what makes cron send an email to the administrator with the report, what I don't want to happen. Is is possible to tell the job <strong>NOT</strong> to write the report to stdout?</p>
  
Tags: <civireport><cron-job>
Title: mail_report format parameter
ThreadText: # mail_report format parameter
  
  (Asked by: username_0 on 2015-06-11)
  
  When configuring a Mail Report to be sent via Scheduled Jobs, using 'mail\_report' API call, I need to pass the 'instanceId' and 'format' parameters.
  
  For the 'format' parameter I have the options 'csv' (to output the report as a CSV file), 'print' (to output the report as printer-friendly HTML) or if I ignore the parameter, I have a PDF report.
  
  Also, I can input a sendmail=0, that tells the job NOT to email the report, so I can use this in combination with print or csv format to only write report to stdout.
  
  If I use the 'format=print', the job always write to stdout. My problem is that stdout, in this case, is the server's cron, what makes cron send an email to the administrator with the report, what I don't want to happen. Is is possible to tell the job **NOT** to write the report to stdout?
  
  **Tags:** civireport, cron-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-06-11. Score: 2
  
  Yes, if the problem is the stdout being sent to cron, I can avoid it appending "1>/dev/null 2>/dev/null" to the end of the command in the cron script called. This makes both stdout and stderr to be sent to null.
  
  > **Comments:**
  > **username_1**: This is odd behaviour. Would it not make more sense to have a parameter configurable via the UI to enable/disable output via stdout?  
  
  ---
  
  