|
We have to fix it in core class for this issue. Because We will get REPORT_TITLE from generic method in renderJR at HttpSecureAppServlet class like below.
designParameters.put("REPORT_TITLE", PrintJRData.getReportTitle(this, variables.getLanguage(), classInfo.id);
Query For Report Title:
select COALESCE(t.name, m.name) AS paramname
FROM AD_Menu M LEFT JOIN AD_Menu_Trl t ON m.AD_Menu_ID = t.AD_Menu_ID
AND t.AD_Language = 'en_US' WHERE M.AD_Process_ID = '800146'
<<no records selected for reports/process which is not configured through Menu>>
The above report will work while click on print icon in the transaction window (Remittance).
Remittance Print Report/Process query to get process id:
select * from ad_process where ad_process_id='800146'
"800146";"0";"0";"Y";"2010-03-24 18:17:53.635099";"0";"2010-03-24 18:17:53.635099";"0";"RptC_Remittance";"Remittance printed";"Remittance printed";"Remittance printed";"3";"N";"";"Y";"N";"";"N";"N";"";"";"";"";"0";"M"
How to fix it:
If any Report/Process is not configured through menu, We have to get REPORT_TITLE from process name(from ad_process table), since that is null in menu(given process id won't be there in menu table). Since this is common across all Report/process which is not mapped/configured with menu. So We have to fix it in renderJR method level(available in HttpSecureAppServlet class).
I have attached diff for your review, since it is in HttpSecureAppServlet class. David advise me to assign this issue to platform team to push.
diff -r 610225e88ac0 src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Wed Mar 17 20:29:41 2010 +0100
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Thu Apr 08 20:44:18 2010 +0530
@@ -1083,8 +1083,12 @@
designParameters.put("USER_ORG", Utility.getContext(this, variables, "#User_Org", ""));
designParameters.put("LANGUAGE", strLanguage);
designParameters.put("LOCALE", locLocale);
- designParameters.put("REPORT_TITLE", PrintJRData.getReportTitle(this,
- variables.getLanguage(), classInfo.id));
+ String reportTitle = PrintJRData.getReportTitle(this, variables.getLanguage(), classInfo.id);
+ if (reportTitle == null) {
+ reportTitle = PrintJRData.getReportTitleFromProcess(this, variables.getLanguage(),
+ classInfo.id);
+ }
+ designParameters.put("REPORT_TITLE", reportTitle);
final DecimalFormatSymbols dfs = new DecimalFormatSymbols();
dfs.setDecimalSeparator(variables.getSessionValue("#AD_ReportDecimalSeparator").charAt(0));
diff -r 610225e88ac0 src/org/openbravo/erpCommon/utility/PrintJR_data.xsql
--- a/src/org/openbravo/erpCommon/utility/PrintJR_data.xsql Wed Mar 17 20:29:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/utility/PrintJR_data.xsql Thu Apr 08 20:44:18 2010 +0530
@@ -54,5 +54,16 @@
<Parameter name="adLanguage"/>
<Parameter name="adProcessId"/>
</SqlMethod>
+ <SqlMethod name="getReportTitleFromProcess" type="preparedStatement" return="String">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ select COALESCE(t.name, m.name) AS paramname
+ FROM AD_PROCESS m LEFT JOIN ad_process_trl t ON m.AD_Process_ID = t.AD_Process_ID
+ AND t.AD_Language = ?
+ WHERE m.AD_Process_ID = ?
+ </Sql>
+ <Parameter name="adLanguage"/>
+ <Parameter name="adProcessId"/>
+ </SqlMethod>
</SqlClass> |
|