On Apr 22, 10:33 pm, "Rodo" <dsp1...@yahoo.comwrote:
Hi all,
I'm new to this whole thing. I have a bunch of text files that are created
by a software at work that keeps info one of our products. Each unit being
calibrated gets a "record" (track by serial number) which is a text file
with data. The data is almost all the same format. There is header info
about the customer, then some more specs about the product then between 5 to
14 rows of calibration data.
The software that controls the whole thing is ancient. I don't want to touch
it. It writes this text file to the network for every unit that ships out. I
need to look at the files whenever I need to. I was hoping to have a windows
form to open the text file and somehow have the report template in a crystal
report file. The windows form coud display the data and print it if required
but it looks like I need to have the data in a database... which I do not.
I'll echo what the others have said here: you can put the data into a
DataSet and pass it to Crystal. We do that here exclusively. (Note
that Crystal has some quirks when designing from an ADO.NET data
set... some bits of the Crystal Reports Designer that deal with this
are buggy and have been for several versions. It's not a show-stopper,
just annoying.)
That said, you may want to do yourself a favour and put the data in a
database anyway, just because it will be so much more accessible for
other purposes. Whether you then decide to use Crystal to pull from
the database directly, or still feed it via a DataSet in your program,
well that's up to you.
You can write Windows services in C#, and C# has a FileSystemWatcher
class that will alert you when new files are created in a directory.
Even if you have multiple directories, you could write a small Windows
service that monitors them all and, when a new file is created by your
ancient application, parses the file and puts the information into a
database in whatever format you choose. You could then write all new
software to read the database. There would be only a short delay
between the file being created and the database being updated (a delay
that you could determine and tune in your application).
I believe that you could even cope with files being updated and, with
some cleverness, files being deleted, although I don't know whether
your ancient application does these things.
All of this doesn't necessarily help you with your reporting issue.
It's more of a springboard for later development, all without touching
the legacy app, as you said.