DBMemo Field Export to Txt: Remove Characters
RB 7.04:
We have a DBMemo field which contains user notes:
If a user "tabs" or "enters" in the memo field, it exports the hidden
characters in the text file which throws off the alignment of the file.
Is there a way to put the memo to a text field; then loop through and
remove all unwanted characters(paragraph character/return/tab/etc) so that
it will export to text correctly?
We've done this in Crystal by calling it an "HTML" box, so those
characters do not exist.
Thanks,
Mac
Mac A. Maccioli
Maccioli Medical Technologies, Inc.
P 480 262 9223
F 480 393 5136
Mac@MaccioliMedical.com
www.MaccioliM
--- posted by geoForum on http://delphi.newswhat.com
We have a DBMemo field which contains user notes:
If a user "tabs" or "enters" in the memo field, it exports the hidden
characters in the text file which throws off the alignment of the file.
Is there a way to put the memo to a text field; then loop through and
remove all unwanted characters(paragraph character/return/tab/etc) so that
it will export to text correctly?
We've done this in Crystal by calling it an "HTML" box, so those
characters do not exist.
Thanks,
Mac
Mac A. Maccioli
Maccioli Medical Technologies, Inc.
P 480 262 9223
F 480 393 5136
Mac@MaccioliMedical.com
www.MaccioliM
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
Are you exporting to a delimited text file or a Report Emulation text file?
How are you viewing these text files? In my quick testing using notepad to
view the text file, the control characters are not visible.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I agree the control characters are NOT visible, but it will still jump
lines because of the charater, if you copy/paste into ms word, you'll see
the paragraph marker (backwards looking P). I can send over the file if
you like as a word attachment or screen shot.
Thanks for the quick response.
Mac A. Maccioli
Maccioli Medical Technologies, Inc.
P 480 262 9223
F 480 393 5136
Mac@MaccioliMedical.com
www.MaccioliM
--- posted by geoForum on http://delphi.newswhat.com
The built-in text file device does not currently support exporting memos to
a delimited file. Are you using a third party export device to do this or
perhaps a custom device?
It is on our to-do list to add this feature to the built-in text file device
for a later release of RB.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
You are correct, you cannot directly export a DBMemo Field, but we are
doing the below:
We call the DBMemo('Documentation') from a variable as a string:
**OnCalc Variable1:
begin
Value := Transaction['Documentation'];
end;
**
This way we can export the variable and whatever is inside of it (DBMemo
in this case).
I had a hold of some code before, did something like loop through the
field and remove characters by #. Can we loop through a variable and
replace specific character #'s with blanks spaces?
Thanks,
Mac
Mac A. Maccioli
Maccioli Medical Technologies, Inc.
P 480 262 9223
F 480 393 5136
Mac@MaccioliMedical.com
www.MaccioliMe
--- posted by geoForum on http://delphi.newswhat.com
Inside the OnCalc event of the variable, you could loop through the field
text and remove the characters you need before assigning it to the value of
the variable component.
sample psuedo code...
lsText := Transaction['Documentation'];
liIndex := 1;
//Removes carrage returns
while liIndex > 0 do
begin
liIndex := Pos(#10, lsText);
if liIndex > 0 then
lsText[liIndex] := '';
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com