I am trying to create a web report in an .aspx page, the report template is a .rdlc file. When I run the app, I fill a bar chart with the same Datasource I use for the report, however my report gets stuck on loading calling the app again as if it were refreshing the page:
The code with which I fill the report is as follows:
DataTable datos = new DataTable();
string cs = ConfigurationManager.ConnectionStrings["OCEntities"].ConnectionString;
using (SqlConnection con = new SqlConnection(cs))
{
SqlCommand comm = new SqlCommand("select * from Vista_ReporteCompras ", con);
SqlDataAdapter da = new SqlDataAdapter(comm);
da.Fill(datos);
}
visor.ProcessingMode = ProcessingMode.Local;
visor.LocalReport.ReportPath = Server.MapPath("Plantilla.rdlc");
ReportDataSource datasource = new ReportDataSource("Datos", datos);
visor.LocalReport.DataSources.Clear();
visor.LocalReport.DataSources.Add(datasource);
cargar = false;
Do you have an idea how to fix it?
According to this answer on Stack Overflow , it's possible that your error is because you haven't implemented the
PostBack
in your source code.Example: