Data doesn't load subReport

Stimulsoft Reports.WEB discussion
Post Reply
lucas_almeida
Posts: 2
Joined: Thu Aug 26, 2021 1:56 pm

Data doesn't load subReport

Post by lucas_almeida »

I'm sending the fixed data to the subreport's dataSet, but when printing the subReport it doesn't load the data. I looked on the forum and saw that I wasn't using the "StiGetSubReportEventHandler" method. But when I put it in my project and try to run it, it seems that it doesn't run, that's because when running the debugger doesn't seem to go through breakPoint

Here is my code

Code: Select all

private StiReport ConfigurarStiReportTeste(byte[] arquivoRelatorioPrincipal, IEnumerable<DatasetPdfReportDTO> dados)
        {
            var report = new StiReport();
            report.Load(arquivoRelatorioPrincipal);
            report.CacheAllData = true;
            report.Dictionary.DataSources.Clear();

            foreach (var dado in dados)
            {
                report.RegData(dado.NomeDicionario, dado.Dados);
            }

            report.Dictionary.Synchronize();

            report.GetSubReport += new StiGetSubReportEventHandler(Report_GetSubReport);
            report.Render(false);

            return report;
        }
        //meu Método
        private void Report_GetSubReport(object sender, StiGetSubReportEventArgs e)
        {
            foreach(var dados in dadosSubReports)
            {
                byte[] arquivoSubrelatorio = ObterArquivoRelatorio(dados.IdentificacaoSubRelatorio);

                var subreport = new StiReport();
                subreport.Load(arquivoSubrelatorio);
                subreport.CacheAllData = true;
                subreport.Dictionary.DataSources.Clear();

                subreport.RegData(dados.NomeDicionario, dados.Dados);

                subreport.Dictionary.Synchronize();

                e.Report = subreport;

            }
        }
*(I tried to send an example project, but it's giving an error to send)
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: Data doesn't load subReport

Post by Lech Kulikowski »

Hello,

Please send us your reports with test data for analysis.

Thank you.
Post Reply