Crystal report C#

1 resposta
fabiodurgante
Banco b = new Banco();

DataSet ds = new DataSet();
ds = b.CONSULTA_TIPADO("fabio");

Relatorio rel = new Relatorio();
rel.Criar_Relatorio(ds);

aqui retorna um resultset da consulta no banco tudo certo, quero pegar esse resultset e colocar no Crystal report tentei o seguinte

public void Criar_Relatorio(DataSet ds){
			

      ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(@"H:\\FABIO\\WindowsAplication\\relatorio.xml");
			


ProductsAdapter.Fill(ds);
ProductsReport rpt = new ProductsReport();
rpt.SetDataSource(ds);

CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.DataBind();
}

criei no crystal report orelatorio salvei com o nome relatorio.rpt so que o corre o seguinte erro

H:\FABIO\WindowsAplication\Contato\Contatos\relatorio.cs(31): The type or namespace name ‘ProductsAdapter’ could not be found (are you missing a using directive or an assembly reference?)

H:\FABIO\WindowsAplication\Contato\Contatos\relatorio.cs(32): The type or namespace name ‘ProductsReport’ could not be found (are you missing a using directive or an assembly reference?)

H:\FABIO\WindowsAplication\Contato\Contatos\relatorio.cs(33): The type or namespace name ‘rpt’ could not be found (are you missing a using directive or an assembly reference?)

H:\FABIO\WindowsAplication\Contato\Contatos\relatorio.cs(35): The type or namespace name ‘CrystalReportViewer1’ could not be found (are you missing a using directive or an assembly reference?)

H:\FABIO\WindowsAplication\Contato\Contatos\relatorio.cs(36): The type or namespace name ‘CrystalReportViewer1’ could not be found (are you missing a using directive or an assembly reference?)

1 Resposta

fabiodurgante

RESOLVIDO fazer relatorio pelo CRYSTAL report passando o dataset

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.ReportSource;

using CrystalDecisions.CrystalReports;
ReportDocument cryRpt = new ReportDocument();
        cryRpt.Load(@"H:\\FABIO\\WindowsAplication\\relatorio.rpt");
        cryRpt.SetDataSource(ds.Tables[0]);
         crystalReportViewer1.ReportSource = cryRpt;

aqui cria relatorio pelo resultado da pesquisa

Criado 8 de março de 2010
Ultima resposta 10 de mar. de 2010
Respostas 1
Participantes 1