When calling StiReport.GetReportFromAssembly(assembly) located in "Stimulsoft.Report.SL.dll", an InvalidCastException is raised with the following error message:
"Unable to cast object of type 'System.Object[]' to type 'Stimulsoft.Report.StiReport[]'."
I took a look at the code, and it seems that the problem is because of an invalid cast from ArrayList to StiReport[]:
public static StiReport[] GetReportsFromAssembly(Assembly assembly)
{
try
{
ArrayList list = new ArrayList();
foreach (Type type in assembly.GetTypes())
{
if (type.IsSubclassOf(typeof(StiReport)))
{
StiReport item = StiActivator.CreateObject(type) as StiReport;
item.ApplyStyles();
list.Add(item);
}
}
return (StiReport[]) list.ToArray();
}
catch
{
if (!HideExceptions)
{
throw;
}
}
return null;
}
It seems this problem only exists in silverlight version, because in the "Stimulsoft.Report.dll" assembly the cast seems to be applied correctlly:
return (StiReport[]) list.ToArray(typeof(StiReport));
Thank you in advance.
Exception when calling StiReport.GetReportFromAssembly(assembly)
-
- Posts: 135
- Joined: Tue Aug 11, 2009 9:38 am
Exception when calling StiReport.GetReportFromAssembly(assembly)
Hello,
The problem is fixed. The patch is available in prerelease build of on 18 August 2011.
Thank you.
The problem is fixed. The patch is available in prerelease build of on 18 August 2011.
Thank you.
Exception when calling StiReport.GetReportFromAssembly(assembly)
OK, I'll check it out.
Thank you for your support.
Thank you for your support.
Exception when calling StiReport.GetReportFromAssembly(assembly)
Ok!
Let us know if you have additional questions.
Thank you.
Let us know if you have additional questions.
Thank you.