Page 1 of 3

Compile report in Asp.Net Mvc Core

Posted: Sun Jan 27, 2019 5:41 pm
by alireza_s_84
Hi
We use below code to compile report at runtime:

Code: Select all

report = new StiReport();
var data = System.IO.File.ReadAllBytes(StiNetCoreHelper.MapPath(this, "Reports/WeaponStatus.mrt"));
report.Load(data);
report.ReferencedAssemblies = new List<string>(report.ReferencedAssemblies)
    .Where(x => !x.Equals("System.Windows.Forms.Dll"))
    .ToArray();

report.Script = report.Script.Replace("using System.Windows.Forms;", "");
Directory.CreateDirectory(folder);
report.Compile(compiledReportFile);

but at last line when call report.Compile get this exception:
System.NotSupportedException
HResult=0x80131515
Message='DateTimeConverter' is unable to convert 'System.DateTime' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.
Source=System.ComponentModel.TypeConverter
StackTrace:
at System.ComponentModel.TypeConverter.GetConvertToException(Object value, Type destinationType)
at System.ComponentModel.TypeConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)
at System.ComponentModel.DateTimeConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.GetArgumentsWithParent(Type type, Object value, Object parentValue)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.GetObjectCreateExpressionWithParent(Type type, CodeTypeReference createType, Object value, Object parentValue)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.GetObjectCreateExpressionWithParent(Type type, Object value, Object parentValue)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.AddCreate(Int32 index, String parent, Object value, String name, Type type, Boolean isList)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.SerializeProps(StiPropertyInfoCollection props, Boolean isList, String parentName, String referenceName)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.Serialize(StiReport report, String name, StiLanguage language, Boolean serializeData, Boolean saveForInheritedReports, Object standaloneReportType)
at Stimulsoft.Report.StiReport.ScriptUpdate(Object standaloneReportType, Boolean allowUseResources)
at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate, Object standaloneReportType)
at Stimulsoft.Report.StiReport.Compile(String path)
at WebApplication.Controllers.ReportsController.GetReport(String id) in C:\Users\Alireza\Desktop\Web\WebApplication\Controllers\ReportsController.cs:line 59
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
Stimul Ver: 2019.1.1
OS: Win 10
.Net Core Ver: 2.2.100

Re: Compile report in Asp.Net Mvc Core

Posted: Mon Jan 28, 2019 11:40 pm
by Lech Kulikowski
Hello,

The compilation is not supported in the NET Core version.

Thank you.

Re: Compile report in Asp.Net Mvc Core

Posted: Tue Aug 13, 2019 11:26 am
by keivan
When do you add this feature ???

Re: Compile report in Asp.Net Mvc Core

Posted: Thu Aug 15, 2019 6:49 am
by Lech Kulikowski
Hello,

There is the task in our to-do list, but I can not say when it will be added.

Thank you.

Re: Compile report in Asp.Net Mvc Core

Posted: Mon Sep 30, 2019 6:11 pm
by Ryan Robar
Can you give an update on when the ability to compile reports will be available in .Net Core?

Re: Compile report in Asp.Net Mvc Core

Posted: Tue Oct 01, 2019 9:18 pm
by Lech Kulikowski
Hello,

Unfortunately, we can not say when it will be implemented.

Thank you.

Re: Compile report in Asp.Net Mvc Core

Posted: Wed Jan 15, 2020 8:21 pm
by Ryan Robar
I see that your latest releases have added support for .Net Core 3.0. Does that include support for compiling reports?

Re: Compile report in Asp.Net Mvc Core

Posted: Fri Jan 17, 2020 8:00 am
by Andrew
Hello,

No, it does not contain the compiling.

Thank you.

Re: Compile report in Asp.Net Mvc Core

Posted: Fri Jan 17, 2020 12:28 pm
by Ryan Robar
Is there any plan to add this feature to .Net Core in the future? If so, when? We would like to use Stimulsoft Reports as a replacement for our existing reporting solution, but I think it might be too difficult to do without the ability to compile code into the report.
It's especially frustrating because using your tools to convert our existing reports into Stimulsoft generates C# code in the report which I then have to find ways to remove so we can actually use it.

Re: Compile report in Asp.Net Mvc Core

Posted: Mon Jan 20, 2020 7:44 am
by Lech Kulikowski
Hello,

Unfortunately, we can not say when it will be implemented.

Thank you.