Page 1 of 1

Problem with GetReportSnapshotResult and Value cannot be nul

Posted: Thu Mar 12, 2015 2:50 pm
by romulocpd
Hello.

I'm Stimulsoft's customer, version 2013 (Web). In a new company I'm testing the new version in a new project.

I'm using same code from other project, but some problems are happening.

When I call:
return StiMvcViewer.GetReportSnapshotResult(HttpContext, S);

The error: System.ArgumentNullException: Valor não pode ser nulo. Nome do parâmetro: value

I search in a forum but any solutinos are work with me.

Can you please help me?

My ActionGetReportSnapshot is:

Code: Select all

StiReport S = new Stimulsoft.Report.StiReport();

            string Arquivo = Server.MapPath("~/Content/Reports/" + Session["AreaMRT"].ToString() + "/" + Session["ArquivoMRT"].ToString());
            if (System.IO.File.Exists(Arquivo))
            {
                S.Load(Arquivo);
                S.Compile();
            }

            int CodigoRelatorio = 0;

            if (Session["CodigoRelatorioMRT"] != null)
            {
                CodigoRelatorio = int.Parse(Session["CodigoRelatorioMRT"].ToString());

                object DadosSecundarios = null;

                object Dados = RetornarDadosParaExibicaoRelatorio(CodigoRelatorio, S, false, ref DadosSecundarios);

                S.RegBusinessObject("Dados", Dados);

                if (DadosSecundarios != null)
                    S.RegBusinessObject("DadosSecundarios", DadosSecundarios);
            }
                        
            var DadosRelatorio = new AppServiceFactory().ObterInstanciaRelatorioService().RetornarRelatorioPorId(CodigoRelatorio);

            DadosRelatorio.FiltroRelatorio = FiltroRelatorio;

            S.RegBusinessObject("Cabecalho", DadosRelatorio);

            S.Dictionary.SynchronizeBusinessObjects(10);
            
            return StiMvcViewer.GetReportSnapshotResult(HttpContext, S);
How you can See I'm making the RegBusinessObject correctly.

The MRT file exists correctly.

Thank you

Re: Problem with GetReportSnapshotResult and Value cannot be

Posted: Thu Mar 12, 2015 3:42 pm
by romulocpd
I done the test: create a blank report and on the MVC view just call the report with no data, like:

Code: Select all

 @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
    {
        Width = Unit.Percentage(100),
        Height = Unit.Pixel(700)
    })
The same problem occours, see the attach.
Test with no data
Test with no data
erro stimulsoft.png (150.42 KiB) Viewed 1803 times

Re: Problem with GetReportSnapshotResult and Value cannot be

Posted: Thu Mar 12, 2015 4:48 pm
by romulocpd
I've solved. The return type on controller was wrong.

Re: Problem with GetReportSnapshotResult and Value cannot be

Posted: Fri Mar 13, 2015 4:58 am
by Andrew
Hello, Romulo.

Thank you for letting us know about this.

Thank you.