33
Views
3
Comments
[Advanced Excel] How to save excel sheet right to left
advanced-excel
Service icon
Forge asset by Carlos Freitas
Application Type
Service
Service Studio Version
11.54.40 (Build 63053)

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.

2023-09-19 19-26-44
Josias Ramos Pinto
AI Generated

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:

  1. Open Visual Studio and your project.
  2. Go to the "NuGet Package Manager" in the "Tools" menu.
  3. Select "Manage NuGet Packages for Solution".
  4. Search for EPPlus and install it.

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.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2025-09-25 22-50-38
Hanno

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

2025-09-02 13-37-45
Ricardo Monteiro

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:

  1. Workbook_Open / Workbook_Create and write your data as usual.
  2. Call Workbook_SaveRightToLeft(Workbook) → use the BinaryData output as your download.

A couple of notes:

  • It applies RTL to all worksheets in the workbook.
  • The workbook stays usable afterward, so you can keep working with it if needed.

Hope this helps!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.