Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
ExcelExporter - Increase Margin Indent
posted

i am trying to indent the first column after the ultragrid is exported to excel using excelexporter.

If i use indentation, the bands are moved to new cells to the right.

i am trying to increase the margin between the border and the text cell.

how can i do this in excel exporter or ultragrid?

Thanks

Parents
No Data
Reply
  • 2005
    Verified Answer
    Offline posted

    Hi Fatih,

    You use WorksheetCell.CellFormat.Indent as showing in the code snippet below:

    using (exporter = new UltraGridexporter())
    {
       exporter.ExportEnding += (sender, args) =>
       {
          foreach (WorksheetRow worksheetRow in args.CurrentWorksheet.Rows)
          {
             if (worksheetRow.OutlineLevel > 0)
             {
                WorksheetCell cell = worksheetRow.Cells[0];
                if (cell.Value != null)
                   cell.CellFormat.Indent = worksheetRow.OutlineLevel;
             }
          }
       };
       // add other event handlers
       exporter.Export(ultraGrid, filePath, WorkbookFormat.Excel2007);
    }

    Best Regards,
    Shaolin

Children
No Data