Report with barcodes - Excel export

Posted by: petr on 11 January 2021, 6:17 am EST

  • Posted 11 January 2021, 6:17 am EST

    In AR14, I am not able to export report with barcodes into excel. In "Excel" version barcodes are not readable with scanner.

    I used the very same report in AR6 and it worked like a charm.

    Any idea?
  • Replied 12 January 2021, 3:42 am EST


    Could you please share which barcode type are you using? if possible, could you please share the stripped down report with dummy DB. So that I can replicate the issue at my end.

  • Replied 14 January 2021, 4:40 am EST


    I am using barcode with style = "Code_128auto". You can replicate the issue from attached project.

    It is just VS2019 / "create new project" / "Activereports 14 page Report Appliacation". My target framework is .NET Framework 4.8. Then, on "pageReport1.rdlx" is only one control - barcode control of course. Barcode1.value is hardcoded to something like 'psx|K8523|U4556' (similar codes we use in production environment), so I do not need a database at all.

    If I start project, barcode is displayed and optionally printed. Scanning is Ok.

    part 2 - basically taken from -you can see in form1_load

    Excel export is created, but it can not be scanned. I tried page reports and section reports - no luck.
  • Replied 20 January 2021, 2:06 am EST


    Thanks for the project. I am able to reproduce the issue at my end. I have escalated the issue to the development team(AR-25870) and will inform you once I get any information from them.


  • Marked as Answer

    Replied 20 February 2021, 6:06 pm EST


    I am glad to tell you that issue get fixed in the following build:

  • Replied 11 March 2021, 9:20 pm EST


    I came to know that your issue is still not fixed in the build shared. Can you please check after increasing the height of the barcode in the report like(1.54cm)

  • Replied 11 March 2021, 9:46 pm EST

    Still no luck. I have attached a little sample (printed from report, printed from excel, scanned to pdf).

    Even after printing and scanning I am able to capture "original" barcode with my scanner, but excel version is still bad.
  • Replied 12 March 2021, 1:27 am EST


    Could you please check with the attached file and share the result with us.

  • Replied 12 March 2021, 3:02 am EST

    Of course. I tried your report definition, and

    1) Print report directly - ok, I can scan barcode
    2) PDF & print - ok, I can scan barcode
    3) Excel & print - no luck.

    Sample attached:
  • Replied 14 March 2021, 2:41 pm EST


    Could you please check with attached xlsx file. I just exported your page report to Excel format and then print it in the PDF file.

    After that scan the barcode using the following site:

    you can also try with the latest build of AR14:

  • Replied 14 March 2021, 6:25 pm EST

    Even with 14.2.20842 I am not able to produce readable xlsx output. Using online service you suggested ( result is "No barcodes found on this page for the following selected barcode types:"
  • Replied 15 March 2021, 2:41 am EST


    There is something problem in the Exporting code. Could you please share the application so that I can use the exact code to export the report.

  • Replied 15 March 2021, 2:54 am EST

    Of course ...
  • Replied 15 March 2021, 2:55 am EST

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Viewer1.LoadDocument(Application.StartupPath + "\..\..\PageReport1.rdlx")

    'then export, see
    Dim rpt As New GrapeCity.ActiveReports.PageReport()
    rpt.Load(New System.IO.FileInfo(Application.StartupPath + "\..\..\PageReport1.rdlx"))
    Dim MyDocument As New GrapeCity.ActiveReports.Document.PageDocument(rpt)
    Dim XlsExport1 As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport()
    XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx
    XlsExport1.Export(MyDocument, Application.StartupPath + "\wrong_barcode.xlsx")

    ' Export the report in PDF format.
    Dim PdfExport1 As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport()
    PdfExport1.Export(MyDocument, Application.StartupPath + "\PDFExpt.pdf")

    End Sub
  • Replied 15 March 2021, 2:29 pm EST


    XlsExport is used to export the SectionReport not PageReport. Please use the following line of code to export the PageReport:
    Dim report As New GrapeCity.ActiveReports.PageReport()
    Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)

    ' Create an output directory.
    Dim outputDirectory As New System.IO.DirectoryInfo("C:\MyExcel")

    ' Provide settings for your rendering output.
    Dim excelSetting As New GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings()
    excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls
    Dim setting As GrapeCity.ActiveReports.Extensibility.Rendering.ISettings = excelSetting

    ' Set the rendering extension and render the report.
    Dim excelRenderingExtension As New GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension()
    Dim outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name))

    ' Overwrite output file if it already exists.
    outputProvider.OverwriteOutputFile = True

    reportDocument.Render(excelRenderingExtension, outputProvider, setting.GetSettings())

  • Replied 15 March 2021, 4:31 pm EST


    I tried your approach and again, it does not work. Excel file is created, I can export excel file to pdf, but it is not readable (you can try

    My project, xls and pdf are attached.


  • Replied 15 March 2021, 8:46 pm EST


    Can you please change the code
    excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xlsx

  • Replied 15 March 2021, 8:54 pm EST

    Yes, I can. And it does not work.
  • Replied 16 March 2021, 1:04 am EST


    I think there is version issue. Could you please check with the attached application.

  • Replied 16 March 2021, 1:58 am EST


    no version issue. Your version works exactly same way as my code. Moreover, I compared "your" and "my" packages.config and they are the same. Your code produces excel file, and barcode in this file is not readable with scanner (and is not recognised on as valid barcode ).

    I was able to extract png file containing barcode from xlsx file, attached.
  • Replied 16 March 2021, 3:44 pm EST

    Hello Peter,

    Request to please confirm are you able to scan the result with the file I shared with you or not?

    Please share the result with both:
    1: Attached PDF File.
    2:Printing the attached Excel File in PDF format.

Need extra support?

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

Learn More

Forum Channels