This is a migrated thread and some comments may be shown as answers.

send a grid by email

2 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 20 May 2008, 09:32 AM
I need to export the grid to excel  then send a exported excel to client with attachment.how can i do with rad ajax grid or how can save the exported excel to server .

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 20 May 2008, 09:52 AM
Hi Vairam,

Go through the following help document link.
Export from ajaxified grid

Princy.
0
vairam
Top achievements
Rank 1
answered on 20 May 2008, 11:01 AM
Hi Princy
 Yes i can export the grid.But i need to send a grid by email attachment  in excel or pdf fomat.

I have found some thing in telerik forum how to send a report by email likewise i need to send a grid by email.

        void MailReport(Telerik.Reporting.Report report, string from, string to, string subject, string body)
        {
            string mimeType;
            string extension;
            Encoding encoding;

            byte[] reportBytes =
                ReportProcessor.Render("PDF", report, null, out mimeType, out extension, out encoding);
          
            MemoryStream ms = new MemoryStream(reportBytes);
            ms.Position = 0;
           
            Attachment attachment = new Attachment(ms, report.Name + "." + extension);
            MailMessage msg = new MailMessage(from, to, subject, body);
            msg.Attachments.Add(attachment);
            SmtpClient client = new SmtpClient(smptHost);
            client.Send(msg);                       
        }

Tags
Grid
Asked by
vairam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
vairam
Top achievements
Rank 1
Share this question
or