예제 #1
0
        private void buttonX2_Click_1(object sender, EventArgs e)
        {
            object dss;

            dss = dataGridView1.DataSource;
            dataGridView1.DataSource = dss;


            Mostrar_estado_cuenta mostrar = new Mostrar_estado_cuenta();

            ReportDataSource st = new ReportDataSource("DataSet1", dss);

            mostrar.reportViewer1.LocalReport.DataSources.Clear();
            mostrar.reportViewer1.LocalReport.DataSources.Add(st);
            mostrar.reportViewer1.RefreshReport();
            mostrar.ShowDialog();
            mostrar.reportViewer1.Reset();
        }
예제 #2
0
        public void reimprimir()
        {
            DataSet tabla    = new DataSet();
            string  comandos = " select *from vista_estado_cuenta";

            //int pas = dataGridView1.CurrentCell.RowIndex;
            //textBox1.Text = Convert.ToString(dataGridView1.Rows[pas].Cells[0].Value);

            comandos += " where  codigo='" + codcli.Text.Trim() + "'";

            tabla = utilidades.utility.conectarsupermercado(comandos);

            //otro
            Mostrar_estado_cuenta mostrar = new Mostrar_estado_cuenta();

            ReportDataSource st = new ReportDataSource("DataSet1", tabla.Tables[0]);

            mostrar.reportViewer1.LocalReport.DataSources.Clear();
            mostrar.reportViewer1.LocalReport.DataSources.Add(st);
            mostrar.reportViewer1.RefreshReport();
            mostrar.ShowDialog();
            mostrar.reportViewer1.Reset();
        }