Я хочу отправить электронное письмо в виде вложения pdf без сохранения/экспорта его где-нибудь из просмотра телериков, но я не могу найти способ.Отправить личное сообщение от telerik report viewer
Также, когда я нахожусь в режиме отладки и просматриваю конструктор, я вижу эту кнопку, а свойства не имеют ничего для писем.
Когда я запускаю проект в браузере эта кнопка не показывает. Кто-нибудь знает почему?
Я попытался создать код с этим кодом, но не смог преобразовать отчет в pdf из своего кода.
protected void RadButton1_Click(object sender, EventArgs e)
{
string type = Request.Params["type"];
string no = Request.Params["no"];
string stat = Request.Params["stat"];
//Session["compcode"] = Request.Params["compcode"];
var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = new Reports.Report1();
instanceReportSource.Parameters.Add("docno", no);
instanceReportSource.Parameters.Add("doctype", type);
instanceReportSource.Parameters.Add("docstat", stat);
try
{
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();
// Create a new mail item.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
// Set HTMLBody.
//add the body of the email
oMsg.HTMLBody = "Hello, Jawed your message body will go here!!";
//Add an attachment.
String sDisplayName = "MyAttachment";
int iPosition = (int)oMsg.Body.Length + 1;
int iAttachType = (int)Outlook.OlAttachmentType.olByValue;
//now attached the file
Outlook.Attachment oAttach = oMsg.Attachments.Add("here must be the report as pdf", iAttachType, iPosition, sDisplayName);
//Subject line
oMsg.Subject = "Your Subject will go here.";
// Add a recipient.
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
// Change the recipient in the next line if necessary.
Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add("[email protected]");
oRecip.Resolve();
// Send.
oMsg.Send();
// Clean up.
oRecip = null;
oRecips = null;
oMsg = null;
oApp = null;
}//end of try block
catch (Exception ex)
{
string ep = ex.ToString();
}//end of catch
}
Это не помогает мне, не ясно, как создать пользовательскую панель инструментов. – marios
Вы можете создать пользовательскую панель инструментов, переопределив стиль для ReportViewer TargetType. Я бы рекомендовал искать блоги Telerik для примера используемой версии ReportViewer. – Bradley