private void ImpNotaSaida_Load(object sender, System.EventArgs e) { _dados.TableName = "Nota saída"; this.rvNotaSaida.LocalReport.DisplayName = "Nota de saída"; this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"razaosocial", Estabelecimento.Nome, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"endereco", $"{Estabelecimento.Rua}, {Estabelecimento.Numero} {Estabelecimento.Complemento} - {Estabelecimento.Bairro}", true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"telefone", fa.FormataTel(Estabelecimento.Telefone), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"email", fa.FormataTel(Estabelecimento.Email), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"numero", _notaFiscalPropria.NotaFiscalPropriaID.ToString(), true)); if (_notaFiscalPropria.Vendedor?.PessoaID > 0) { this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"vendedor_nome", _notaFiscalPropria.Vendedor.Nome.ToString(), true)); } else { this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"vendedor_nome", "", true)); } this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_cod", _notaFiscalPropria.Pessoa.PessoaID.ToString(), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_nome", _notaFiscalPropria.Pessoa.Nome.ToString(), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_endereco", _notaFiscalPropria.Pessoa.Rua + _notaFiscalPropria.Pessoa.Numero, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_cidade", _notaFiscalPropria.Pessoa.Cidade.Nome, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_bairro", _notaFiscalPropria.Pessoa.Bairro, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_cep", _notaFiscalPropria.Pessoa.Cep, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_email", _notaFiscalPropria.Pessoa.Email, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_doc", _notaFiscalPropria.Pessoa.TipoPessoa == "F" ? fa.FormataCPF(_notaFiscalPropria.Pessoa.CpfCnpj) : fa.FormataCNPJ(_notaFiscalPropria.Pessoa.CpfCnpj), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_uf", _notaFiscalPropria.Pessoa.Cidade.Estado.Uf, true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"cliente_telefone", fa.FormataTel(_notaFiscalPropria.Pessoa.Telefone), true)); this.rvNotaSaida.LocalReport.SetParameters(new ReportParameter($"data_saida", _notaFiscalPropria.DataEntradaSaida.ToString(), true)); this.rvNotaSaida.LocalReport.DataSources.Add(new ReportDataSource("itens", _dados)); this.rvNotaSaida.SetDisplayMode(DisplayMode.PrintLayout); this.rvNotaSaida.RefreshReport(); }
private void ImpOrcamento_Load(object sender, EventArgs e) { _dados.TableName = "Orçamento"; this.rvOrcamento.LocalReport.DisplayName = "Orçamento"; this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"razaosocial", Estabelecimento.Nome, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"endereco", $"{Estabelecimento.Rua}, {Estabelecimento.Numero} {Estabelecimento.Complemento} - {Estabelecimento.Bairro}", true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"telefone", fa.FormataTel(Estabelecimento.Telefone), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"email", fa.FormataTel(Estabelecimento.Email), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"numero", orcamento.OrcamentoID.ToString(), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_cod", orcamento.Pessoa.PessoaID.ToString(), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_nome", orcamento.Pessoa.Nome.ToString(), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_endereco", orcamento.Pessoa.Rua + orcamento.Pessoa.Numero, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_cidade", orcamento.Pessoa.Cidade.Nome, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_bairro", orcamento.Pessoa.Bairro, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_email", orcamento.Pessoa.Email, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_doc", orcamento.Pessoa.TipoPessoa == "F" ? fa.FormataCPF(orcamento.Pessoa.CpfCnpj) : fa.FormataCNPJ(orcamento.Pessoa.CpfCnpj), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_uf", orcamento.Pessoa.Cidade.Estado.Uf, true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"cliente_telefone", fa.FormataTel(orcamento.Pessoa.Telefone), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"data_cadastro", orcamento.DataCadastro.ToString(), true)); this.rvOrcamento.LocalReport.SetParameters(new ReportParameter($"data_vencimento", orcamento.DataValidade?.ToString(), true)); this.rvOrcamento.LocalReport.DataSources.Add(new ReportDataSource("dsOrcamento", _dados)); this.rvOrcamento.SetDisplayMode(DisplayMode.PrintLayout); this.rvOrcamento.RefreshReport(); }