有没有办法使用一份水晶报告发送多份发票报告电子邮件。
我面临的问题就是我必须为每个用户发送多封电子邮件。
提前致谢。 阿贾伊
答案 0 :(得分:0)
好吧,我只是(FIO)想出来但是生成报告并保存到本地驱动器 而不是发送电子邮件给你,这是时间消耗。
// cs文件方法。
//0. Setting Up controller
OpsManagementController OM = new OpsManagementController();
//1. Getting Users List:
var result = OM.GetUsersforInvoice();
//2. Creating folder for Invoices:
string folderName = @"D:\Google Drive\MonthlyInvoices";
string fileName = ("Invoices_" + DateTime.Now.ToString("dd-MM-yyyy").ToString());
string pathString = System.IO.Path.Combine(folderName, fileName);
System.IO.Directory.CreateDirectory(pathString);
//3. Generating invoices by user name:
for (int i = 0; i < result.UserDetail.Count; i++)
{
var userId = result.UserDetail[i].UserID;
var userName = result.UserDetail[i].FullName;
userName = userName.Replace(@"C\O", "CO");
userName = userName.Replace(@"C/O", "CO");
report2.SetParameterValue("UserID", result.UserDetail[i].UserID);
report2.ExportToDisk(ExportFormatType.PortableDocFormat, "D:/Google Drive/MonthlyInvoices/" + fileName + "/" + userName + ".pdf");
}
如果您需要帮助,请联系。