如何将多个rdlc报告导出为ex​​cel oneclicked

时间:2016-06-30 17:51:03

标签: c# winforms export-to-excel rdlc

我有多个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);
    }

0 个答案:

没有答案