Export to Excel in AR 11 not aligning the headers properly

Posted by: sivagangakala on 2 February 2018, 7:47 am EST

    • Post Options:
    • Link

    Posted 2 February 2018, 7:47 am EST

    HI,

    We have a client who used Active Reports 6, where they have a report having labels as headers with center alignment. When they export to excel and pdf it worked fine with proper alignment.

    But, they recently upgraded the report to AR11 and after which the export to PDF worked fine, but export to excel is losing the alignment. They had all their headers center aligned in the report, bug the excel export is aligning it to the left (which was working fine with AR6).

    I have attached a zip file containing the RDF, PDF output and XLS output.

    Here is the code snippet that we use to export to excel. Please let me know if anything is missing here.

    GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XLSEx = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();

    this.WebRptViewer.Export(XLSEx, new System.IO.FileInfo(export_file_name));

    Thanks.,

    Siva G

    Sample1.zip

  • Posted 2 February 2018, 7:51 am EST

    Just to add, the export to excel also worked fine with proper alignments in AR6, but fails after upgrading to AR11.

    In the attachment, you could see that PDF file is properly having center alignment for headers but the XLS file is not.

  • Posted 5 February 2018, 12:55 am EST

    Hello,

    In order to achieve your requirement, you need to set “UseCellMerging” property of “XlsExport” to true. Please use following line of code.

    XLSEx.UseCellMerging = true;
    

    Hope it helps.

    Thanks,

    Mohit

  • Posted 8 February 2018, 12:15 am EST

    Thanks Mohit. This worked fine after setting the UseCellMerging property to true.

    But my question here is, when we were on AR6, we did not use this property and it worked fine without setting it. Any reason why we need to use it for AR11? Any advantage we have over AR6?

  • Posted 9 February 2018, 3:33 am EST

    Hello,

    There is a lot of code changed in ExcelExport function throughout the year. Also, there are several improvements in AR11 like some new features, performance improvements. You can refer the following link:

    http://help.grapecity.com/activereports/webhelp/AR11/index.html#Excel.html

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels