【问题标题】:Binding List of object to StimulSoft web report对象绑定列表到 StimulSoft 网络报告
【发布时间】:2014-08-07 18:28:16
【问题描述】:

我可以知道是否可以将对象列表绑定到 stimulsoft 网络? 我正在尝试将它与 regbusinessobject 绑定,但我没有机会获取预期的数据。设计器中总是有一个空白的业务对象

我的代码是:

StiReport report = new StiReport();
DBEntities entity = new DBEntities();
List<Section> result = entity.Sections.ToList();
report.RegBusinessObject("Section",result);
StiWebDesigner1.Report=report;
stiWebDesigner1.Desighn();

【问题讨论】:

  • 你怎么知道它是空白的?

标签: c# stimulsoft


【解决方案1】:

在Web中,您可以先创建业务对象的描述,然后创建报表模板,然后将数据源与真实数据连接并呈现报表。创建业务对象的描述。 注意! :您必须使业务对象的类与 .NET 中的业务对象类相同

DBEntities entity = new DBEntities();
List<Section> result = entity.Sections.ToList();

StiReport report = new StiReport();
report.RegBusinessObject("Section",result);

int busobjLevel = 1;
report.Dictionary.SynchronizeBusinessObjects(busobjLevel);

//in web you should call design with parameter like this
StiWebDesigner1.Design(report);

用于显示报告: 创建报告模板后,您可以将其保存到例如以下路径 D:\myReport.mrt。由于业务对象的描述不包含实际数据,为了构建报表,您应该将真实数据获取到业务对象

int busobjLevel = 1; 

StiReport report = new StiReport();

report.Load("D:\\myReport.mrt"); 

using (DBEntitiescontext = new DBEntities())

{

var result = entity.Sections.ToList();

report.RegBusinessObject("Sections", result);

StiWebViewer1.Report = report;

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多