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, Nullable1 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.