Crystal reports Crystal Reports-记录的流布局视图
全部, 我在VS2010中使用Crystal Reports。我想执行一个查询,将记录列为行,并根据需要作为子查询,在类似于流布局(.Net/Java样式)的内容中显示记录 我正在执行一个存储过程以在其中获取数据,例如:Crystal reports Crystal Reports-记录的流布局视图,crystal-reports,report,Crystal Reports,Report,全部, 我在VS2010中使用Crystal Reports。我想执行一个查询,将记录列为行,并根据需要作为子查询,在类似于流布局(.Net/Java样式)的内容中显示记录 我正在执行一个存储过程以在其中获取数据,例如: SELECT Table1.Field1 AS Title Table2.Field1 AS RowRecord1 Table2.Field2 AS RowRecord2 Table3.Field1 AS DataRecord FRO
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
因此,表1是顶级父级,表2是中间级,表3有我希望以不同方式显示的子级数据,而不是一行
因此,select中的虚拟数据如下所示:
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将在流布局中从左到右(单值)填充该部分
理想情况下,如果可能的话,我想知道如何在水晶中做到这一点。如果没有,我将听取其他想法或解决方案。我试了几次都没用,到目前为止还没有在网上找到任何东西
谢谢
Andez我认为这样的方法应该有效: Crystal中的第一组由
标题
,行记录1
,行记录2
然后创建三个公式:
在最深的组标题中放置:
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;
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;
嗨,罗伯特,我正在试这个。我照样复制了公式。我得到一个计数错误,表示没有给函数提供足够的参数。有什么想法吗?我把伯爵的名字改成了count1。我已在详细信息部分公式中添加了全局数VAR count1。第一组显示D1 5次,并显示在组页脚中。不知道我做错了什么。我会继续努力。谢谢,我已经更新了一点。全局数值变量在中间公式中丢失,当然增加计数变量。我没有在CR中尝试过这段代码,我只是介绍了我的方法。祝你好运。嗨,罗伯特,现在用它了。谢谢。我已经隐藏了细节部分,细节公式中的第一部分现在是:whileprinting记录;全局数为count1:=count1+1;鹿茸;从长远来看,是否可以动态添加框。我知道这只是附加到一个字符串并输出它,但这只是偶然的。再次感谢