1. John Vanleeuwe
  2. PowerBuilder
  3. Sunday, 31 December 2017 14:09 PM UTC

Hi all,

First of all best wishes for 2018 !

 

I have to program the following functionality

- my customers receive a mail with excel sheet

- they want to open the excel

- use select , copy and then paste the contents of their selection in our pb application

- the selection will be for example invoicing records

- but each sender can have a different layout of the invoice records , one can have " description   quantity   price   vatcode" , while the second one can have "quantity price vatcode description" and so on

 

My questions

1) Normally i would use fileopen method , but in this case the customer doesn't want this, so i think i need to use the Clipboad Paste function to have the excel contents in my pb. Should i create an external datawindow with lets say 20 character columns that will receive the contents of the paste action ? will the contents be put in each column ?

3) how to take care of the fact that the columns can be in a random order ? how would you tackle this ?

 

TIA

John

mike S Accepted Answer Pending Moderation
  1. Sunday, 31 December 2017 19:51 PM UTC
  2. PowerBuilder
  3. # 1

use a grid datawindow.  the user moves the columns in the grid to match the order of the data in excel, then pastes the data in

Comment
  1. John Vanleeuwe
  2. Thursday, 4 January 2018 10:09 AM UTC
Hi Mike,



Thanks , this can work fine , good idea.



But how do we or PB know which column has the actual "description" or the quantity , the discount % , the kind of packages etc. ?



Is there a way of retrieving the first/second/third/... column name in the grid after the user has moved the columns please ?



 



TIA



John

  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.