水晶报表 - 流记录的布局视图 [英] Crystal Reports - Flow Layout view of records
问题描述
全部,
我在VS2010中使用水晶报表。我想执行一个查询,列出记录为行,并作为子查询,你喜欢,显示一个类似于流布局(.Net / Java风格)的记录。
I am using Crystal Reports in VS2010. I want to execute a query that lists records as row, and as a sub-query as you like, display a record within something that resembles a Flow Layout (.Net/Java style).
我正在执行一个存储过程来获取我的数据,例如:
I am executing a stored procedure to get my data in one, for example:
SELECT Table1.Field1 AS Title
Table2.Field1 AS RowRecord1
Table2.Field2 AS RowRecord2
Table3.Field1 AS DataRecord
FROM Table1
JOIN Table2 ON Table1.id = Table2.table1_id
JOIN Table3 ON Table2.id = Table3.table2_id
table2是一个中间,Table3有我的子数据,我想显示不同 - 不是一行。
So Table1 is the top level parent, Table2 is an intermediate, Table3 has my child data that I want to display differently - not in a row.
因此,select中的虚拟数据看起来像: / p>
So dummy data in select will look like:
Title RowRecord1 RowRecord2 DataRecord
My Test Some Row1 Test 1 D1
My Test Some Row1 Test 1 D2
My Test Some Row1 Test 1 D3
My Test Some Row1 Test 1 D4
My Test Some Row1 Test 1 D5
My Test Some Row2 Test 222 D1
My Test Some Row2 Test 222 D2
My Test Some Row2 Test 222 D3
看起来像这样:
**My Test**
Some Row1 Test 1
D1 D2 D3 D4
D5
Some Row2 Test 222
D1 D2 D3
DataRecord将在流布局中从左到右填充部分(单值)。
DataRecord will fill the section up from left to right (single value) - in a Flow Layout.
理想情况下,我想知道如何在Crystal中做到这一点。如果不是,我会听其他想法或解决方案。
Ideally I want to know how to do this in Crystal if at all possible. If not I will listen to alternative ideas or solutions. I've tried a few things to no avail and not found anything on line as yet.
感谢,
Andez
推荐答案
我认为这样应该可以工作:
I think something like this should work:
水晶中的第一个组标题
, RowRecord1
, RowRecord2
First group in Crystal by Title
, RowRecord1
, RowRecord2
然后创建三个公式:
在最深的组标题中: p>
In the deepest group header put:
WhilePrintingRecords;
Global numberVar count := 0;
StringVar ConCat:= "";
详细部分:
WhilePrintingRecords;
StringVar ConCat;
Global NumberVar count;
if ((count Mod 4) = 0) then
ConCat:= ConCat & {DBTABLE.DataRecord} & ChrW(13) //adds a line break
else
Concat := Concat & {DBTABLE.DataRecord};
count := count + 1
ConCat
在组页脚中
WhilePrintingRecords;
StringVar ConCat;
Concat;
这篇关于水晶报表 - 流记录的布局视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!