WPCubed Product Support

every space replaced with CR in text field

This problem appeared when we changed from 5.210 to 5.370.
everything is fine inside the tool, but when an RTF file is viewed with MS WordPad or MS Word, as soon as ONE CR is in the text anywhere, it propogates to everywhere there is a space resulting in one word per line.

Anyone have any ideas on this?

David

#1 ♥ 0
5.1k Views 2 users read 3 min

Sample text like:

asf asdf asdf asdf

Displays properly both in the control and in MS WordPad and Word.

but introduce a SINGLE CR anywhere, and every space is replaced with a CR:

asf
asdf
asdf
asdf

The effect occurs after code that "merges" temporary rtf text files into a larger document using:

If FileExists(ExtractFilePath(Application.EXEName) + 'WorkFiles\TempTab ' + LeftPadChS(IntToStr(n),'0',2) + '.rtf') then begin
row := par.AppendNewRow(true);
cell := row.AppendNewCell(true);
cell.ASet(WPAT_BorderFlags, WPBRD_DRAW_All4);
cell.ASet(WPAT_COLWIDTH, WPInchToTwips(😎);
// cell.SetText(FormFrontPage.wwTableSheetTabs.FieldByName('SheetName').AsString, titleA);
If LastDelimiter('=', Book1.TextRC[1,6]) > 0 then
cell.SetText(Copy(Book1.TextRC[1, 6], 1, LastDelimiter('=', Book1.TextRC[1,6]) - 1) + ' - Specific Recommendations', titleA)
Else
cell.SetText(Book1.TextRC[1, 6] + ' - Specific Recommendations', titleA);

row := par.AppendNewRow(true);
cell := row.AppendNewCell(true);
cell.ASet(WPAT_BorderFlags, WPBRD_DRAW_All4);
cell.ASet(WPAT_COLWIDTH, WPInchToTwips(😎);
cell.LoadFromFile(ExtractFilePath(Application.EXEName) + 'WorkFiles\TempTab ' + LeftPadChS(IntToStr(n),'0',2) + '.rtf', 'AUTO', []);
end;

par := WPRichText1.ActiveText.LastPar;
par := par.AppendNewTable;
// par.ASet(WPAT_BoxHeight, WPInchToTwips(1));
row := par.AppendNewRow(true);
cell := row.AppendNewCell(true);
end;

The "workfiles" line allows a user's to annotations of sections of a report with comments that are temporarily stored in files numbered for convenience and merged above with other content in a table that is unaffected (negatively.)

#2 ♥ 0
support

Hi,

Did You try V5.44?

I saw no problem in the file You sent as e-mail.

Regards,

Julian Ziersch

#3 ♥ 0

Julian,

Thank you.

I installed the newest download 5.44, but it seems to bring the only visible version number in the rtf file itself up to 5.370.

I attempted to send you an example of correct and incorrect final stage output.

Did you get these files and view them with WordPad or Word?

Using Multiedit to view the rft file reveals that when the generator is version 5.210 things work well, when 5.370 every space is replaced with an apparent CR or the wrap width is reduced to the width of the widest thing, or one half inch. It just occurred to me that I really don't know which!

A restore of a backup brought us back to functioning.

Today I will reinstall the new version and try to narrow down what files are actually different.

I'll also find out what is really wrong with the area of text! As I think about it, I think the width of the control is simply shrunk to tiny, rather than spaces replaced with CRs.

I'll post with results.

Thanks.

David

#4 ♥ 0

Correction! (Sorry!)

Every time a CR is in the paragraph the column width is reduced to .5 inches.

Wow.

#5 ♥ 0
support

Hi,

If you have an example project (source) I can check it out. It does not seem to be a problem which happens when loading a file in general - there is more to it.

Regards,
Julian

#6 ♥ 0
This category is archived. No new posts are possible.