Код: Выделить всё
protected virtual byte[] RenderizarRelatorio(string Formato)
{
ReportViewer rvwDinamico = new ReportViewer();
this.m_rdl.Position = 0;
rvwDinamico.LocalReport.LoadReportDefinition(m_rdl);
if (this.Parametros != null)
{
rvwDinamico.LocalReport.SetParameters(this.Parametros);
}
foreach (KeyValuePair DataSource in this.DataSourceDictionary)
{
rvwDinamico.LocalReport.DataSources.Add(new ReportDataSource(DataSource.Key, DataSource.Value));
}
rvwDinamico.Visible = false;
return rvwDinamico.LocalReport.Render(Formato);
}
Код: Выделить всё
HostingEnvironment.QueueBackgroundWorkItem(async token =>
{
ResultadoConsulta = await RealizaConsulta(Parametros);
iExportacaoRelatorio = iRelatorioGerencial.GerarExcel(ResultadoConsulta, colunasGrid);
byte[] bytesExcel = iExportacaoRelatorio.ObterRelatorio();
});
Я также пробовал изменить метод выполнения, чтобы использовать Task.Run вместо QueueBackgroundWorkItem, но начал получать ошибку:
Код: Выделить всё
ReportPublishingException: The Value expression for the textrun ‘txt_18_ValorAprovado.Paragraphs[0].TextRuns[0]’ contains a colon or a line terminator. Colons and line terminators are not valid in expressions.
Может ли кто-нибудь мне помочь?
Подробнее здесь: https://stackoverflow.com/questions/793 ... ndworkitem
Мобильная версия