Implicit GrapeCity.ActiveReports.Document.Drawing.Font convertion not working i

Posted by: gerardo on 25 June 2024, 3:15 pm EST

    • Post Options:
    • Link

    Posted 25 June 2024, 3:15 pm EST - Updated 25 June 2024, 3:21 pm EST

    hello

    I’m migration an application from .Net4.7 framework to .Net8, which I understand is supported.

    The following error arised :

    Error (active)	CS0029	Cannot implicitly convert 
    type 'System.Drawing.Font' 
    to 'GrapeCity.ActiveReports.Document.Drawing.Font'	
    

    looks like the implicit convertors defined in

    MESCIUS.ActiveReports.Core.Document.4.4.0\lib\net462\MESCIUS.ActiveReports.Core.Document.dll

    are not available in mescius.activereports\18.1.0\lib\netcoreapp3.1\MESCIUS.ActiveReports.dll

    am I missing something for this code to target .Net8 successfully ?

  • Posted 26 June 2024, 3:53 am EST

    Hi Gerardo,

    This observation is because ActiveReports 17 and onwards has dropped it’s dependency on System.Drawing DLL from the code as a part of its Breaking Changes for cross-platform compatibility in Section Reports.

    You can fix this issue by using ‘GrapeCity.ActiveReports.Document.Drawing.Font’ instead of ‘System.Drawing.Font’. Please refer to the following code for reference:

    textbox1.Font = new GrapeCity.ActiveReports.Document.Drawing.Font("Arial", 14, GrapeCity.ActiveReports.Document.Drawing.FontStyle.Bold);
    
    

    You may also check the Breaking Changes in ActiveReports 17 here: Breaking Changes from ActiveReports 16 to ActiveReports 17

    We hope this helps!

    SRSample_18.zip

  • Posted 26 June 2024, 11:40 am EST - Updated 26 June 2024, 11:58 am EST

    thanks Katyayny,

    I see objects like GrapeCity.ActiveReports.SectionReportModel.Label

    have property Location of type System.Drawing.PointF

    how this case is handled platform in dependently?

  • Posted 27 June 2024, 1:41 am EST

    Hi Gerardo,

    As per Microsoft, System.Drawing.PointF is under System.Drawing.Primitives which is still supported in cross-platform mode. As per Microsoft, System.Drawing.Common is only supported on Windows. Classes like System.Drawing.Font and System.Drawing.Image have been removed from System.Drawing.Common by Microsoft, due to which we had to introduce classes like GrapeCity.ActiveReports.Document.Drawing.Font and GrapeCity.ActiveReports.Document.Drawing.Image to support cross-platform compatibility. Please note that we have removed dependency on System.Drawing from our code for functionalities such as image handling, text measuring, printing, etc.

    You may also refer to the attached documentations link referring to the same:

    We hope this helps!

Need extra support?

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

Learn More

Forum Channels