Send data from datagridview to reportview

0

I need a help, I have a datagridview and I need to play the data for the reportviwer report, I need a help to do this, I did not do it directly from the datagridviwer.

Follow my code that loads the datagridviwer.

public void Saldogrid()
    {
        try
        {
            SqlCommand saldo = new SqlCommand("usp_EstoqueSaldo", conexaoDADOADV(true));
            saldo.Parameters.AddWithValue("@TIPO", this.cbx_Tipo.Text);
            saldo.Parameters.AddWithValue("@LOCAL", this.cbx_local.Text);
            saldo.CommandType = CommandType.StoredProcedure;
            saldo.ExecuteNonQuery();

            SqlDataAdapter dados = new SqlDataAdapter(saldo);
            DataTable dtLista = new DataTable();
            dados.Fill(dtLista);

            dgw_Estoque.DataSource = dtLista;

            dgw_Estoque.Columns["B2_COD"].HeaderText = "CÓDIGO";
            dgw_Estoque.Columns["B1_DESC"].HeaderText = "DESCRIÇÃO";
            dgw_Estoque.Columns["B1_TIPO"].HeaderText = "TIPO PROD.";
            dgw_Estoque.Columns["B2_LOCAL"].HeaderText = "ARMAZÉM";
         }
        catch
        {
            MessageBox.Show("Não exstem dados digitados para a consulta, por favor verificar!!!");
            return;
        }

    }
    
asked by anonymous 27.02.2018 / 19:02

0 answers