fastreport - FastReport 开源对象数据源
问题描述
我尝试使用 FastReport 开源从我将提供给报告的数据中构建报告。
我在演示中找到了我想要的东西(https://github.com/FastReports/FastReport/tree/master/Demos/OpenSource/DataFromBusinessObject/DataFromBusinessObject)
在这个演示中,我在报告文件中看到BusinessObjectDataSource
使用了 a,这似乎是我想要使用的。
但是,我看不到在社区设计器中添加这种源的方法。我需要手动添加所有这些吗?或者有没有办法生成所需的标记?我在他们的网站上找不到解决方案。
解决方案
我找到了一种方法,像这样手动制作所需的 xml:
<BusinessObjectDataSource Name="Invoices" ReferenceName="Invoices" Enabled="true">
<Column Name="Reference" DataType="System.String"/>
<Column Name="Date" DataType="System.String"/>
<Column Name="CompanyName" DataType="System.String"/>
<Column Name="InvoiceEmail" DataType="System.String"/>
<Column Name="VAT" DataType="System.String"/>
<Column Name="Street" DataType="System.String"/>
<Column Name="Number" DataType="System.String"/>
<Column Name="City" DataType="System.String"/>
<Column Name="ZipCode" DataType="System.String"/>
<Column Name="Country" DataType="System.String"/>
<Column Name="TotalPrice" DataType="System.Decimal"/>
<Column Name="VATValue" DataType="System.Decimal"/>
<Column Name="VATPercentage" DataType="System.Decimal"/>
<Column Name="VATComment" DataType="System.String"/>
</BusinessObjectDataSource>
唯一的缺点是,如果我的对象发生更改,我需要更新它(但至少正在工作!)
推荐阅读
- botframework - 如何使 MS Teams 机器人仅可从某些@xyz.com 域使用(无身份验证)
- javascript - 如何在 React Navigation 5 中动态设置导航栏标题和背景颜色
- kotlin - 不包括变量名中的数据类型
- sql - 来自两个表的动态列
- oracle - 为什么 Hibernate 忽略 setMaxResults?
- python - 关于 python 和 python3 命令的混淆
- c# - 等效于 Blazor 中的 ObserveOnDispatcher
- php - 如何让IP地址在一分钟内被点击超过10次
- php - 确切的 API - SalesOrderLines(必选项目:单位),即使单位存在
- javascript - 使用 lodash 或 es6 javascript 展平嵌套对象