1
How do I create reports by Cristal Reports, using a Dataset that contains more than one Table? With a table I can work normal, but when I insert more than one table the result of the Report comes blank. The only thing I did after the connection was select the Data Fields and paste in the report.
Follows images:
Also follows my flashy report by the MVC:
public ActionResult relatorio_pdf()
{
connectionRateio.ConectarBanco(modelLoginRateio);
DataTable dataTable = new DataTable();
var query = @"SELECT * FROM MYTABLE MT INNER JOIN MYOTHERTABLE MOT ON MT.ID = MOT.ID";
var command = new OracleCommand(query, connectionRateio.connection);
var dataAdapter = new OracleDataAdapter(command);
dataAdapter.Fill(dataTable);
ReportClass rptH = new ReportClass();
rptH.FileName = Server.MapPath("~/Views/Relatorios/relatorio.rpt");
rptH.Load();
rptH.SetDataSource(dataTable);
Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
connectionRateio.FecharConexaoBanco();
return File(stream, "application/pdf");
}
It doesn’t hurt to ask: If you make one SELECT * FROM MYTABLE MT INNER JOIN MYOTHERTABLE MOT ON MT.ID = MOT.ID in the database it returns the results?
– Edgar Muniz Berlinck
Rs... Yes, yes. Query is right.
– Matheus Bessa