本文整理汇总了C#中ReportViewer.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# ReportViewer.Dispose方法的具体用法?C# ReportViewer.Dispose怎么用?C# ReportViewer.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReportViewer
的用法示例。
在下文中一共展示了ReportViewer.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportarXLS
protected void ExportarXLS()
{
ReportViewer rvExporter = new ReportViewer();
rvExporter.ProcessingMode = ProcessingMode.Local;
rvExporter.LocalReport.ReportPath = Server.MapPath(@"~\Reports\ListadeCompras.rdlc");
rvExporter.LocalReport.DataSources.Add(new ReportDataSource("Lista", GetDados()));
rvExporter.LocalReport.Refresh();
Resultado resultado = new Resultado();
Ped_ItemFacade oPedFacade = new Ped_ItemFacade();
int CategoriaID = Convert.ToInt32(Request.QueryString["categoriaid"]);
int CC_ID = Convert.ToInt32(Request.QueryString["CC"]);
resultado = new Ped_ItemFacade().AtualizaProcessoCompra(CategoriaID, CC_ID);
////Exportar para PDF
string mimeType;
string encoding;
string fileNameExtension;
Warning[] warnings;
string[] streamids;
byte[] exportBytes = rvExporter.LocalReport.Render("Excel", null, out mimeType, out encoding, out fileNameExtension, out streamids, out warnings);
Response.Buffer = true;
Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.{1}", DateTime.Now.ToString("yyyy-MM-dd") + "Planilha Processo de Compra Numero " + resultado.Id.ToString().PadLeft(6,'0') , fileNameExtension));
Response.BinaryWrite(exportBytes);
Response.Flush();
Response.End();
rvExporter.Dispose();
}