Compile report in Asp.Net Mvc Core

Stimulsoft Reports.NET discussion
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 say if it will be implemented? Can I count on this feature coming to .Net Core eventually, or should I assume I will never be able to compile reports?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Compile report in Asp.Net Mvc Core

Post by HighAley »

Hello.

We could only suggest you to compile the report in WinForms or using the Standalone Designer.
Then you can add a report class to your .NET Core project.

We have plans to add compilation mode to .NET Core engine but can't write anything about ETA.

Thank you.
cmf
Posts: 4
Joined: Tue Jul 28, 2020 1:46 pm

Re: Compile report in Asp.Net Mvc Core

Post by cmf »

Hi!

Any update on this?
3 years have gone by since your initial statement that this would be supported in .Net Core, and it has now become urgent as more and more projects are using .Net Core instead of .Net Framework.

Is it possible to provide us an ETA?

Best regards,
José
cmf
Posts: 4
Joined: Tue Jul 28, 2020 1:46 pm

Re: Compile report in Asp.Net Mvc Core

Post by cmf »

Hi!

Any update on this?
3 years have gone by since your initial statement that this would be supported in .Net Core, and it has now become urgent as more and more projects are using .Net Core instead of .Net Framework.

Is it possible to provide us an ETA?

Best regards,
José
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

Unfortunately, still not implemented.

Thank you.
Volodymyr_Hensorskyi
Posts: 5
Joined: Mon Oct 14, 2019 2:42 pm

Re: Compile report in Asp.Net Mvc Core

Post by Volodymyr_Hensorskyi »

Hello,

Has the feature been implemented in 2020.4.1 build ?
Do you have any guidance on how to use reports saved as .cs in .NET Core (c#) ?

Best regards,
Volodymyr
Volodymyr_Hensorskyi
Posts: 5
Joined: Mon Oct 14, 2019 2:42 pm

Re: Compile report in Asp.Net Mvc Core

Post by Volodymyr_Hensorskyi »

Hello,

Quick update,
When I save report as .cs and then use it (I do not need to compile it, just add it to my project; Stimulsoft version used 2020.4.1):

Code: Select all

var report = StiReport.GetReportsFromAssembly(Assembly.GetExecutingAssembly())[0]; // just for a quick test. a report saved as .cs must be added to your project
report.Dictionary.Synchronize(); // seems to be required to setup connection to database
(report.Dictionary.Databases["Connection"] as StiSqlDatabase).ConnectionString = myConnString;
report.Dictionary.Variables[myVariableToUse.Name].ValueObject = myValue; //myValue is a List<string>. Report's variable type here is Stimulsoft.Report.StringList
report[myVariableToUse.Name] = myValue; //myValue is a List<string> //myValue is a List<string>. Report's variable type here is Stimulsoft.Report.StringList
// ... set up other variables in same way in foreach ...
report.Render(false);
report.ExportDocument(myFormat, memoryStream);
It all works fine when I run it in .NET Framework, but when I start it in .NET Core 3.1 all variables apart from StringList/IntList can be passed correctly, while StringList is not counted in rendered report.

Can you please confirm whether it's a bug in Stimulsoft or there's a workaround to deal with StringList/IntList variables in .NET Core?


Best regards,
Volodymyr
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

Please check the following code:

Code: Select all

report.Dictionary.Variables.Add(new StiVariable("", "Variable1", "Variable1", "", typeof(StringList), "", false, StiVariableInitBy.Value, true, new StiDialogInfo(StiDateTimeType.Date, "", true, new string[] {
                    "1",
                    "2"}, new string[] {
                    "1",
                    "2"}), null, false, StiSelectionMode.FromVariable));
viewtopic.php?t=55409

Thank you.
Volodymyr_Hensorskyi
Posts: 5
Joined: Mon Oct 14, 2019 2:42 pm

Re: Compile report in Asp.Net Mvc Core

Post by Volodymyr_Hensorskyi »

Lech Kulikowski,

Thanks for the hint, but how your code should help with the mentioned issue? Can you be more specific what is the trick here if there's any?

Quick update: For instance, in .NET Core during report.Render(false) StringList/IntList variables сleared up. Therefore, they aren't passed properly (while the same code runs fine in .NET Framework)

var us = report["UserTypeSelect"]; // Count = 1
report.Render(false);
var us2 = report["UserTypeSelect"]; // Count = 0 in .NET Core and Count = 1 in .NET Framework

PLEASE, raise this bug internally ASAP

Thanks
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: Compile report in Asp.Net Mvc Core

Post by Lech Kulikowski »

Hello,

Please try to set the following option:
StiOptions.Engine.ForceInterpretationMode = false;

Thank you.
Post Reply