Excel reporting broken?

Has something changed recently with the Excel reporting engine. After upgrading from 9.63 to 24.1 our reports are running "successfully" but are not returning any data. While debugging I see that the simple method works:

${ppmdb.execQuery('SELECT username FROM KNTA_USERS WHERE ROWNUM<=100')}

...but this one no longer works:

${{ params = new("java.util.ArrayList");
sql = "SELECT username FROM KNTA_USERS WHERE ROWNUM<=100";
results = ppmdb.execQuery(sql, params.toArray());
return '';
}}

No errors are generated, and the sql statement built (our code is more complex) is fine. Just 0 rows are ever returned to the report.

  • 0  

    Hi Erik,

    There's only two changes/issues that I can think could have an impact:

    1) There's a security measure that will prevent you from retrieving the "password" column of table KNTA_USERS. So if you try to run "select * from knta_users" you might run into trouble. However, that's not the case in your sample code above, as you're only retrieving "username" column. So I doubt this is your problem.

    2) There's a known issue in PPM 24.1 that excel reports will expose the columns of SQL query results only if you retrieve them using capital letters for the column names. So, if you have a variable "result" that iterate the results returned above, you would access username with ${record.USERNAME}, but ${records.username} would be empty. This has been fixed in 24.2 and I think that there's a hotfix available from support on 24.1. However, in what you stated above, no results are returned and it's like the second block is never executed - which is a different issue. 

    - Would it be possible for you to share your excel template, or preferrably a simplified version that still exposes the problem? 

    - Do you spot any error/stacktraces in PPM Server Logs when running this Excel Report?

  • 0 in reply to   

    Thanks for the response. #2 seems the most relevant. Although I am using caps, and the report log seems to indicate that it's returning rows, I don;t get them in the output. I'll enclose my template I'm using to debug with, and the resulting report output. Here's the log entry:

    2024-06-05 09:38:32.367: Start executing Timed Command com.kintana.rpt.server.KSCRunExcelReportCommand
    Running report rm/0000report.xlsx
    Looking for template in: /ppmshared/excel_templates/rm/0000report.xlsx - Template file found.
    Performance info for Report Report 370961
    Report 370961 : 474 ms
    Parsing command : 0 ms
    Preparing Data : 5 ms
    Generating Excel Document : 462 ms
    Filling Excel Template : 442 ms
    Running SQL 'SELECT username FROM KNTA_USERS WHERE ROWNUM<...' (100 records) : 12 ms
    Writing XSLX file : 18 ms

    2024-06-05 09:38:32.840: Finish executing Timed Command com.kintana.rpt.server.KSCRunExcelReportCommand0000report.xlsxrep_370963.xlsx

  • Verified Answer

    +1   in reply to 

    Hi Erik,

    Your template works fine for me (PPM 24.3 work-in-progress), which implies that the problem you're experiencing is the one that should have been fixed in 24.2.

    You can easily validate this by adding a line with some text after your <ft:forEach line in the template - it should be pushed down depending on how may rows gets returned by your query - and thus demonstrate that the only problem is that you cannot retrieve the values of the SQL query results.

    Maybe you can also try to write the column in lower-case - but in any case, please try to open a support ticket to get the hotfix for this issue on your PPM version.

    Of course, upgrading PPM to the latest version would be both a solution and is considered a good practice, however, for some reason this is rarely the preferred option to fix problems Slight smile

  • 0 in reply to   

    Etienne,

    You're right...if I place some text in there it does get repeated for each "invisible" row returned by the query.

    Do you by chance know the hotfix number? I will say we are eagerly awaiting 24.3 because of some security items that we are mandated to resolve by September.

    Thanks!

  • Suggested Answer

    0   in reply to 

    Hi Erik,

    There's no formal hotfix number at the moment, but you can open a Support Ticket and instruct the support engineer to retrieve the Troubleshooting Hotfix attached to PPM R&D Issue 1423414 .

  • Suggested Answer

    0   in reply to 

    Hi Erik,

    There's no formal hotfix number at the moment, but you can open a Support Ticket and instruct the support engineer to retrieve the Troubleshooting Hotfix attached to PPM R&D Issue 1423414 .