?
Solved

Use data from .txt file into Crystal reports

Posted on 2016-07-25
9
Medium Priority
?
84 Views
Last Modified: 2016-07-28
I want to pull data from a .txt file and include in a Crystal report daily. The .txt file is a simple 5 row file with specific fields, I want to use the header and then each item with it's value next to it.

07/25/2016 13:08:22 :  BATCH CLOSE SUMMARY

MerchantID - 7216789076309317
BatchNo - 207001
BatchItemCount - 000005
NetBatchTotal - 1236.00
C--Users-JohnPretorius-Desktop-CCTes.txt
0
Comment
Question by:John-S Pretorius
  • 5
  • 4
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 41728453
Yes you can.

First you have to create an ODBC connection to the text file using the Microsoft Text driver.

Once you have that then you can use it as any other ODBC data source.

http://scn.sap.com/thread/1070686

I believe you will have to transpose the data so it is in record format
One record per line

If all you want is to show the data then you could use it in the current format.  You will have 2 columns one for the definition the other for the value.

mlmcc
0
 

Author Comment

by:John-S Pretorius
ID: 41729383
I looked at this and it seems straight forward, I'm having trouble getting the format .txt field configured in ODBC. Below 6 rows shows the content of each text file. Line 1 is the timestamp which will be my header and then I will have 2 columns for rows 3 - 6, Description and Value separated by a '-'

07/25/2016 13:08:22 :  BATCH CLOSE SUMMARY

 MerchantID - 7216789076309317
 BatchNo - 207001
 BatchItemCount - 000005
 NetBatchTotal - 1236.00
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 41729418
How is the connection showing the data?

It may be easiest to simply treat it as a single column of text and use formulas in Crystal to break it apart if you need to.

mlmcc
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
LVL 101

Expert Comment

by:mlmcc
ID: 41729437
I just built a report using your sample data.

The first connection I built I let it choose the datatypes.  It worked except the large number apparently is too big for a 32-bit system so it was rounded.

I built a second connection and defined the columns as string/text.
It shows the data just fine.

mlmcc
0
 

Author Comment

by:John-S Pretorius
ID: 41729438
All fields are empty when I run the report.
0
 

Author Comment

by:John-S Pretorius
ID: 41729441
Could you kindly share the ODBC text settings, I'm thinking that I probably have this wrongly configured.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 41729724
Here is the first ODBC Text and Number for the columns

COnfiguration 1
Click to DEFINE FORMAT

ODBC Format
You have to select the text file then change the format to CUSTOM DELIMITED and set it to -
When that is set, click GUESS and the connection will make its best guess.  You can change the name and data type

SInce this is Crystal you only need to setup the 32-bit ODBC connection

mlmcc
1
 

Author Comment

by:John-S Pretorius
ID: 41730223
Thank You very much.
0
 

Author Closing Comment

by:John-S Pretorius
ID: 41733009
Thank you
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

850 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