1. Thierry Del Fiore
  2. PowerBuilder
  3. Wednesday, 20 September 2023 15:59 PM UTC

HI,

we are looking at the new enhancements of the RTE control in PB2022R2 and the support of tables in particular.

The question is how to insert rows to an existing table ?

The fonction TableInsertrows() seems to only work when the focus is in a cell table or we would like to do it by code.

TableInsertrows() doesn't have "TableID" as argument like others functions TableDelerow() , TableDeleteColumn()

Tablecellselect() before TableInsertrows()  doesn't seem to put the focus in the table.

 

The final goal is to create a letter to a customer with name, adress,   dynamic formatted text (bold, ...), images and an array of invoice and another dynamic formatted text below.

We would like to get rid of MS Word Mail merge.

So the idea was to create a RTE Template with Fields but also a formatted table with 2 rows and to insert dynamically new rows depending of number of invoices.

Or maybe do you suggest another approach ? 

  • The RTE datawindow seems to support only 1 record per page (is it possible to handle the 1-N for the array ?)  ?
  • Standard tabular DW with RTE Field (seems that images dont display) and nestedreport for the array ?

Any suggestion of how you handle 1 to N letter in PB (with user formatting freedom)  is welcome

Regards

Thierry

 

 

 

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 September 2023 06:28 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Thierry,

 

Regarding finding an existing table, you can use the TableNext method to get the TabbleID value.
You can refer to the following link for the details.
https://docs.appeon.com/pb2022r2/powerscript_reference/tableNext_func.html

 

With the TableID value, you can select a cell of the table to set the focus and then use TableInsertRows to insert rows.

Sample code:

 

li_rtn = rte_1.TableNext(0,ll_TabbleID)
//Select the first column of first row
ll_inputPos = rte_1.TableCellStart(ll_TabbleID, 1, 1)                        
rte_1.SelectedStartPos = ll_inputPos      
rte_1.SelectedTextLength = 0    
//Insert rows
rte_1.TableInsertRows(1,2)

 

By the way, you can refer to SalesDemo which comes with the PB installation.
The default path is: C:\Users\Public\Documents\Appeon\PowerBuilder 22.0\Code Examples\Example Sales App\Native_PB\Appeon.SalesDemo

Github link: https://github.com/Appeon/PowerBuilder-Sales-Example

 

 

Regards,

Comment
  1. Thierry Del Fiore
  2. Monday, 25 September 2023 07:52 AM UTC
HI Mark,

It's working. I was missing the TableCellStart() function.

Thanks for the sample code.

Best regards
  1. Helpful
  1. Mark Lee @Appeon
  2. Monday, 25 September 2023 08:16 AM UTC
You are welcome!

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 20 September 2023 16:02 PM UTC
  2. PowerBuilder
  3. # 1

Hi Thierry;

  Is this an RTE DWO working via a TableBlob style column?
Regards .. Chris

Comment
  1. Thierry Del Fiore
  2. Wednesday, 20 September 2023 16:08 PM UTC
Hi Chris,

No it's the RTE Control with new enhancements in PB2022R2 : TableInsert; TableInsertColumn; TableInsertDialog; TableInsertRows; TableDelete; TableDeleteColumn; TableDeleteColumns; TableDeleteRow; TableDeleteRows....



We have also tried the RTE in a tabular dw with TableBlob and edit "RTE". (by the way images in RTE don't appear in this field which is a problem).

But also how to handle the presentation ? We would need in the detail : RTE1 + Array of invoices + RTE2



Regards
  1. Helpful
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.