I'm trying create new reporto for my business objects. I work with Entity Framework and I've got objects do query and show data to MVC views.
If I pass the business object and call method Design() (Windows Forms), the Dictionary is filled correct.
In Windows Forms:
My Object:
Code: Select all
public class ObjRelatorio
{
public ObjRelatorio()
{
Clientes = new List<Cliente>();
}
public int CodigoEmpresa { get; set; }
public string RazaoSocial { get; set; }
public List<Cliente> Clientes { get; set; }
}
Code: Select all
ObjRelatorio Rel = new ObjRelatorio();
GerarDados(Rel);
StiReport S = new StiReport();
S.RegBusinessObject("DadosEmpresa", Rel);
S.Design();
My problem is: In MVC Designer it won't work.
Code: Select all
public ActionResult EditarRelatorioMaster()
{
StiReport S = new StiReport();
// My Business Object !!!!!!!!!!!!!!!!!!1
S.RegBusinessObject("Cabecalho", new Models.View.ModelViewCabecalhoRelatoriosView());
return StiMvcDesigner.GetReportTemplateResult(S);
}
Code: Select all
@using System.Web.UI.WebControls;
@using Stimulsoft.Report.Mvc;
@{
ViewBag.Title = "EditarRelatorioMaster";
Layout = "~/Views/Shared/_AlterarRelatorio.cshtml";
}
<h2>Alterar Relatório Master</h2>
@Html.Stimulsoft().StiMvcDesigner(new StiMvcDesignerOptions() {
ActionGetReportTemplate = "EditarRelatorioMaster",
ActionSaveReportTemplate = "SalvarRelatorioMaster",
ActionGetReportSnapshot = "DadosAlteracaoRelatorioMaster",
ActionGetLocalization = "GetLocalization",
Width = Unit.Percentage(100),
Height = Unit.Pixel(800)
})
It won't work!!!!
What my soluciton? I've create a equal object in Windows Forms, call the Designer, create the .mrt file. If I get this file and use in MVC project, the report works!!!!!!!
So, my problem is create new reports reading data from my Business Object.
Thank you!