Problem with GetReportSnapshotResult and Value cannot be nul

Stimulsoft Reports.WEB discussion
Post Reply
romulocpd
Posts: 73
Joined: Thu Oct 17, 2013 10:39 pm
Location: Nova Friburgo, Rio de Janeiro, Brasil

Problem with GetReportSnapshotResult and Value cannot be nul

Post 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
romulocpd
Posts: 73
Joined: Thu Oct 17, 2013 10:39 pm
Location: Nova Friburgo, Rio de Janeiro, Brasil

Re: Problem with GetReportSnapshotResult and Value cannot be

Post 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 1801 times
romulocpd
Posts: 73
Joined: Thu Oct 17, 2013 10:39 pm
Location: Nova Friburgo, Rio de Janeiro, Brasil

Re: Problem with GetReportSnapshotResult and Value cannot be

Post by romulocpd »

I've solved. The return type on controller was wrong.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Problem with GetReportSnapshotResult and Value cannot be

Post by Andrew »

Hello, Romulo.

Thank you for letting us know about this.

Thank you.
Post Reply