0
I receive the database query in a Datatable, I need to pass the datatable to a tablix in reportviewer by code, but when I run the tablix returns blank, I searched in several places and did not find an agile method to do this, follow the code...
private void frmRel_Load(object sender, EventArgs e)
{
this.report.RefreshReport();
DataTable dt = RelatoriosModel.PesquisaTodos(); // RETORNA A TABELA DA CONSULTA NO SERVIDOR
ReportDataSource reportDataSource = new ReportDataSource();
this.report.LocalReport.ReportEmbeddedResource = "CifalApp.Logistica.Relatorios.Relatorio.rdlc";
reportDataSource.Name = "DataSet1";
reportDataSource.Value = dt;
this.report.LocalReport.DataSources.Add(reportDataSource);
this.report.RefreshReport();
}
But this tablix is pulling your data from "Dataset1"?
– Leandro Angelo
There is nothing in Dataset1
– thalescifal
And where tablix is pulling the data from to render the report then?]
– Leandro Angelo
That’s the question, I don’t know how to make tablix pull data from datatable, or pass datatable pro tablix, I’m trying to do this without using a typed Dataset, that way above was just for testing
– thalescifal
Then your job starts in assembling the report first and then popular the dataset to display your data. What good is it to send a data set to it if it has no structure waiting for that load?
– Leandro Angelo