我有多个Rdlc报告,我想通过一个单击的事件将这些报告导出到一个Excel工作表中。我怎样才能做到这一点?
请参阅以下代码,该代码仅将一个rdlc报告转换为excel
private void ExportReport(string exportTo)
{
if (objMaster.Current == null || objMaster.Current.Id == 0) return;
long id = objMaster.Current.Id;
frmInvoiceReport frm = new frmInvoiceReport();
// frm.HasSplitByDept = chkSplitByDept.Checked;
frm.HasSplitByField = ddlSplitBy.Text;
frm.ObjInvoice = objMaster.Current;
frm.ExportFileType = exportTo;
var list = General.GetQueryable<vu_Invoice>(a => a.Id == id).OrderBy(c => c.PickupDate).ToList();
int count = list.Count;
frm.DataSource = list;
frm.GenerateReport();
frm.ExportReport(objMaster.Current.InvoiceNo, exportTo);
}