Solved

Use data from .txt file into Crystal reports

Posted on 2016-07-25
9
38 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 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

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

Author Comment

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

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
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
Comment Utility
Thank You very much.
0
 

Author Closing Comment

by:John-S Pretorius
Comment Utility
Thank you
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

14 Experts available now in Live!

Get 1:1 Help Now