Click here to Skip to main content
15,905,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 11-Jan-11 22:17pm
v4
Comments
Dalek Dave 12-Jan-11 3:49am    
Edited for Grammar and Readability.
Sandeep Mewara 12-Jan-11 3:51am    
Not clear.
thatraja 12-Jan-11 4:09am    
Confusing question, clear it step by step

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.
 
Share this answer
 
v2
Comments
Espen Harlinn 12-Jan-11 5:52am    
5+ Nice and simple solution :)
Anupama Roy 12-Jan-11 6:49am    
Thank you!
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");
 
Share this answer
 
v2
Comments
RaviRanjanKr 18-Jan-11 23:31pm    
Code is wrapped in "pre" tags for Make it better readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900