void DownloadDoRelatorio(byte[] relatorio, string nome, Suite.Relatorio.TiposDeRelatorios tipoDeRelatorio) {
Response.Buffer = true; Response.Clear(); Response.ContentType = "application/force-download"; Response.AddHeader("content-disposition", "attachment; filename=" + Server.UrlDecode(nome) + Suite.Relatorio.Relatorio3V.IdentificarExtensao(tipoDeRelatorio)); long tamanhoRestante = relatorio.Length; Response.AddHeader("Content-Length", tamanhoRestante.ToString());
Response.OutputStream.Write(relatorio, 0, ((int)relatorio.Length));
//Response.Flush();
HttpContext.Current.Response.Flush(); HttpContext.Current.Response.SuppressContent = true; HttpContext.Current.ApplicationInstance.CompleteRequest(); HttpContext.Current.Response.End();