Jump to content
Changes to the Jaspersoft community edition download ×

Adding a field to a query stops generating results


cru

Recommended Posts

Hello:

I have an ireport that generates data from a SQL Query, I needed to add a field in the report (another field from my table) and now I no longer get data - I get a message that the report is empty and aI cannot figure out why adding a field to a select would no longer generate the data for the report. I am using iReport 3.7.1, the strange thing is if I run the query within SQL I get data but when I try to generate the report I get the no data found.

The query is a bit long, however to understand below is the Original query that generates a report, all I need to do is add one field to the select statement: - I.UPROC_LABEL - When I add this field (it was added in the query and on the report layout) the report comes up with NO data. All I need is this extra field and I cannot figure out what I am doing wrong.

PLEASE any help will be GREATLY appreciated, I am pretty desperate.

Code:
Original Query.select d.NODE_NAME, l.MANAGEMENT_UNIT, l.SESSION_NAME, l.UPROC_NAME, l.UPROC_LAUNCH_NO,   (select count(ph_temp.PHASE_ID)   from UNI_REP_PHASES ph_temp inner join UNI_REP_STATUSES st_temp on ph_temp.STATUS_ID = st_temp.STATUS_ID   where ph_temp.LAUNCH_ID = p.LAUNCH_ID      and ph_temp.UPROC_EXEC_NO < p.UPROC_EXEC_NO      and st_temp.STATUS_CODE in ('T', 'I', 'R', 'O')  ) RELAUNCH_NO,   (convert(varchar(10), st_query.START_TIMESTAMP, 103) + ' ' + convert(varchar(8), st_query.START_TIMESTAMP, 108)) START_TIME,   (convert(varchar(10), p.START_TIMESTAMP, 103) + ' ' + convert(varchar(8), p.START_TIMESTAMP, 108)) FINAL_TIME,     s.STATUS_LABEL, oldest_ext.date_val OLDEST_EXT_DATE from UNI_REP_DATASOURCES d   inner join UNI_REP_LAUNCHES l on l.DATASOURCE_ID = d.DATASOURCE_ID   inner join UNI_REP_PHASES p on p.LAUNCH_ID = l.LAUNCH_ID   inner join UNI_REP_STATUSES s on p.STATUS_ID = s.STATUS_ID   inner join (    select ph_temp.START_TIMESTAMP, ph_temp.LAUNCH_ID, ph_temp.UPROC_EXEC_NO     from UNI_REP_PHASES ph_temp inner join UNI_REP_STATUSES st_temp on ph_temp.STATUS_ID = st_temp.STATUS_ID    where st_temp.STATUS_CODE = 'D'   ) st_query on st_query.LAUNCH_ID = l.LAUNCH_ID and st_query.UPROC_EXEC_NO = p.UPROC_EXEC_NO     inner join (    select count(*) cnt, ph_temp.LAUNCH_ID         from UNI_REP_PHASES ph_temp inner join UNI_REP_STATUSES st_temp on ph_temp.STATUS_ID = st_temp.STATUS_ID     where st_temp.STATUS_CODE in ('T', 'I', 'R', 'O')     group by ph_temp.LAUNCH_ID    ) rl on (rl.LAUNCH_ID = p.LAUNCH_ID)     and (((rl.cnt > 1) and ($P{ONLY_RELAUNCHED_JOBS} = 1)) or (($P{ONLY_RELAUNCHED_JOBS} = 0)))  inner join (    select convert(varchar(10), min(ee.START_TIMESTAMP), 103) + ' ' + convert(varchar(8), min(ee.START_TIMESTAMP), 108) date_val     from UNI_REP_EXTRACTIONS ee       inner join UNI_REP_DATASOURCES dd on ee.DATASOURCE_ID = dd.DATASOURCE_ID      inner join UNI_REP_LAUNCHES ll on ll.DATASOURCE_ID = dd.DATASOURCE_ID       inner join UNI_REP_PHASES pp on pp.LAUNCH_ID = ll.LAUNCH_ID       inner join UNI_REP_STATUSES ss on pp.STATUS_ID = ss.STATUS_ID     where dd.COMPANY = $P{COMPANY}      and (dd.NODE_NAME LIKE $P{NODES}          or charindex(','+dd.NODE_NAME+',', $P{NODES}) != 0)       and charindex(','+dd.AREA+',', $P{AREA}) != 0      and (pp.START_TIMESTAMP between convert(datetime, $P{START_DATE}, 103)                                   and convert(datetime, $P{END_DATE}, 103))      and ss.STATUS_CODE in ('T', 'I', 'R', 'O')             ) oldest_ext on 1 = 1where d.COMPANY = $P{COMPANY}    and (d.NODE_NAME LIKE $P{NODES}        or charindex(','+d.NODE_NAME+',', $P{NODES}) != 0)     and charindex(','+d.AREA+',', $P{AREA}) != 0    and (l.MANAGEMENT_UNIT like $P{MU}        or charindex(','+l.MANAGEMENT_UNIT+',', $P{MU}) != 0)    and (((l.APPLICATION is not null) and           (l.APPLICATION like $P{APPLICATION}              or charindex(','+l.APPLICATION+',', $P{APPLICATION}) != 0))         or ((l.APPLICATION is null) and ($P{APPLICATION} = '%')))        and (((l.SESSION_NAME is not null) and          (l.SESSION_NAME like $P{SESS}              or charindex(','+l.SESSION_NAME+',', $P{SESS}) != 0))         or ((l.SESSION_NAME is null) and ($P{SESS} = '%')))    and (l.UPROC_NAME like $P{UPROC}        or charindex(','+l.UPROC_NAME+',', $P{UPROC}) != 0)    and (p.START_TIMESTAMP between convert(datetime, $P{START_DATE}, 103)                                and convert(datetime, $P{END_DATE}, 103))    and s.STATUS_CODE in ('T', 'I', 'R', 'O')order by d.NODE_NAME, l.UPROC_LAUNCH_NO, RELAUNCH_NO, l.SESSION_NAME, l.UPROC_NAME, l.MANAGEMENT_UNIT
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...