Convert ImageData to ImageBytes in ActiveReports 16

Posted by: coolcliff on 18 May 2022, 11:46 am EST

    • Post Options:
    • Link

    Posted 18 May 2022, 11:46 am EST

    I have the following code in ActiveReports 12 in the Designer.vb file. I’m manually upgrading to ActiveReports 16 (because choosing the upgrade option from the Visual Studio menu isn’t working) and need to convert all instances of GrapeCity.ActiveReports.SectionReportModel.Picture controls in my reporting files to use ImageBytes instead of ImageData.

    The below is valid syntax but does not display the image in the Designer GUI. Any suggestions? ```

    Me.Picture1.ImageBytes = CType(resources.GetObject(“Picture1.ImageData”), Byte())

    
    

    Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ReportFile))

    '
    'Picture1
    '
    Me.Picture1.Height = 0.94!
    Me.Picture1.ImageData = CType(resources.GetObject("Picture1.ImageData"), System.IO.Stream)
    Me.Picture1.Left = 0.0!
    Me.Picture1.LineColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
    Me.Picture1.Name = "Picture1"
    Me.Picture1.SizeMode = GrapeCity.ActiveReports.SectionReportModel.SizeModes.Stretch
    Me.Picture1.Top = 0.0!
    Me.Picture1.Width = 7.94!
    
  • Posted 18 May 2022, 11:47 am EST

    The above code from my original post is how the Picture control is defined in the Designer.vb.

  • Posted 25 May 2022, 2:40 am EST

    Hello Bob!,

    Could you please let us know what issue are you facing with the upgrade tool in detail? Also please try reinstalling/repairing ActiveReports 16. Please note the upgrade tool will convert most of the project however some changes you might have to do manually. For more detail please refer to the following page of our documentation: https://www.grapecity.com/activereportsnet/docs/latest/online/migrating-version-6.html

    Also make sure your machine meets the following product requirements for ActiveReports 16: https://www.grapecity.com/activereportsnet/docs/latest/online/requirements.html

    And I have asked the development team for information converting ImageData to ImageBytes using code I will get back to you once I have any information from them.[For internal use: AR-28787]

  • Posted 26 May 2022, 7:19 am EST

    Hello Bob!

    After discussing this with the development team on this it seems the suggested way of converting ImageData to ImageBytes is to convert the report using the Visual Studio tool only.

    Let us know what issues you are facing with the Upgrade Tool in converting ActiveReports 6 reports so we can help you further on this. You can also share a sample ActiveReports 6 application replicating the issues so we can test for the issue on our end as well.

Need extra support?

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

Learn More

Forum Channels