Fórum Metodo - Render #545566
13/02/2016
0
O código é esse:
try
{
//Geração do metodo visualizador do Relatorio
ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.LocalReport.ReportEmbeddedResource = "Apresentacao.LinkReport.rdlc";
//Parametros do Relatorio
List<ReportParameter> listReportParameter = new List<ReportParameter>();
listReportParameter.Add(new ReportParameter("Nome", txtNomeCli.Text));
reportViewer.LocalReport.SetParameters(listReportParameter);
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
byte[] bytePDF = reportViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
FileStream fileSteamPDF = null;
string fileName = Path.GetTempPath() + "RelatorioLiNk" + DateTime.Now.ToString("dd_MM-HH_mm_ss") + ".pdf";
fileSteamPDF = new FileStream(fileName, FileMode.Create);
fileSteamPDF.Write(bytePDF, 0, bytePDF.Length);
fileSteamPDF.Close();
Process.Start(fileName);
this.Close();
}
catch (Exception exe)
{
MessageBox.Show("Não Foi Possivel Gerar O Relatório." + " " + exe.Message, "RELATORIO NÃO GERADO", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Savio Strech
Curtir tópico
+ 0Posts
13/02/2016
Joel Rodrigues
Gostei + 0
13/02/2016
Savio Strech
Gostei + 0
13/02/2016
Joel Rodrigues
Gostei + 0
14/02/2016
Savio Strech
Gostei + 0
14/02/2016
Savio Strech
Gostei + 0
19/02/2016
Savio Strech
Gostei + 0
21/02/2016
Savio Strech
Gostei + 0
22/02/2016
Savio Strech
Não aparece.
Gostei + 0
27/02/2016
Savio Strech
Gostei + 0
27/02/2016
Savio Strech
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)