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

查看:312
本文介绍了可以在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 Text Driver)作为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拉的报表页脚。文本。此选项不会整理文字,但您仍然可以在同一份报告中。

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天全站免登陆