Prepare throws exception
I am using open source version and trying to create a simple report (.fpx) from a template I created using the community designer (.frx). I want to be able to create an frx file but launch that report from my program substituting data having same schema but filtered by my user. My frx file just connects to a sql server instance and displays selected fields from a table using a SQL query like (select a,b,c from table1). The preview in the designer looks fine.
Then in my VB.Net program (FR installed using latest version in Nuget) I want to convert the frx to fpx so that I can display it using the community viewer. My pseudocode looks like this:
dim report as new fastreport.report
report.load(frxname)
(create datatable dt containing identical data as used in frx)
report.registerdata(dt,"MyTable")
if report.prepare then report.saveprepared(fpxname)
At the report.prepare statement I get this error: System.TypeLoadException: 'Method 'GetLineMappings' in type 'ParsedSyntaxTree' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.'
I suspect that the Nuget package version has incompatible referenced libraries. I tried to roll back to older versions but got different errors each time.
Thanks in advance,
Chris
Comments
I am using the latest version 2023.1.13. Can someone please tell me if you've successfully executed report.prepare in your project? Maybe there is something wrong with my data table used in registerdata. I'm assuming that I just have to prepare a datatable having the same schema as the table used to create the frx file.
Thanks
To fix this I needed to install the Nuget package for my data provider and also the package for the latest CodeAnalysis.CSharp library. I recommend that you add that as a dependency in the Nuget package.
I had to install the most recent CodeAnalysis.CSharp library package as well as the Nuget package for my data provider in order to resolve this. I suggest including that in the Nuget package as a dependency. geometry dash