1. luigi venegoni
  2. PowerBuilder
  3. Thursday, 7 December 2017 13:58 PM UTC

hello, i'm using pb 9.0  

 

I have a rich text with some data, but i need to insert a datawindow grid inside the rich text, is that possible?

 

thanks. 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 7 December 2017 20:31 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Luigi;

    The RTE Control and RTE DataWindow do not allow any form of nested DataWindows inside of them. Both objects are expecting just a standard RTF data stream. However that being said, if you can convert the contents of a grid DataWindow into an RTF format - you could then insert that into the current RTE Control/DW using the PasteRTF() method (as one example).

HTH

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwee Accepted Answer Pending Moderation
  1. Wednesday, 17 January 2018 01:46 AM UTC
  2. PowerBuilder
  3. # 1

Probably a very late answer (holidays cheeky ), but nevertheless:

Not the same as a dw, but maybe you can export your dw to html into a string or file and then what you can do:

- paste it into the rtf or write it to disk first and then do InsertDocument():

 

From the pb help file:

InsertDocument

Description

Inserts a rich text format or plain text file into a RichTextEdit control, DataWindow control, or DataStore object. The new content is added in one of two ways:

  • The new content can be inserted at the insertion point.

  • The new content can replace all existing content.

Applies to

RichTextEdit controls, DataWindow controls, and DataStore objects

Syntax

rtename.InsertDocument ( filename, clearflag { , filetype } )

Argument

Description

rtename

The name of the RichTextEdit control, DataWindow control, or DataStore object in which you want to display the file. The DataWindow object in the DataWindow control (or DataStore) must be a RichTextEdit DataWindow.

filename

A string whose value is the name of the file you want to display in the RichTextEdit control. Filename can include the file’s path.

clearflag

A boolean value specifying whether the new file will replace the current contents of the control. Values are:

  • true – Replace the current contents with the file

  • false – Insert the file into the existing contents at the insertion point

filetype 
(optional)

A value of the FileType enumerated datatype specifying the type of file being opened. Values are:

  • FileTypeRichText! – (Default) The file being opened is in rich text format (RTF)

  • FileTypeText! – The file being opened is plain ASCII text (TXT)

  • FileTypeHTML! – The file being opened is in HTML format (HTM or HTML)

  • FileTypeDoc! – The file being opened is in Microsoft Word format (DOC)

If filetype is not specified, PowerBuilder uses the filename extension to decide whether to read the file as rich text or plain text. If the extension is not one of the supported file type extensions, PowerBuilder attempts to read the file as rich text. To insert files with extensions such as INI, LOG, or SQL, you must specify FileTypeText!.

Return value

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.