예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            RelBalanco rpt = new RelBalanco();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void BtnImprimir_Click(object sender, EventArgs e)
        {
            string sSql = "SELECT T4.Grupo,T3.Referencia,T3.Descricao,T1.Qtde,T1.SALDOESTOQUE,T2.* FROM BalancoItens T1" +
                          " LEFT JOIN Balanco T2 ON (T2.Id_Balanco=T1.Id_Balanco)" +
                          " LEFT JOIN Produtos T3 ON (T3.Id_Produto=T1.Id_Produto)" +
                          " LEFT JOIN GRUPOProduto T4 ON (T4.ID_GRUPO=T3.Id_Grupo)" +
                          " WHERE T1.ID_BALANCO=" + MvBalanco.IdBalanco.ToString();

            sSql = sSql + " ORDER BY T4.GRUPO,T3.DESCRICAO";

            BtnImprimir.Enabled = false;
            FrmRelatorios FrmRel = new FrmRelatorios();

            Relatorios.RelBalanco RelMapa = new Relatorios.RelBalanco();
            DataSet TabRel = new DataSet();

            TabRel = Controle.ConsultaTabela(sSql);
            RelMapa.Database.Tables[0].SetDataSource(TabRel.Tables[0]);
            FrmRel.cryRepRelatorio.ReportSource = RelMapa;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)(RelMapa.Section2.ReportObjects["LblFilial"])).Text = FrmPrincipal.LstFilial.Text.Trim();
            ((CrystalDecisions.CrystalReports.Engine.TextObject)(RelMapa.Section5.ReportObjects["LblRodaPe"])).Text = FrmPrincipal.Rel_RodaPe;
            FrmRel.ShowDialog();
            BtnImprimir.Enabled = true;
        }