5
I need to print the data of a Datagridviewer, which is the products launched in the sale. What is the best way to print this information in the Report? I tried to use the Table component, but I can’t pass the information to him, since he needs to be linked to a Dataset.
One observation is that I have some textbox in the report.rldc that I was able to fill using parameters, but now to print the information of a Datagrid I ended up grabbing.
Here is the constructuor of the form where the report is:
public frmTesteImpressaoVenda(String nomeEmpresa, String enderecoEmpresa, String cnpjEmpresa, String telefoneEmpresa,
String nomeCliente, String cpjCliente, DateTime DataVenda, String Pagamento) {
InitializeComponent();
reportVenda.LocalReport.ReportEmbeddedResource = "GUI.ImpressaoVenda.rdlc";
ReportParameter[] parms = new ReportParameter[8];
parms[0] = new ReportParameter("NomeEmpresa", nomeEmpresa);
parms[1] = new ReportParameter("EnderecoEmpresa", enderecoEmpresa);
parms[2] = new ReportParameter("CnpjEmpresa", cnpjEmpresa);
parms[3] = new ReportParameter("Telefone", telefoneEmpresa);
parms[4] = new ReportParameter("Cliente", nomeCliente);
parms[5] = new ReportParameter("Cpf", cpjCliente);
parms[6] = new ReportParameter("DataVenda", DataVenda.ToString());
parms[7] = new ReportParameter("Pagamento", Pagamento);
reportVenda.LocalReport.SetParameters(parms);
reportVenda.LocalReport.Refresh();
reportVenda.RefreshReport();
}
The code below is the sales form where you pass the parameters to fill in the report.
private void btImprimirTeste_Click(object sender, EventArgs e) {
frmTesteImpressaoVenda impVenda = new frmTesteImpressaoVenda(
CadastroEmpresa.nome_empresa,
CadastroEmpresa.endereco + ", " + CadastroEmpresa.numendereco + " - " + CadastroEmpresa.bairro + " - " + CadastroEmpresa.cidade,
CadastroEmpresa.cnpj,
CadastroEmpresa.telefone,
txtNomeCliente.Text,
lbCpf.Text,
DateTime.Now,
cbTipoPagto.Text
);
impVenda.Show();
}
what you have done, could put?
– Marco Souza