August 13th, 2012, 12:25 AM
Pulling data out of reports
I have some reports that I need to separate the data from. The reports will be in a TMemo, I basically want to change the caption of a label on the form with each data.. Any help on how to pull the info in orange below out would be helpful, thanks in advance..
A sample of a typical report is:
Resolved (No Response)Resolution type:
Resolution went as I expected
Scope of work:
Customer was a dispatch from another expert session: p2s Session: 8888*** LMI ID – 1467*****] PC Tuneup Scope of Work performed: PC Tuneup Additional Notes:Browser not showing pages, unable to download files and popups.
Scan was clean.
Diagnostic Session: 8888462
Browser not showing pages, unable to download files and popups.
Scan was clean.
Performed tuneup via ccleaner, disk cleanup. Reset IE, verified internet working in normal mode, customer happy. Diagnostic Session: 8888462
Product Details: (Optional)
(Delimit tags with a comma)
August 13th, 2012, 01:29 AM
You should use the lines property of TMemo.
August 13th, 2012, 09:44 AM
Have you thought about using XML to build your report?
You could easily write code to display your data as you have above in a memo control, and still have each data element easily accessible for what ever other purpose you need.
Here are some articles to help:
August 13th, 2012, 12:51 PM
Because of the way the question was phrased I jumped to the conclusion that access to the data was confined to the TMemo.
Of course, if there is access to the source code that is a misconception.
However, assuming there is access to the source data, whether it is preferable to build an XML structure, a tabular format
or some other data container will, I think, depend upon the source data structure and the overall requirements of the application.
August 19th, 2012, 01:32 PM
Which is why we need more context and background to offer useful advice.
I would think that if you have access to the HTML then that is the way to go.
Based on what you say, by examining the structure of example.htm you should be able
to discern the relationship between the tags that represent report titles
(Customer name: ; session date: etc.) and the tags that enclose the data.
While I am familiar with navigating and extracting/inserting data into XML structures I have
not had the need (in Delphi) to do the same with HTML, so this is the limit of my current advice.