?
Solved

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

Posted on 2000-05-04
19
Medium Priority
?
896 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Accepted Solution

by:
g_jones021500 earned 300 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
 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

770 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