public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { RptConPDV rpt = new RptConPDV(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { RptConPDV rpt = new RptConPDV(); rpt.Site = this.Site; return rpt; }
public void ImprimirRelPed() { try { //Instancio o FormConsulta FrmConPDV x = (FrmConPDV)_pdv; if (x.rdbped.Checked) { //Instancio o Relatorio RptConPDV objRptConPDV = new RptConPDV(); //Instancio o Dataset COMERCIALDataSet oDataset = new COMERCIALDataSet(); Microsoft.Practices.EnterpriseLibrary.Data.Database db = DatabaseFactory.CreateDatabase(); //Crio a Conexão SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Comercial.Properties.Settings.COMERCIALConnectionString"].ConnectionString); //Abro a conexão sqlcon.Open(); //Recebo a String SQL feita na tela de consulta string StringConnection = x.pesquisar(); SqlDataAdapter dtAdapter = new SqlDataAdapter(StringConnection, sqlcon); //Localizo o datatable criado no dataset dtAdapter.Fill(oDataset, "RelPedido"); objRptConPDV.SetDataSource(oDataset); //Passo parametro para relatorio no caso somente o de pedido tem parametro ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = "PDV"; crParameterFieldDefinitions = objRptConPDV.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["Tipo"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //atribiu o resultado ao CristalReportView crstlRprtVwrRel.DisplayGroupTree = false; crstlRprtVwrRel.ReportSource = objRptConPDV; } else { //Instancio o Relatorio RptConPDV objRptConPDV = new RptConPDV(); //Instancio o Dataset COMERCIALDataSet oDataset = new COMERCIALDataSet(); Microsoft.Practices.EnterpriseLibrary.Data.Database db = DatabaseFactory.CreateDatabase(); //Crio a Conexão SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Comercial.Properties.Settings.COMERCIALConnectionString"].ConnectionString); //Abro a conexão sqlcon.Open(); //Recebo a String SQL feita na tela de consulta string StringConnection = x.pesquisar(); SqlDataAdapter dtAdapter = new SqlDataAdapter(StringConnection, sqlcon); //Localiso o datateble criado no dataset dtAdapter.Fill(oDataset, "RelPedido"); objRptConPDV.SetDataSource(oDataset); //Passo parametro para relatorio no caso somente o de pedido tem parametro ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = "prd"; crParameterFieldDefinitions = objRptConPDV.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["Tipo"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //atribiu o resultado ao CristalReportView crstlRprtVwrRel.DisplayGroupTree = false; crstlRprtVwrRel.ReportSource = objRptConPDV; } } catch (Exception ex) { throw ex; } }
public void ImprimirRelPed() { try { //Instancio o FormConsulta FrmConPDV x = (FrmConPDV)_pdv; if (x.rdbped.Checked) { //Instancio o Relatorio RptConPDV objRptConPDV = new RptConPDV(); //Instancio o Dataset COMERCIALDataSet oDataset = new COMERCIALDataSet(); Microsoft.Practices.EnterpriseLibrary.Data.Database db = DatabaseFactory.CreateDatabase(); //Crio a Conexão SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Comercial.Properties.Settings.COMERCIALConnectionString"].ConnectionString); //Abro a conexão sqlcon.Open(); //Recebo a String SQL feita na tela de consulta string StringConnection = x.pesquisar(); SqlDataAdapter dtAdapter = new SqlDataAdapter(StringConnection, sqlcon); //Localizo o datatable criado no dataset dtAdapter.Fill(oDataset, "RelPedido"); objRptConPDV.SetDataSource(oDataset); //Passo parametro para relatorio no caso somente o de pedido tem parametro ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = "PDV"; crParameterFieldDefinitions = objRptConPDV.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["Tipo"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //atribiu o resultado ao CristalReportView crstlRprtVwrRel.DisplayGroupTree = false; crstlRprtVwrRel.ReportSource = objRptConPDV; } else { //Instancio o Relatorio RptConPDV objRptConPDV = new RptConPDV(); //Instancio o Dataset COMERCIALDataSet oDataset = new COMERCIALDataSet(); Microsoft.Practices.EnterpriseLibrary.Data.Database db = DatabaseFactory.CreateDatabase(); //Crio a Conexão SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["Comercial.Properties.Settings.COMERCIALConnectionString"].ConnectionString); //Abro a conexão sqlcon.Open(); //Recebo a String SQL feita na tela de consulta string StringConnection = x.pesquisar(); SqlDataAdapter dtAdapter = new SqlDataAdapter(StringConnection, sqlcon); //Localiso o datateble criado no dataset dtAdapter.Fill(oDataset, "RelPedido"); objRptConPDV.SetDataSource(oDataset); //Passo parametro para relatorio no caso somente o de pedido tem parametro ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = "prd"; crParameterFieldDefinitions = objRptConPDV.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["Tipo"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //atribiu o resultado ao CristalReportView crstlRprtVwrRel.DisplayGroupTree = false; crstlRprtVwrRel.ReportSource = objRptConPDV; } } catch (Exception ex) { throw ex; } }