wpf 中可以使用reportingservers ,水晶报表等东西,但是如果使用reportingservers 在频繁的数据交互中是 比较浪费资源或者存在效率问题。所以还有没有更好的办法呢。答案肯定是有的。
wpf中基于模板的报表设计就可以完成以上内容,对于要修改的报表文件是以文件的方式存放在服务器上,每次读取报表文件还是很方便的!
开工:第一步引入一个三方的dll ,这里集成了很多报表展示格式,有图文,有分组显示,具体源码我这里也有,需要的留言
第二部:创建你要做的报表文件:
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xrd="clr-namespace:CodeReason.Reports.Document;assembly=CodeReason.Reports"
xmlns:xrbc="clr-namespace:CodeReason.Reports.Document.Barcode;assembly=CodeReason.Reports"
PageHeight="29.7cm" PageWidth="21cm" ColumnWidth="21cm">
<FlowDocument.Resources>
<!-- Style for header/footer rows. -->
<Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
<Setter Property="FontWeight" Value="DemiBold"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Background" Value="LightGray"/>
</Style>
<!-- Style for data rows. -->
<Style x:Key="dataRowStyle" TargetType="{x:Type TableRowGroup}">
<Setter Property="Fo
wpf中基于模板的报表设计就可以完成以上内容,对于要修改的报表文件是以文件的方式存放在服务器上,每次读取报表文件还是很方便的!
开工:第一步引入一个三方的dll ,这里集成了很多报表展示格式,有图文,有分组显示,具体源码我这里也有,需要的留言
第二部:创建你要做的报表文件:
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xrd="clr-namespace:CodeReason.Reports.Document;assembly=CodeReason.Reports"
xmlns:xrbc="clr-namespace:CodeReason.Reports.Document.Barcode;assembly=CodeReason.Reports"
PageHeight="29.7cm" PageWidth="21cm" ColumnWidth="21cm">
<FlowDocument.Resources>
<!-- Style for header/footer rows. -->
<Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
<Setter Property="FontWeight" Value="DemiBold"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Background" Value="LightGray"/>
</Style>
<!-- Style for data rows. -->
<Style x:Key="dataRowStyle" TargetType="{x:Type TableRowGroup}">
<Setter Property="Fo