Solved

How to use "Text file" as Datasource in Crystal Report

Posted on 2000-05-04
19
816 Views
Last Modified: 2008-03-04
I want to use textfile(Notepad format file)as a datasource.

I mean crystal report use that textfile.

Let me know how do i do that ?

I am eagerly waiting for your reply.

Thanks,
buddyp
0
Comment
Question by:buddyp
  • 13
  • 5
19 Comments
 
LVL 5

Expert Comment

by:Voodooman
ID: 2777750
Hi

You use the Microsoft Text Driver to do this if the file is CSV (comma delimited).

Put a datacontrol on a form.

Set the connect property to text.

Click on database and select the file.

You will now see that the Database Property now refers to your directory (similar to adatbase alias - it referes to the directory) and the recordsource your file.

Now the only problem you have is that this driver expects the first line in your notepad.txt to contain field names for this to work.

the  first line should contain your field names formatted like this.

"Field1","Field2", etc

If you dont have this it dont work!!!


You cannot edit files opened in this way with bound controls.

This is absolutely correct!!


Voodooman!
0
 

Author Comment

by:buddyp
ID: 2777889
Voodooman!
I use only "crystal report 8.0".Not visual basic at all.

And i would like to use "Notepad" file in which field names and related informations are available.

How do i do that ?

Let me know step by step.

Thanks for your time in advance.

Take care..
buddyp
0
 

Author Comment

by:buddyp
ID: 2781714
I am eagerly waiting for your reply.

Thanks,
buddyp
0
 
LVL 3

Accepted Solution

by:
g_jones021500 earned 100 total points
ID: 2788480
Create a new report, use the wizard, select the database button, go to ODBC then "Text files (not shareable).dsn". from here you will have to create a DSN for the text file in question. when creating a new Datasource select "Microsoft Text driver". This will allow you to select the FOLDER that contains the text file you want to report on.

Good luck :)
0
 

Author Comment

by:buddyp
ID: 2794572
g_jones and Voodooman!

I want to retrieve fieldname from the text file.Please let me know how do i do that.

I tried to do that whatever you mention above but i didn't get my fieldname by that way.Let me know step by step.I am using crystal report ver 8.0.

Thanks for your time in advance.

I am eagerly waiting for your reply.

Thanks,
buddyp
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 2796067
sorry, but I don't really understand what you are trying to do.

If you are trying to have Crystal create the report fields when the report is generated (the fields aren't present during design time) then I have no idea how to do that JUST in Crystal... it would be possible (and difficult) to do in Visual Basic.
0
 

Author Comment

by:buddyp
ID: 2796334
g_jones
I only use crystal report no vb at all.

So let me know how do i do that using only crystal report ?

Thanks,
buddyp
0
 

Author Comment

by:buddyp
ID: 2804436
I am still waiting for your reply.

Thanks for your time in advance.

Thanks,
buddyp
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 2810747
Crystal Reports has FREE support by calling 604-669-8379. You just have to pay for the phone call.

If you are not in the US or Canada then visit their website for the proper phone # for you. http://community.seagatesoftware.com/support/contact.asp

Good luck
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:buddyp
ID: 2815072
g_jones
I already have that no.Even though thanks for your time.

If you find out anything about that than let me know.

Thanks,
buddyp
0
 

Author Comment

by:buddyp
ID: 2881454
g_jones

I did all the things as you mention above.But still i have one problem.

In my text file i have last field as Date/time.I have values in that
text file but even than it doesn't show me in my report.

I have first record in my text file as:

000061,5/31/2000 7:24:53 AM ,000520,Process,N,13583-1,,"","lights out","Repair & Maintenance","Lighting Interior","After Hours Request",0002,"Florida Office Property Company",700000       920,"HALLMARK TASSONE PARTNER",JDEINC,Client Account Code,CLIENTCC,COMP INTER,0987654321,12345,126658,40141,126658,100119,"ABM Janitorial Services",SP JDE VENDOR#,SP JDE ADDRESS#,"ABC132",04/20/00 12:00:00 AM,"01","100.00","0.00","100.00","0.00","100.00",,,"100.00","100.00","100.00","100.00","",05/28/00 07:24:54 AM ,

My last field is Date/time and it has a value "05/28/00 07:24:54 AM" .Let me know what modification should
i do so thats why it appears in my report.

Thanks for your time in advance.

Thanks,
buddyp
0
 

Author Comment

by:buddyp
ID: 2883047
g_jones
I am still waiting for your reply.

Thanks,
buddyp
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 2891185
I'm still not sure what your are doing with your report... if you have written a report that accesses the text file or if you are trying to dynamically create the report fields "on the fly".

If you have created a crystal report yourself and it accesses the text file, you should be able to just add the field to your report and format it to your liking.

If you are still having problems maybe it would be easiest if you email me the report and textfile and I can see what you are talking about? If you would like to do this, email me at:
gordonjones@iname.com
0
 

Author Comment

by:buddyp
ID: 2891633
g_jones
Did you get my email with attached files ?

Send me your reply as soon as you can.

Take care,
buddyp
0
 

Author Comment

by:buddyp
ID: 2893129
g_jones
I found it out.

Anyway, thanks for your time and help.

I hereby give you points for your help.Enjoy !

Take care,
buddyp
0
 

Author Comment

by:buddyp
ID: 2893135
Comment accepted as answer
0
 

Author Comment

by:buddyp
ID: 3510276
I wrote report using Text file as Data source.

I ran report and from report menu i went to "Database" option.
Under that i choose "Set Location...".It shows me datasource file
name.

e.g.
Server Type:
Server Name:
Database : C:\Jim\Pilger

Instead of that i want to point to

Database: C:\Lary

Let me know how do i do that ?

Thanks for your time in advance.I am in hurry.Please send me your reply as soon as you can.

Thanks,
buddyp
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 3542338
Go to Start menu/Settings/Contro Panel/Data Sources (ODBC) and change the path there in you rtext files's DSN
0
 

Author Comment

by:buddyp
ID: 3566353
g_jones
Is there any other way without using DSN, i can directly connect that text file(*.txt) file with the report file(*.rpt) file.Just like we are retrieving data directly from  table.

I am eagerly waiting for your reply.

Take care,
buddyp
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now