public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { MyReport rpt = new MyReport(); rpt.Site = this.Site; return(rpt); }
private void Window_Loaded(object sender, RoutedEventArgs e) { MyReport rp = new MyReport(); rp.Load(@"MyReport.rep"); viewer.ViewerCore.ReportSource = rp; }
private void btnConferenciaEstoque_Click(object sender, EventArgs e) { try { espere = new Espere(); espere.Start(MostrarMensagemEspera); string fileName = "estoqueConferencia.rdlc"; RelatorioEstoqueConferenciaRepositorio estoqueConferenciaRepositorio = new RelatorioEstoqueConferenciaRepositorio(); var table = estoqueConferenciaRepositorio.GetRelatorioConferencia(); MyReport report = new MyReport(table, fileName.GetFullPath(), "EstoqueConferencia", ProcessingMode.Local); report.GerarRelatoriosComParametrosEQueryDefinidosNaQueryPDF(new System.Collections.Generic.List <ReportParameter> { new ReportParameter("NomeConf", Usuarios.NomeCompletoStatic) }); espere.CancelarTask(); if (espere.Cancel.IsCancellationRequested) { frmEspera?.Close(); } } catch (CustomException error) { DialogMessage.MessageFullComButtonOkIconeDeInformacao(message: error.Message, title: "Aviso"); } catch (Exception error) { SaveErroInTxt.RecordInTxt(error, this.GetType().Name); DialogMessage.MessageFullComButtonOkIconeDeInformacao(message: error.Message, title: "Aviso"); } finally { espere.CancelarTask(); if (espere.Cancel.IsCancellationRequested) { frmEspera?.Close(); } } }
private void btnRelatorioCompra_Click(object sender, EventArgs e) { try { espere = new Espere(); espere.Start(MostrarMensagemEspera); _DbContext banco = new _DbContext(); string fileName = "rpvCompras.rdlc"; RelatorioCompraRepositorio relatorio = new RelatorioCompraRepositorio(); var table = relatorio.GerarRelatorioDeVendas(); MyReport report = new MyReport(table, fileName.GetFullPath(), "Compras", ProcessingMode.Local); report.GerarRelatoriosComParametrosDefinidosNaQueryPDF(); espere.CancelarTask(); if (espere.Cancel.IsCancellationRequested) { frmEspera?.Close(); } } catch (CustomException error) { DialogMessage.MessageFullComButtonOkIconeDeInformacao(message: error.Message, title: "Aviso"); } catch (Exception error) { SaveErroInTxt.RecordInTxt(error, this.GetType().Name); DialogMessage.MessageFullComButtonOkIconeDeInformacao(message: error.Message, title: "Aviso"); } finally { espere.CancelarTask(); if (espere.Cancel.IsCancellationRequested) { frmEspera?.Close(); } } }