private void Button_Click(object sender, RoutedEventArgs e) { try { Report rp = new Report(); rp.LoadFromFile("GPS.rep"); rp.Params["EMPRESA"].Value = "T2TI.COM"; rp.Params["PERIODOAPURACAO"].Value = dpPeriodoApuracao.Text; rp.Params["DATAVENCIMENTO"].Value = dpVencimento.Text; rp.Params["CODIGORECEITA"].Value = textBoxCodReceita.Text; rp.Params["NUMEROREFERENCIA"].Value = textBoxNumRef.Text; rp.Params["VALORPRINCIPAL"].Value = textBoxVlrPrincipal.Text; rp.Params["VALORMULTA"].Value = textBoxMulta.Text; rp.Params["VALORJURO"].Value = textBoxJuros.Text; rp.Params["VALORTOTAL"].Value = textBoxTotal.Text; rp.AsyncExecution = false; PrintOutWinForms prw = new PrintOutWinForms(); prw.Preview = true; prw.SystemPreview = false; prw.ShowPrintDialog = false; prw.Print(rp.MetaFile); } catch (Exception ex) { throw ex; } }
private void gerarDarf() { try { Report rp = new Report(); rp.LoadFromFile("DARF.rep"); rp.Params["EMPRESA"].Value = "T2TI.COM"; rp.Params["PERIODOAPURACAO"].Value = dpPeriodoApuracao.Text; rp.Params["DATAVENCIMENTO"].Value = dpVencimento.Text; rp.Params["CODIGORECEITA"].Value = textBoxCodReceita.Text; rp.Params["NUMEROREFERENCIA"].Value = textBoxNumRef.Text; rp.Params["VALORPRINCIPAL"].Value = textBoxVlrPrincipal.Text; rp.Params["VALORMULTA"].Value = textBoxMulta.Text; rp.Params["VALORJURO"].Value = textBoxJuros.Text; rp.Params["VALORTOTAL"].Value = textBoxTotal.Text; rp.AsyncExecution = false; PrintOutWinForms prw = new PrintOutWinForms(); prw.Preview = true; prw.SystemPreview = false; prw.ShowPrintDialog = false; prw.Print(rp.MetaFile); } catch (Exception ex) { throw ex; } /* PROBLEMAS NO OCX * try * { * ReportManX rp = new ReportManX(); * * rp.filename = "DARF.rep"; * rp.SetParamValue("EMPRESA", "T2TI.COM"); * rp.SetParamValue("PERIODOAPURACAO", dpPeriodoApuracao.Text); * rp.SetParamValue("DATAVENCIMENTO", dpVencimento.Text); * rp.SetParamValue("CODIGORECEITA", textBoxCodReceita.Text); * rp.SetParamValue("NUMEROREFERENCIA", textBoxNumRef.Text); * rp.SetParamValue("VALORPRINCIPAL", textBoxVlrPrincipal.Text); * rp.SetParamValue("VALORMULTA", textBoxMulta.Text); * rp.SetParamValue("VALORJURO", textBoxJuros.Text); * rp.SetParamValue("VALORTOTAL", textBoxTotal.Text); * rp.Execute(); * * } * catch (Exception ex) * { * }*/ }
private void btGerar_Click(object sender, RoutedEventArgs e) { try { Report rp = new Report(); rp.LoadFromFile("DFC.rep"); rp.Params["EMPRESA"].Value = "T2TI.COM"; rp.Params["PAR_PERIODO"].Value = textBox1.Text; rp.AsyncExecution = false; PrintOutWinForms prw = new PrintOutWinForms(); prw.Preview = true; prw.SystemPreview = false; prw.ShowPrintDialog = false; prw.Print(rp.MetaFile); } catch (Exception ex) { throw ex; } /* * try * { * string NomeArquivo = "DFC.rep"; * // * string parTITULORELATORIO = "Relatório - DFC"; * string parTITULOSOFTHOUSE = "T2Ti.COM"; * string parTITULORODAPE = "T2Ti Tecnologia da Informação Ltda. - (61)3042.5277"; * // * string ConsultaSQL = ""; * // * string ConteudoServidor = NomeArquivo + "|" + ConsultaSQL + "|" + parTITULORELATORIO + "|" + parTITULOSOFTHOUSE + "|" + parTITULORODAPE; * * ReportManX rp = new ReportManX(); * * rp.GetRemoteParams("localhost", 3060, "Admin", "", "T2Ti", NomeArquivo); * rp.SetParamValue("PAR_PERIODO", textBox1.Text); * rp.ExecuteRemote("localhost", 3060, "Admin", "", "T2Ti", ConteudoServidor); * } * catch (Exception ex) * { * throw ex; * } */ }