New to Telerik Reoporting

6 posts, 0 answers
  1. Stuart
    Stuart avatar
    3 posts
    Member since:
    Sep 2012

    Posted 01 Feb 2012 Link to this post

      I am new to telerik reporting. I have gone through some of your videos and tutorials. I have some questions regarding what is the best way to use Telerik reporting for my purposes. Hope i get the answers here;

    1. I have a requirement where at the end of each day i need to email invoices to different people(dynamic list) whose email ids should be picked from a table in the database. I understand that we can create invoicing reports in telerik. But i would like to email this report in pdf format to a list of people (and the list of email ids is fetched from the database). Can this be done? if yes, then how. Can you point me in the right direction.

    based on what i have read, I think i should do the following:
    1. Create a report in telerik reporting as a class library
    2. Then create a c# console application which should render the above report into a pdf format and then email to people

    Is this the right way to do it. Is there any other better way where we can automatically achieve this without writing any c# application.

    please an any body help me on this.

  2. Peter
    Peter avatar
    1631 posts

    Posted 01 Feb 2012 Link to this post

    Hello Daniel,

    You have correctly presumed you can export the reports programmatically and send the emails. Generally Telerik Reporting is an embedded reporting solution and doesn't support out of the box batch processing and emailing, however it can be easily implemented. To export a report, you can use the RenderReport method of the ReportProcessor class. This method converts the contents of the report to a byte array in the specified format, which you can then use with other classes such as MemoryStream or FileStream. More information is available in Exporting Report Programmatically help article. 

    All the best,
    the Telerik team

    Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  3. Gerry Connolly
    Gerry Connolly avatar
    16 posts
    Member since:
    Jan 2010

    Posted 19 Jan 2013 Link to this post

    Hi Peter

    I really like Telerik reports, do you know if they are any sample projects or blogs to do the following.
    We have a report that produces statements for customers accounts, we would like to batch email this statement to the individual customers as a PDF.  The customers email address are held in a database.  Programatically, is this possible in Telerik.


  4. Steve
    Steve avatar
    10941 posts

    Posted 21 Jan 2013 Link to this post

    Hello Gerry,

    The help articles that my colleague referred to in previous reply contain all the information you need to export a report programmatically. As for emailing the exported report to your clients, you can refer to this code library: Send Telerik Report as email attachment.

    Kind regards,
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  5. Adil
    Adil avatar
    2 posts
    Member since:
    Mar 2014

    Posted 09 Feb 2016 Link to this post

    I checked the all the posts but i cant find actual solution ??
     Also i read this blog too but it explains very very plain and i download that project that one is now working and its for web form i'm using MVC 
     I think its impossible to send report as attachment in mail
    here i found some thing 
    I'm sending parameters from ajax
         var ident = $('#identCE').val();
        var viewer = $("#reportViewer2").data('telerik_ReportViewer');
        var postData = {
            report1: viewer.reportSource($.extend({}, viewer.reportSource(), { report: "CustomerEnrollment.trdx", parameters: { 'CustomerId': ident } }))
        var url = '../AccountMaint/MailReport';
            url: url,
            type: "POST",
            dataType: 'json',
            data: postData,
            success: function (data) {


    and then catch on MVC controller

            public void MailReport(Telerik.Reporting.Report report1)

                string mimeType;
                string extension;
                Encoding encoding;

                byte[] reportBytes =
                ReportProcessor.Render("PDF", report1, null, out mimeType, out extension, out encoding);

                MemoryStream ms = new MemoryStream(reportBytes);
                ms.Position = 0;

                Attachment attachment = new Attachment(ms, report1.Name + "." + extension);
                MailMessage msg = new MailMessage("", "", "Test Report", "Report Is Attached");
                SmtpClient client = new SmtpClient();


    but report1 is object but its not getting report so in mail attachment report is empty!!!

    Help me please
  6. Stef
    Stef avatar
    3611 posts

    Posted 11 Feb 2016 Link to this post

    Hello Adil,

    The HTML5 Viewer's reportSource does not contain a report instance. The reportSource is a description of the report and the parameters the client wants to use for that report. This information is sent to the Reporting REST service to be handled on the server, where the service creates an instance of the report.
    For more details check How to: Set ReportSource for Report Viewers (HTML5 Viewer).

    In your case you can post the information from the viewer's (string) to your own controller's action. In code you can determine which report to instantiate and export programmatically. Once you have the document's bytes, you can add them as an attachment to an e-mail.

    I hope this information is helpful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top