Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Sending a Report via email using C#

431 views14th February 2025C++ dashboard query dynamic postioning email ScriptMemory
5
Amber Rowe [DevOps Advocate]435 13th February 2025 2 Comments

Hello!

I’m trying to create a basic script that emails a DataMiner dashboard to a non-specfic person.

When I execute the script, I recive an email with the correct name and message however I don’t see the dashboard that I’m trying to link to.

I followed the PrepareMailReport and SendReport documentation.

I have included below both the script and the results of it. The results do not change whether the dashboard name is a valid dahboard or not.

Any help on this would be much appreactiated!

Wim Bruynooghe [SLC] [DevOps Advocate] Posted new comment 14th February 2025
Amber Rowe [DevOps Advocate] commented 13th February 2025

The code in text form:

namespace SendEmailReportScript_2
{
using System;
using Skyline.DataMiner.Automation;
/// <summary>
/// Represents a DataMiner Automation script.
/// </summary>
public class Script
{
/// <summary>
/// The script entry point.
/// </summary>
public void Run(IEngine engine)
{
if (engine is null)
{
throw new ArgumentNullException(nameof(engine));
}
ScriptParam myReportParam = engine.GetScriptParam("Report Name");
ScriptParam myEmailParam = engine.GetScriptParam("Email Address");

MailReportOptions reportOptions = engine.PrepareMailReport(myReportParam.Value);

EmailOptions emailOptions = new EmailOptions
{
Title = $"Statistics Report For {myReportParam.Value}",

Message = "Report has been generated",

TO = myEmailParam.Value,

SendAsPlainText = true
};

reportOptions.SetMailOptions(emailOptions);
engine.SendEmail(emailOptions);
}
}
}

Wim Bruynooghe [SLC] [DevOps Advocate] commented 14th February 2025

Can you confirm if the "report name" contains the full name of the dashboard (including any parent folder of the dashboard with the name, separated with "/")?

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Matthias Declerck [SLC] [DevOps Advocate]2.75K Posted 13th February 2025 4 Comments

Hi Amber,

In Automation scripts, you can define an action called Email, which should also work.
Example:

Matthias Declerck [SLC] [DevOps Advocate] Posted new comment 13th February 2025
Amber Rowe [DevOps Advocate] commented 13th February 2025

Hi Matthias! I am aware of this feature however, when doing it via the Actions method you cannot put a varible/placeholder in the "To" section.

And therefore I have to do it via C# so I can make the recipient dynamic instead of fixed.

So, do you know if there is a c# solution for including reports/dashboards in the email?

Amber Rowe [DevOps Advocate] commented 13th February 2025

I also need what report to send to be dynamic and that will be defined in Visio Execute Shape Data.

Matthias Declerck [SLC] [DevOps Advocate] commented 13th February 2025

I'm not familiar with that part, but I believe I can direct you to this same question: https://community.dataminer.services/question/how-to-send-a-by-code-created-dashboard-as-a-report-via-email/

Matthias Declerck [SLC] [DevOps Advocate] commented 13th February 2025

Hi Amber, This is an additional notification to tell you I edited the previous link.
Correct link is https://community.dataminer.services/question/how-to-send-a-by-code-created-dashboard-as-a-report-via-email/

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs