Click here to Skip to main content
15,063,556 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi;
i want to open an existing text file with crystal report at vs2010

thanks..
Posted
Comments
Sergey Alexandrovich Kryukov 28-May-11 20:41pm
   
Not a question.
--SA
kathassis 29-May-11 10:27am
   
i tried this method. but i dont want to use text file as database.my aim is ; i have an another program and i am getting report from the program to text files.and i want to open this text files with crystal report.i dont take report from database with crystal report directly. i make a text file then open it with crystal report without using database.
thatraja 29-May-11 11:08am
   
Check my updated answer. Let me know after that.
kathassis 29-May-11 11:17am
   
hımm ok.if i read text file data to list box and then open a crystal report from listbox items.is this possible.
thatraja 29-May-11 12:19pm
   
If you display the contents already in your form, then why do you need crystal report? for what? clear that....
kathassis 29-May-11 12:47pm
   
i can make listbox non visible to not display content. my aim is open a text file(that i take from my another backoffice program) in crystal report.then i convert my tab delimited text file report to excel,pdf.. with using crystal report.
thank for your interest.
thatraja 29-May-11 13:15pm
   
Check my updated answer
kathassis 29-May-11 13:20pm
   
yes also i did it like your answer. but i want to use crystal report for this situation if possible
thatraja 29-May-11 13:27pm
   
Oops...:Doh:
Oh dude, Already I said about connecting text files in Crystal reports. But the issue is you are(backoffice program) generating text files dynamically, right?
So the option is you need to save those text file(using windows service or anything) contents into database & then connect the database in crystal reports & generate reports. That's all. This is my suggestion. Let me know if you still have any doubt.
kathassis 30-May-11 15:23pm
   
ok man.i am back to your first choice odbc connection.but i did not do. have you got any example of it completely. that opens a text file from specific location.

1 solution

Your question is confusing little bit.

I think you are asking about connecting text file in crystal reports.

OK.

Create ODBC connection to the text file with text driver.

Step 1[^]

Step 2[^]

EDIT
---------------------------------------
No, you can't open text file in crystal report.
For your requirement, you can open the text file in your form(Textbox) directly.

How to Open and Read a File in Win Forms using C#[^]

EDIT 2
---------------------------------------
Based on your comments you don't need crystal reports, you can convert/export the text file into excel/pdf/or anything.

Generating Excel Files in C#[^]
Convert the text file to Excel Format[^]
Reading Text File and Export To Excel[^]
Convert a Text File to a PDF File[^]
   
v3

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