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';
$.ajax({
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("promakswebcms@gmail.com", "scemal@promaks.com.tr", "Test Report", "Report Is Attached");
msg.Attachments.Add(attachment);
SmtpClient client = new SmtpClient();
client.Send(msg);
}
but report1 is object but its not getting report so in mail attachment report is empty!!!
Help me please