是否可以在 Crystal Reports 中显示文本文件的内容 [英] Is it possible to show the contents of a text file in Crystal Reports

查看:21
本文介绍了是否可以在 Crystal Reports 中显示文本文件的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含绝对引用文本文件列表的水晶报告.每个正文行都引用了一个文本文件.

I have a crystal report which contains a list of absolutely referenced text files. There is one text file referenced in each body line.

例如

line1    c:file1.txt
line2    c:file2.txt

有没有办法在 Crystal 中显示这些文件的内容?

Is there any way to display the contents of these files in Crystal?

即我希望每个水晶体线都显示引用文本文件中的文本.

i.e. I would like each crystal body line to show the text from the referenced text file.

我正在使用带有非标准数据库连接器 (dataflex) 的 Crystal 报表 11.

I'm using Crystal reports 11 with a non-standard database connector (dataflex).

推荐答案

您需要设置一个文件 dsn(在 XP 中它位于控制面板/管理工具/数据源 (ODBC) 下),然后使用文件 dsn (Microsoft文本驱动程序)作为 ODBC(RDO) 连接的数据源.

You would need to set up a file dsn (in XP it's under Control Panel/Administrative Tools/Datasources (ODBC)) and then use the file dsn (Microsoft Text Driver) for the datasource as an ODBC(RDO) connection.

我将这个测试场景设置在我的身上,如下所示:

I set this test scenario up on mine like the following:

**File 1**
column1
1row1
1row2
1row3

**File 2**
column1
2row1
2row2
2row3

我将文件 dsn 设置为指向 c 驱动器,并在数据源屏幕中将 file1.txt 和 file2.txt 添加到选定的表中.然后最简单的事情是清除表的链接,以便它拉动每一行.它会警告您有多个起点.我一般不推荐这个,但它会在这种情况下工作,因为它没有报告数据库,它可能不是世界末日.如果您忽略起始点消息,然后将字段添加到报告中,当您运行它时,您应该得到以下输出:

I set up the file dsn to point to the c drive and in the datasource screen I added file1.txt and file2.txt to the selected tables. Then the easiest thing to do is clear the links of the tables so that it pulls every row. It will warn you that there are multiple starting points. I don't generally recomend this, but it will work in this case and since it's not reporting off a database it probably isn't the end of the world. If you disregard the starting point message then add the fields to the report, when you run it you should get the following output:

1row1     2row1
1row1     2row2
1row1     2row3
1row2     2row1
1row2     2row2
1row2     2row3
1row3     2row1
1row3     2row2
1row3     2row3

您可以从中更改分组以获得所需的输出.

From this you can change your grouping to get the output that you need.

您也可以对子报表使用相同的连接,而不是在主报表从 file1.txt 中提取信息的位置进行此链接,然后将子报表放在从 file2.txt 中提取的报表页脚中.此选项不会整理文本,但您仍然可以在同一个报告中使用它.

You can also use this same connect against subreports instead of doing this linking where you have the main report pull the info from file1.txt and then put a subreport in the report footer that pulls from file2.txt. This option won't have the text collated, but you'd still have it in the same report.

希望这会有所帮助.

这篇关于是否可以在 Crystal Reports 中显示文本文件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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