Hi,
Is there a way to save the excel file with so that the sheets will be right-to-left? (like in the image)
Thanks,
Vlady.
In OutSystems, especially in Reactive 11, the support for manipulating Excel files is quite basic and doesn't include advanced features such as setting the sheet orientation from right to left. However, you can configure this orientation directly in Excel after generating the file.
If you need to do this programmatically, a common approach would be to use external libraries to manipulate Excel files. In a .NET context, for example, you could use the EPPlus or ClosedXML library. Below is an example of how this could be done using EPPlus in C#:
using OfficeOpenXml;
using System.IO;
// Ensure that the license context is set correctly for the library
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
public void CreateExcelWithRTL()
{
var filePath = "Path/To/Your/File.xlsx";
using (ExcelPackage package = new ExcelPackage())
// Add a new worksheet
var worksheet = package.Workbook.Worksheets.Add("MySheet");
// Set the sheet orientation from right to left
worksheet.View.RightToLeft = true;
// Save the file
var file = new FileInfo(filePath);
package.SaveAs(file);
}
-------------------------
To use this code, you would need to add the EPPlus library to your project. This can be done using the NuGet Package Manager in Visual Studio, for example.
Steps to use EPPlus in Visual Studio:
After that, you can use the above code to create an Excel file with the sheet orientation set from right to left.
If you want to do this directly in OutSystems, you would need a custom extension that uses C# or another language compatible with the mentioned libraries to generate and configure the Excel file as desired.
Hi Vladislav
The component doesn't currently support it, but it seems like an easy add to the code.
I'll see about adding it soon when I get some more time to work on this again.
Hanno
Hi @Vladislav Fadeev,
Use the Workbook_SaveRightToLeft action (latest version of Advanced Excel from the Forge).
It takes your Workbook object, sets every worksheet to right-to-left view (columns running A→ from the right, like your screenshot), and returns the file in its BinaryData output — so you download that directly, no separate Workbook_GetBinaryData call needed.
Typical flow:
A couple of notes:
Hope this helps!