ggreen86 / XLSX-Workbook-Class

VFP Class to Create an XLSX Workbook without Excel Automation or Installed
45 stars 16 forks source link

how to set RTL and LTR in existing excel file #96

Closed RezaUzer closed 1 year ago

RezaUzer commented 1 year ago

Dear Greg,

You added support for Right-to-Left layout to the AddSheet method. i saw Release 39 Beta 11 for the change. But if I want to make this change in an existing Excel file, how should I do it?

I use the following commands to convert the grid to Excel. In this case, how do I turn the page right to left?

   LOCAL lcExcel, lnWB, lcSheet, loReturn

   lcExcel = "D:\sample01.xlsx"
   lcSheet = "sheet1"

   thisform.clsVFPxWorkbookXLSX.SaveGridToWorkbookEx(thisform.Grid1, lcExcel, .F., lcSheet)

   lnWB = thisform.clsVFPxWorkbookXLSX.OpenXLSXWorkbook(lcExcel)
   lnWS = thisform.clsVFPxWorkbookXLSX.GetSheetIndex(lnWB, lcSheet)

   AddRow = thisform.clsVFPxWorkbookXLSX.InsertRow(lnWB, lnWS, 1, "BEFORE")

   thisform.clsVFPxWorkbookXLSX.SaveWorkbook(lnWb)

   WAIT WINDOW "Saved To Excel" NOWAIT        
ggreen86 commented 1 year ago

I have added a new method for setting an existing sheet's R2L setting -- see method SetSheetRightToLeft(). Also, the SaveGridToWorkbook(), SaveGridToWorkbookEx(), SaveTableToWorkbook(), and SaveTableToWorkbookEx() methods have a new parameter added to support the Right-To-Left setting. Please see R39 Beta 12.