Compile report in Asp.Net Mvc Core

Stimulsoft Reports.NET discussion
alireza_s_84
Posts: 18
Joined: Fri Jan 27, 2017 4:43 am

Compile report in Asp.Net Mvc Core

Post 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
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

The compilation is not supported in the NET Core version.

Thank you.
keivan
Posts: 4
Joined: Tue Aug 13, 2019 11:18 am

Re: Compile report in Asp.Net Mvc Core

Post by keivan »

When do you add this feature ???
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post 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.
Ryan Robar
Posts: 22
Joined: Fri Sep 20, 2019 3:46 pm
Location: Canada

Re: Compile report in Asp.Net Mvc Core

Post by Ryan Robar »

Can you give an update on when the ability to compile reports will be available in .Net Core?
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

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

Thank you.
Ryan Robar
Posts: 22
Joined: Fri Sep 20, 2019 3:46 pm
Location: Canada

Re: Compile report in Asp.Net Mvc Core

Post by Ryan Robar »

I see that your latest releases have added support for .Net Core 3.0. Does that include support for compiling reports?
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Compile report in Asp.Net Mvc Core

Post by Andrew »

Hello,

No, it does not contain the compiling.

Thank you.
Ryan Robar
Posts: 22
Joined: Fri Sep 20, 2019 3:46 pm
Location: Canada

Re: Compile report in Asp.Net Mvc Core

Post 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.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply