Jump to content

Baffled in Ohio


confutatis

Recommended Posts

Hello again, folks,

I developed a report in JS Studio.  All the fields display on the report (they are all simple string fields) when I do the preview in Studio.  When I publish the report to the server and run it, one of the fields in the detail line is showing NULL instead of the value.  Here is the query I am using (SQLITE):


/* CMO Payee Activity - Month Summary */

select
    'CMO' as report_total_group,
    pye.payeename as payee_name,
    tb_collect.curOrPast_month_year,
        
    sum(tb_collect.transamount) as act_amount

from
    (select
        dmc_vw.transdate,
                
        strftime('%m%Y',dmc_vw.transdate) as curOrPast_month_year,
                    
        (case when dmc_vw.payeeid = -1 and lower(dmc_vw.transcode) = 'transfer' then
            (case when (lower(act1.accounttype) = 'credit card' or lower(act1.accessinfo = 'sav')) then
                act1.accountpayeeid
            else
                (case when strftime('%Y', dmc_vw.transdate) = strftime('%Y', 'now') then
                    act1.accountpayeeid
                else
                    (select
                        trp.payeeid 
                        
                    from 
                        transfer_payeeid trp 
                        
                    where 
                        trp.accountid = dmc_vw.toaccountid 
                        and dmc_vw.transdate between trp.active_from and ifnull(trp.active_to, date()))
                end) 
            end)
        else
            dmc_vw.payeeid end) as payee_id,
            
        dmc_vw.transamount

    from
        dmc_vw
        
        left join accountlist_v1 act
            on act.accountid = dmc_vw.accountid

        left join accountlist_v1 act1
            on act1.accountid = dmc_vw.toaccountid
                        
    where
        strftime('%m%Y', dmc_vw.transdate) =  $P{userRequestedMonthYear}) tb_collect
                    
    left join payee_v1 pye
        on pye.payeeid = tb_collect.payee_id

--------------------------------------------------------------------------------------------------------------------------

The field that displays fine in Studio is "tb_collect.curOrPast_month_year", but appears as a NULL display on the JS Server.  Any ideas?

Regards,

David in OH

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

Actually, I found the issue.  If you look at the SQL code, notice that I use "dot" reference for one of the fields which is created in a inner query called "tb_collect".  The field referenced is " tb_collect.curOrPast_month_year".  Once I added an "as", that is " tb_collect.curOrPast_month_year as curOrPast_month_year", the field appeared in the report.  Is there anything I can do to get around having to add the "as", because I do a lot of this in my report code.

Regards,

David in OH

Link to comment
Share on other sites

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...