如何用C#编写带有游程内容的报表? [英] How to make a report with run-length content in C#?

查看:55
本文介绍了如何用C#编写带有游程内容的报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用动态数据创建一些报告,这就是为什么要分段的报告内容和每个分段的长度都非常不同的原因.
该报告如下所示:

-------------------------------------------------- -------
##报告标题##
##报告主要内容##

##项目1的长度可能可变

##项目2的长度可能可变

## ....

##项目n的长度可能可变

##报告页脚##
-------------------------------------------------- -------

我想设计报告而不是代码来生成报告,当然,如果没有办法,使用代码对我来说是不可取的!

Item1、2,..,n可以显示任何数据,例如普通字符串(标签),文本框,表格...

困难的是,如果我在设计时生成报告,必须将所有项目拖放到固定位置上的报告中,我想知道在填充数据时如何呈现它们.运行??? (必须更改其职位).

总之,无论我怎么做(设计或编码),我都希望找到一种解决方案.另外,您能否建议我哪种报告工具最适合我的这个问题???我只知道Crystal Report和XtraReport.

谢谢!

I want to create some report with dynamic data and that''s why the report content which will be segmented and each segment has a very different length.

The report can look like this:

---------------------------------------------------------
## Report header ##
## Report main content ##

##Item 1 may have variable length

##Item 2 may have variable length

## ....

## Item n may have variable length

## Report footer ##
---------------------------------------------------------

I want to design the report not code to generate the report, of course if there is no way, using code is undetestable to me!

The Item1, 2, .. , n are anything possible to show data such as normal strings (labels), textboxes, tables ...

The difficult thing is if I build the report at design time, all the items must be dragged-n-dropped onto the report at fixed positions and I wonder how they can be rendered when being filled with data at runtime??? (Their positions must be changed).

In conclusion, I want a solution for such a report no matter how I do (design or code). Plus, could you please suggest me what report tool is the best for this problem of mine??? I know only Crystal Report and XtraReport.

Thank you! Your help would be highly appreciated!

推荐答案

我建​​议您先看看在Crystal或XtraReport中可以完成的工作(两者都尝试).

我很久没有使用Crystal了,但是我的回忆是它支持重复部分(重复的次数取决于数据..因此它不是硬编码的),并且它还支持不断增长的文本字段-即报告模板中字段的大小可能是报表的整个宽度,并且高了一行,但是在运行时,该字段会变得足够大,可以包含该字段中的整个文本.

您尚未明确的一件事是,您在某个部分内的可变性是否是您想要有时这些个字段,有时是那些个字段"-换句话说您想要在运行时动态更改报表的设计.我从来没有做过,我怀疑这是否是您想要做的,您将需要在代码中完成.更简单的选择是在设计时添加最大的字段集,而在运行时,如果该节不需要它们,则不要在其中放入数据.但是也许您觉得需要完全开放,此选项将无法使用.

希望那里有帮助.
I recommend that you start by seeing what you can accomplish in Crystal or XtraReport (try both).

I''ve not used Crystal in ages, but my recollection is that it supports repeating sections (where the number of repeats is dependent on the data .. so it is not hardcoded), and it also supports text fields that grow - i.e. the size of the field in your report template may be the full width of the report, and one line tall, but at run time the field grows to be big enough to contain the entire text in the field.

The one thing you''ve not made clear is whether your variability within a section is that you want ''sometimes these fields, sometimes those fields'' - in other words you want to dynamically change the design of the report at run time. I''ve never done that and I suspect if that''s what you want to do you''ll need to do it in code. The simpler alternative is to add the maximal set of fields at design time, and at run time just don''t put data in them if the section doesn''t need them. But maybe you feel the need to be completely open-ended that this option won''t work.

Hope something there helps.


这篇关于如何用C#编写带有游程内容的报表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆