We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug What's the correct way to access main and subs in Jasper Reports if there are multiple objects in JSON?
main
subs
$extension = 'pdf' ; $name = 'testeJasper'; $filename = $name . time(); $input = storage_path('app/public/relatorios/invoice.jasper'); $output = base_path('/public/reports/' . $filename); $array = [ [ "category_id" => "1", "category_name" => "Module that will allow the pmmed to create a template first before cascading the PIs to offices from VP's OPCR" ], [ "category_id" => "2", "category_name" => "Category 2" ], [ "category_id" => "3", "category_name" => "Category 3" ] ]; $subReportSource = [ ['program' => 'Higher', 'percentage' => '80%'], ['program' => 'Research', 'percentage' => '100%'], ]; $jsonArry = array('data' => ['main' => $array, 'subs' => $subReportSource ]); $jsonTmpfilePath = storage_path('app/public'). '/relatorios/json/' . $name . '.json'; $jsonTmpfile = fopen($jsonTmpfilePath, 'w'); fwrite($jsonTmpfile, json_encode($jsonArry)); fclose($jsonTmpfile); $datafile = $jsonTmpfilePath; $options = [ 'format' => ['pdf'], 'params' => [ 'msg' => "Display 101", 'storage_path' => storage_path(), ], 'locale' => 'en', 'db_connection' => [ 'driver' => 'json', 'data_file' => $datafile, 'json_query' => 'data' ] ];
I tried to put this in my main.jrxml
<queryString language="json"> <![CDATA[data.main]]> </queryString>
and this one in my subReport.jrxml
<queryString language="json"> <![CDATA[data.subs]]> </queryString>
I just keep on getting this error
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
What's the correct way to access
main
andsubs
in Jasper Reports if there are multiple objects in JSON?I tried to put this in my main.jrxml
and this one in my subReport.jrxml
I just keep on getting this error
The text was updated successfully, but these errors were encountered: