AR v15.1 Script compile error on Linux

Posted by: bval on 11 May 2021, 4:46 am EST

    • Post Options:
    • Link

    Posted 11 May 2021, 4:46 am EST

    Hello

    Could you please assist with the script compile exception?

    I run Section Report with the script like here:

    public void Detail_Format()
    {
    	bool isLab = false;
    	bool isMic = false;
    	bool isBB = false;
    
    	GrapeCity.ActiveReports.DataSources.XMLDataSource ds;
    	ds = ((GrapeCity.ActiveReports.DataSources.XMLDataSource) (rpt.DataSource));
    	System.Xml.XmlNodeList nodes = (System.Xml.XmlNodeList) ds.Field("LAB", true);
    	if (null != nodes && nodes.Count > 0) {
    		isLab = true;
    	}
    	nodes = (System.Xml.XmlNodeList) ds.Field("MIC", true);
    	if (null != nodes && nodes.Count > 0) {
    		isMic = true;
    	}
    	nodes = (System.Xml.XmlNodeList) ds.Field("BB", true);
    	if (null != nodes && nodes.Count > 0) {
    		isBB = true;
    	}
    	((PageBreak) rpt.Sections["Detail"].Controls["PageBreakLM"]).Enabled = (isLab && isMic);
    	((PageBreak) rpt.Sections["Detail"].Controls["PageBreakMB"]).Enabled = (isMic && isBB || isLab && isBB);
    
    }
    

    When the report is run on Windows, everything is fine.

    But when I run it on Linux I get an exception:

    Script compile error

    GrapeCity.ActiveReports.ReportScriptException: Report Script Compile Error on line 3:

    The type name ‘XmlNodeList’ could not be found in the namespace ‘System.Xml’. This type has been forwarded to assembly ‘System.Private.Xml, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ Consider adding a reference to that assembly.

    Report Script Compile Error on line 4:

    The type name ‘XmlNodeList’ could not be found in the namespace ‘System.Xml’. This type has been forwarded to assembly ‘System.Private.Xml, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ Consider adding a reference to that assembly.

    at GrapeCity.ActiveReports.Internal.??.CheckErrors(String source, IEnumerable

    1 results, Nullable
    1 globalcodeline, Nullable
    1 namedItemLine, IList
    1 expressionLineList)

    at GrapeCity.ActiveReports.Internal.??.Compile()

    at GrapeCity.ActiveReports.Internal.??.ExecuteMethod(String methodName, Object parameters, Boolean& success)

    at GrapeCity.ActiveReports.SectionReport.ProcessInit(Boolean bDelayedInit)

    at GrapeCity.ActiveReports.SectionReport.RunImpl(Boolean syncDocument)

    at GrapeCity.ActiveReports.SectionReport.Run(Boolean syncDocument)

    Is there any ability to fix the exception? we have a lot of reports which use System.Xml.

    Thank you.

  • Posted 13 May 2021, 2:33 pm EST

    Hello,

    Can you please refer to the solution in the following link:

    https://stackoverflow.com/questions/43416871/dot-net-core-system-xml-xmlnode-not-found

    Thanks,

    Mohit

  • Posted 16 December 2021, 8:27 am EST

    Hello

    It’didn’t help. System.Xml shouldn’t be located in application folder in .net 5.0. It’s a part of .net framework.

    Helped only calling function SectionReport.AddScriptReference()

    Like:

    AddScriptReference(typeof(XmlNodeList).Assembly.Location);

Need extra support?

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

Learn More

Forum Channels