Search code examples
c#fastreport.net-4.7

FastReport .Net C# load frx file with Map object


I use FastReport .Net Designer to create .frx file with all my Report definition, and then I load it to my c# code, I added a Map Object, I did run the Preview and the map is shown well.

But when I tried to load the .frx file from my c# code it throw the "Can't find Map object" exception.

My solution is .net4.7 and I'm with the latest FastReport Nuget package.

Note that once I remove the Map object it back to working good, the .frx is well loaded to my c# code and all is working (without a map of course)

My c# code which throw the exception:

var report = new Report();
report.Load(GetFrx(type));

Exception details:

Source: FastReport

Message: Can't find object MapObject

Stack Trace: at FastReport.Utils.FRReader.Read() at FastReport.Base.DeserializeSubItems(FRReader reader) at FastReport.Base.Deserialize(FRReader reader) at FastReport.ReportComponentBase.Deserialize(FRReader reader) at FastReport.Utils.FRReader.Read() at FastReport.Base.DeserializeSubItems(FRReader reader) at FastReport.Base.Deserialize(FRReader reader) at FastReport.Utils.FRReader.Read() at FastReport.Base.DeserializeSubItems(FRReader reader) at FastReport.Base.Deserialize(FRReader reader) at FastReport.Report.Deserialize(FRReader reader) at FastReport.Utils.FRReader.Read(IFRSerializable obj) at FastReport.Report.Load(Stream stream)


Solution

  • This is because you are probably using the free NuGet Package FastReport.OpenSource.Export.PdfSimple. PdfSimple is exporting the PDF pages as images which causes some limitations as well as the Map issue you mentioned. In order to solve your issue, you need to purchase and use the full FastReport.Net version. you can download the trial NuGet Package FastReport.Net.Demo and see that it will solve your issue.