1. Sverre Tvedt
  2. PowerBuilder
  3. Thursday, 1 November 2018 08:36 AM UTC

v. 2017 R3 build 1858.  32 bit application code, applies to both W7/W10.

 

We have migrated from 12.6 Classic, very smoothly, so far with the exception of the following possible bug:

I have a program module producing various types of RTF formatted documents.

In this I build the entire RTF string (is_rtf_doc), however sometimes piecewise,  and using a richtextedit control I apply  this method:

li_ret = rte_control.pastertf(is_rtf_doc)

saving to file:

rte_control.SaveDocument(ls_temp_file, FileTypeRichText!)

The RTF-file is at a later stage inputted to an MS Word template file and presented to end-users for document-editing.

Now, inspecting the temp file with Notepad I notice that the paragraph border line width instruction 'brdrw?' and a paragraph end has been removed.  If I simply put it back into the temp file manually, using Notepad, I obtain the intended effect.

The crucial part of the original RTF-string looks like this: "\brdrb\brdrs\brdrw5\brsp20\par\"

In the saved document I find: "\brdrb\brdrs\brsp20"

So. The parameters \brdrw5  and \par have disappeared. This used to work in 12.6  and has been in production for two years. I have tried to put in spaces around the numerical value to no effect.

Of course I could try to save the original RTF string directly. But that would lead to a rather lengthy restructuring of the program architecture since some types of documents are produced with scores or hundreds  of pastertf calls in sequence. In the present case there is just one such call, and this is the only document type using this parameter.

 

best regards,

sverre

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 1 November 2018 13:08 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Sverre;

      In PB 2017, Appeon replaced the embedded TX Control found in PB 12.6 with another control called the TE Control due to licensing issues. These 3rd party controls support the RTE Control and the RTF DataWindow features. The TE Control though does have a few behavioural differences. It could also be that the Appeon PB "Wrapper" around the TE Control has an issue that has led to dropping this control code.

      This seems to be a reproducible test case from what you describe. If you can provide a small RTF example App - then I would suggest that you open a Support Ticket for this issue.

      FYI: Appeon has just now sorted out the TX Control licensing issue. So in PB2018, we will be bringing back the TX control and it should behave in the same way that it did in PB 12.6. So another alternative is to wait for PB2018 where you will have the option in each PB App of choosing either the TE Control or the TX Control internally to support your RTF processing.

Regards ... Chris

 

Comment
  1. Sverre Tvedt
  2. Thursday, 1 November 2018 13:52 PM UTC
Thanks, Chris.

I have been using these control codes to insert bottom borders of various thicknesses at the end of certain paragraphs in the documents. So far this is the only deviation from 12.6 I've found.

Also I have concluded that using the pasteRTF method is overall better than sending the raw RTF string directly to MS Word, so that is not an option.

Seems to be better to wait for PB2018, and in the meanwhile I'll find another method for obtaining the same result.

regards,

sverre
  1. Helpful
  1. Sverre Tvedt
  2. Friday, 2 November 2018 11:45 AM UTC
Solved with workaround. Actually, the 12.6 version has a better way of "improving" what you input by means of PasteRTF. It moves control codes around and adds even more to make sure it works. By comparing the results of the SaveDocument method in 12.6 and R3 I was able to emulate what 12.6 does and R3 omits.



In this case , in place of pasting "\brdrb\brdrs\brdrw5\brsp20\" at the end of a paragraph, I now paste

"\nowidctlpar\brdrb\brdrs\brdrw30\brsp20\brdrbtw\brdrs\brdrw30\brsp20" at the beginning of the paragraph and then it magically works. I have no idea why, there is nothing in the various recipes you can find on the web that indicates that this is the way to do it. Obviously those behind the TX control in 12.6 once sorted out this problem, while the newer version is unaware of it.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 2 November 2018 13:29 PM UTC
Hi Sverre ... Thanks for the feedback on your successful workaround!
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.