I want to generate an excel file using JasperReport iReport, i import data from postgres database, but i want to use two quesry under the same report, i don't wanna use a subreport because it cant respond to my need. The data should be organized like in the picture below
for that i created the report with the first query :
select ordre.ordre_ser , (ordre.id_personne, ordre.cts, ordre.htiers) ,CASEwhen ordre.htiers = 1then 'Heritiers de '::textelse ''::textEND|| (personne.nom_pers::text || ' '::text) || personne.prenom_pers::text||casewhen ordre.cts = 1then ' et CTS'::textelse ''::textEND AS lbl , adresse.lib_adresse , adresse.lib_adresse_ar, num_ordrefrom personne , ordre , adressewhere adresse.id_adresse = personne.id_adresse and personne.id_personne = ordre.id_personneorder by ordre.ordre_ser ;than i created a table with a new dataset with the second query :
select ordre.num_ordre , parcelle.code_parcelle , prop_dite.lbl_fr, prop_dite.lbl_ar , parcelle.surface_adop , mappe.mappe,(select array_to_string(array_agg(consistance.lib_consistance), '+'::text)from consistancewhere id_consistance in (select id_consistance from consist_parcelle where id_parcelle = parcelle.id_parcelle)) AS consistancefrom ordre , parcelle , prop_dite , mappe ,mappe_parcellewhere ordre.id_parcelle = parcelle.id_parcelle and prop_dite.id_prop = parcelle.id_propand mappe_parcelle.id_parcelle= parcelle.id_parcelle and mappe_parcelle.id_mappe= mappe.id_mappe and mappe_parcelle.priorite=0 and num_ordre = $P{num_ordre} ;but when i drop the field from a dataset and put it on the report they give me
Error : field code_parcelle doens't existthe fields framed on red in the picture above are the result of the first query, and on green for the second query
so how can i use this fields to generate the excel file?
any suggestions will be appreciated
أكثر...

for that i created the report with the first query :
select ordre.ordre_ser , (ordre.id_personne, ordre.cts, ordre.htiers) ,CASEwhen ordre.htiers = 1then 'Heritiers de '::textelse ''::textEND|| (personne.nom_pers::text || ' '::text) || personne.prenom_pers::text||casewhen ordre.cts = 1then ' et CTS'::textelse ''::textEND AS lbl , adresse.lib_adresse , adresse.lib_adresse_ar, num_ordrefrom personne , ordre , adressewhere adresse.id_adresse = personne.id_adresse and personne.id_personne = ordre.id_personneorder by ordre.ordre_ser ;than i created a table with a new dataset with the second query :
select ordre.num_ordre , parcelle.code_parcelle , prop_dite.lbl_fr, prop_dite.lbl_ar , parcelle.surface_adop , mappe.mappe,(select array_to_string(array_agg(consistance.lib_consistance), '+'::text)from consistancewhere id_consistance in (select id_consistance from consist_parcelle where id_parcelle = parcelle.id_parcelle)) AS consistancefrom ordre , parcelle , prop_dite , mappe ,mappe_parcellewhere ordre.id_parcelle = parcelle.id_parcelle and prop_dite.id_prop = parcelle.id_propand mappe_parcelle.id_parcelle= parcelle.id_parcelle and mappe_parcelle.id_mappe= mappe.id_mappe and mappe_parcelle.priorite=0 and num_ordre = $P{num_ordre} ;but when i drop the field from a dataset and put it on the report they give me
Error : field code_parcelle doens't existthe fields framed on red in the picture above are the result of the first query, and on green for the second query
so how can i use this fields to generate the excel file?
any suggestions will be appreciated
أكثر...