Introduction
Based on the below json sample, I am trying to define a Telerik report using both a main report and a sub-report, where se second is fed with a subset of the main report json data.
Basically, data flow mimics something like:
- Application injects base json data into main report's jsonData(string) parameter;
- jsonData is binded as report datasource;
- Json data selector is applied;
- Json selected data Employes node is injected into a sub-report, which will also use it as a json data source.
Troubles arose on step 4, where I am getting an [Invalid value of report parameter 'jsonData'] error when main report is rendered.
It seems Telerik Report is unable to convert a selected json node field data into a proper string.
Full context
For full context:
On both reports:
There is a jsonData report parameter of string datatype;
There is a JsonDataSource defined;
Binding between the string jsonData parameter and main JsonDataSource is based upon:
- Property path: Datasource.Source
- Expression: = Parameters.jsonData.Value
On main report:
- JsonDatasource $.Companies data selector is being used, resulting in a list representing containing de the companies list, each instance having:
Name, a string representing the company name;
Employes, an object containing the company employes list.
- Full sample json data is injected thru jsonData parameter;
On sub-report:
- There is also a jsonData report parameter of string datatype;
- JsonDataSource $ data selector is being used, which should result in:
- A list of the following fields:
- Name, a string representing the name of the employe;
- Wage, a numeric value representing employe's wage.
- A list of the following fields:
Again on main-report, I am using the following sub-report parameters mapping:
- Parameter Name: jsonData
- Parameter Value: Fields.Employes
I am using Telerik Report Designer v15.1.21.716 (Desktop)
It seems that data selector converts json Employes node date into a System.Object[], which is giving me a nice hard time figuring out how to convert it back to a json string.
I have alread extensively searched on documentation, web, ChatGPT and alikes for a valid solution. So far, no luck.
Before you help me
Although I have the most appreciation for anyones effort trying to helping me:
- I am pursuing a json only data source solution. I mean, I am not interested on any other alternative suported Telerik Reporting datasources;
- Solution must work in both design-time and runtime.
{
"Companies": [
{
"Name": "Company1",
"Employes": [
{
"Name": "Joe",
"Wage": 1000
},
{
"Name": "Jack",
"Wage": 2000
}
]
},
{
"Name": "Company2",
"Employes": [
{
"Name": "Mary",
"Wage": 3000
},
{
"Name": "Mike",
"Wage": 4000
}
]
}
]
}