LoadPrepared throws ArgumentOutOfRangeException

i have a very simple report created using FastReport .NET v 2024.2.0 community edition.

When i try to generate the below code it throws error at report.LoadPrepared method.

Exception details

System.AggregateException: 'One or more errors occurred. (startIndex cannot be larger than length of string. (Parameter 'startIndex'))'

ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')

Here is the code.

 string epcdJsonString = File.ReadAllText(".\\ReportTemplate\\SampleJson.json");

 RegisteredObjects.AddConnection(typeof(JsonDataConnection));

 JsonDataSourceConnection jsonDataSourceConnection = new JsonDataSourceConnection();

 jsonDataSourceConnection.ConnectionString = epcdJsonString;

 jsonDataSourceConnection.CreateAllTables();

 Report report = new Report();

 report.LoadPrepared(".\\ReportTemplate\\TestReport.frx");

 report.Dictionary.Connections.Add(jsonDataSourceConnection);

 report.RegisterData(jsonDataSourceConnection.DataSet);

 report.Prepare();


What am i missing here.. the json structure is same as what i have used in the designer.

Note : I am able to preview the report properly in the designer.

Plus Validate Report does not show any error.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.