从Crystal报表中提取数据 [英] Extract Data from Crystal repor
问题描述
大家好,
我的问题是我有一个水晶报表(.rpt文件),我想将该文件加载到另一个项目中,并扩展该报表中使用的数据库对象,例如列,表,数据类型等.
我做了很多谷歌搜索,但没有找到任何解决方案.
希望你们能帮忙.
在此先感谢
分步详细信息:
我有一个动态绑定在表上的Crystal Report.
让我们假设它的表(实际上我对那个表一无所知):
ID名称年龄性别电话
在报告中,我只有3个字段,即ID,姓名和年龄.
现在,我必须创建一个项目,以该.rpt文件作为参数,并显示报告中使用的字段(在这种情况下,它们是:ID,名称和年龄),其数据类型,使用的键(如果有). br/>
我希望现在已经清楚了.
Hi All,
My problem is that I have a crystal report (a .rpt file) and I want to load that file in a different project and extact the database objects used in that report, like Columns, tables , datatypes etc.
I had done lots of googling but didn''t find any solution.
Hope you guys can help.
Thanks in advance
Step by Step Details:
I have a Crystal Report which is dynamically bind on a table.
Lets assume its the table (In actual I have no idea about that table):
ID Name Age Gender Phone
In the report I have only 3 fields, i.e. ID, Name and Age.
Now I have to create a project that will take that .rpt file as a parameter and show the fields used in the report (In this case they are: ID, Name and Age), their datatypes, Keys used (if any).
I hope this is clear now.
推荐答案
将rpt转换为csv&然后从C#中读取csv.
检查此链接
http://stackoverflow.com/questions/3101187/how-do- i-convert-rpt-files-to-csv [ ^ ]
您也可以将csv转换为数据集&然后利用这些列.
如果您能够这样做,请将其作为代码项目中的技巧/窍门发布,这样也将对其他人有所帮助.
Convert your rpt to csv & then read the csv from C#.
Check this link
http://stackoverflow.com/questions/3101187/how-do-i-convert-rpt-files-to-csv[^]
You can convert csv to a dataset too & then make use of the columns.
If you are able to do it this way,post it as a Tip/Trick in codeproject so that it will help others too.
甜言蜜语对于那些喜欢的人来说,这是一个救命稻草的方法. c#
Sweet this is a life saver for those of you who prefer c#
ReportDocument report = new ReportDocument();
report.Load(@"reportname.rpt"); report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.ExcelRecord, @"filename.xls");
这篇关于从Crystal报表中提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!