1. Jean-Christophe Crettenand
  2. PowerBuilder
  3. Thursday, 05 October 2017

Hello dear members of the Community !

My issue is the following :

I need to be able to save the content of a DW in a .xlsx format. We are using Excel 2013 and Excel 2016. I’m working with a version 12.1 of PowerBuilder and migrating it to PowerBuilder 2017.

The deadline we are facing is the “new” version of Microsoft Office suite.

 

Do I have to import/install a specific .dll for doing this (I red something about PBDWExcel12Interop115.dll for example) ? Where to find this library, where to install it and how ?

Here is the code that is working today (but with .xls).

What do you suggest to change/adapt ?

 

long                                    ll_rc

edi_w_planification_pip     lw_parent

 

PARENT.of_getparentwindow(lw_parent)

 

// REPERTOIRE TEMP

//----------------

// selon variable d'environnement

string                                                     ls_repertoire

ContextKeyword                                lcx_key

string                                                     ls_values[]

n_ds                                                       lds_details_bpc, lds_param_base

 

lds_details_bpc = CREATE n_ds

lds_details_bpc.DataObject = "d_edi_planif_pip_charge_bpc_det_exp_srv"

lds_details_bpc.of_settransObject(SQLCA)

lds_details_bpc.Retrieve( il_selected_organisme , lw_parent.of_getanpannee())

 

ll_rc = THIS.GetContextService("ContextKeyword", lcx_key)

ll_rc = lcx_key.GetContextKeyWords("TEMP", ls_values)

ls_repertoire = ls_values[1]

 

// NOM COMPLET DU FICHIER

//-----------------------

string                                      ls_filename, ls_datetime, ls_cellule, ls_plage

datetime                               ld_datetime

n_cst_string                           lnv_string

 

ld_datetime = DateTime(Today(), Now())

ls_datetime = string(ld_datetime)

 

ls_datetime = lnv_string.of_GlobalReplace(ls_datetime, ".", "-")

ls_datetime = lnv_string.of_GlobalReplace(ls_datetime, ":", "-")

 

ls_filename = ls_repertoire + &

                                                 "\e-DICS-" + &

                                                 ls_datetime + &

                                                 ".xls"

 

// EXTRACTION

ll_rc = lds_details_bpc.saveas(ls_filename, Excel8!, TRUE)

 

Marco Meoni Accepted Answer Pending Moderation
0
Votes
Undo

I personally love HTMLTable! format.

        dw_1.("sheet.xls", HTMLTable!, True)

Give a filename with xls extension and you'll also get (almost) all DW look&feel (alignment, font size and type, cells, etc...)

Cheers,

Marco

Comment
Marco hi ,



the problem with the html format is the dw fields are saved backwards .



Do you have any idea to fix it ?



Thanks

  1. Moshe Tangi
  2. Thursday, 12 October 2017
There are no comments made yet.
  1. Friday, 6 October 2017
  2. PowerBuilder
  3. # 1
René Ullrich Accepted Answer Pending Moderation
0
Votes
Undo

If you want to use the native export you can save in Excel 2007 format using the SaveAsType XLSX! (excel format for XML data) or XLSB! (excel format for binary data).

For Excel 2007 support you need to deploy the files PBDWExcel12Interop120.dll and Sybase.PowerBuilder.DataWindow.Excel12.dll that you can find in your local installation in directory Sybase\Shared\PowerBuilder. You may also use the Runtime Packager.

Excel 2007 export also requires .NET Framework 3.0 or later.

 

 

Comment
Thank you very much René. With you're answer my issue has been solved in 2'.



Best Regards

  1. Jean-Christophe Crettenand
  2. Thursday, 5 October 2017
In PB 2017, only PBDWExcel12Interop170.dll exists in Appeon\Shared\PowerBuilder (which I assume is the 32-bit version), whereas both that file and  Sybase.PowerBuilder.DataWindow.Excel12.dll exist in Appeon\Shared\PowerBuilder\x64. So what are we supposed to deploy if we are doing 32-bit deployments?

  1. Dan Cooperstock
  2. Thursday, 5 October 2017
Yes, it seems to be a bug in the deployment of PB 2017 MR. I have already created a bug ticket.

  1. René Ullrich
  2. Friday, 6 October 2017
There are no comments made yet.
  1. Thursday, 5 October 2017
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.