サブレポートをメインレポートに設定したいのですが、サブレポートのデータセットに問題があります。私の主な報告の行動。Reportviewerのサブレポートが機能しません
public ActionResult ExibirRelatorioProgramaSol(FormCollection form)
{
DateTime dtInicial = DateTime.Parse(form["dt_inicio"]);
DateTime dtFinal = DateTime.Parse(form["dt_fim"]);
int idLista = form["ddl_Lista"].ConvertValueForm<int>();
var avaliacao = _appServicoAvaliacaoSetor.ObterAvaliacoes(dtInicial, dtFinal, idLista);
var relatorio = _appServicoAvaliacaoSetor.GerarRelatorioProgramaSol(dtInicial, dtFinal, idLista);
var viewer = new Microsoft.Reporting.WebForms.ReportViewer();
viewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
viewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + "/Report/ReportProgramaSol.rdlc";
viewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(RenderizaSubRelatorioPedido);
viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("ProgramaSol", relatorio.ToList()));
viewer.SizeToReportContent = true;
viewer.Width = System.Web.UI.WebControls.Unit.Percentage(100);
viewer.Height = System.Web.UI.WebControls.Unit.Percentage(100);
ViewBag.ReportViewer = viewer;
return View();
}
私のサブレポートのアクション:
private void RenderizaSubRelatorioPedido(object sender, SubreportProcessingEventArgs e)
{
int idEmpresa = Convert.ToInt32("2");
e.DataSources.Add(new ReportDataSource("empresa",
_appServicoEmpresa.ObterEntidadePor(i => i.Id == idEmpresa)));
}
エラー:
Failure data recovery for the sub- report ' subreport1 ' , located at: C : \ Projects \ Samich \ VisualStudioOnLine \ Vanessa \ Samich Projects C# \ EMS - Audit Management System - Copy \ EMS - Audit Management System \ Report \ ReportHeader.rdlc . Check the log files for more information .
を誰かが私を助けることができますか?
Ahサブレポート...有用なエラーメッセージの点ではあまり効果がありません。私がやったことの1つは、完全にクリーンなサブレポート(例えば、データソース/パラメータやその他のものがない)から始めてゆっくりとゆっくりと始めることです...非常にゆっくりと...さまざまな部分を追加してください。パラメータから始めてください...デザイナーでそれらをバインドする必要があります、そして、彼らはおそらく外側のレポートから来るでしょう。次に、データソースを追加します。死ぬものを見てそこから行ってください。 – BlackjacketMack
私はすべてを試みましたが、何も動作しません。私は本当に助けが必要です。 =( –