Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

report error due to report parameters section

SOLVED
Go to solution
Highlighted
Sascha_1
Member

report error due to report parameters section

Hello,

 

i built a report (jsp report), which will use some parameters for filtering. The two parameters are Created From and Created To. Both are using the validation "Date", (format: long).

 

If i submit the report without or with the filter fields, the report output is fine. But using filter fields, the report should show you the filter in the output html. Therefore i will use the report parameter section:

 

<%-- -------------------------------------- report Parameters section ------------------------------- --%>
<div class="params1 pageWidth"></div>
<div class="leftPadding5 txtClrSoft pageWidth" >
<div class="txtHeading"><rpt:resource name="REPORT_PARAMETERS.TXT" />
<rpt:resource name="FOR.TXT" bundleName="KCRX_Resources" />
  <rpt:resource name="REPORT_NO.TXT" /><c:out value="${REPORT_ID}" /></div>

<c:if test="${not empty VP_TIME_PERIOD_FROM}"><rpt:resource name="TIME_PERIOD_FROM.TXT " bundleName="KCRX_Resources"/> - <c:out value="${VP_TIME_PERIOD_FROM}"  />; </c:if>
<c:if test="${not empty VP_TIME_PERIOD_TO}"><rpt:resource name="TIME_PERIOD_TO.TXT " bundleName="KCRX_Resources" /> - <c:out value="${VP_TIME_PERIOD_TO}" />; </c:if>

 

<b> <rpt:resource name="FILTER_BY.TXT" />:</b>
<c:if test="${not empty P_CREATED_FROM}">
  <c:set var="CREATE_FROM" value="${P_CREATED_FROM}" />
  <rpt:resource name="TIME_PERIOD_FROM.TXT" />: 
  <rpt:formatDate value="${CREATE_FROM}" type="String" dateFormat="medium" timeFormat="none" />
  <%-- c:out value="${CREATE_FROM}" / --%>;
</c:if>
<c:if test="${not empty P_CREATED_TO}">
  <c:set var="CREATE_TO" value="${P_CREATED_TO}" />
  <rpt:resource name="TIME_PERIOD_TO.TXT"  />:
  <rpt:formatDate value="${CREATE_TO}" type="String" dateFormat="medium" timeFormat="none" />
  <%-- c:out value="${CREATE_TO}" / --%>;
</c:if>

  <br>
</div>
<div class="params2 pageWidth"></div>
<%-- -------------------------------------- end of report Parameters section ------------------------------- --%>

 

But if i use this section or filter i always get the following error message:

Error running report.

(Cleaning up any partial report output...)HTTP response:500 - java.text.ParseException: Unparseable date: "2010-10-01 00:00:00"

 

It looks like the system cannot format the date in parameter P_CREATED_FROM, or?

I also tried some other combinations like (type="String" dateFormat="medium" timeFormat="medium" or type="String" dateFormat="long" timeFormat="long") but still the same error.

 

Regards,

Sascha

3 REPLIES
Utkarsh_Mishra
Honored Contributor

Re: report error due to report parameters section

Hi Sascha,

 

For dates you need to try like this.

 

Example -

 

<c:set var="bDate" scope="session">
<fmt:parseDate value="${fn:substring(BEGIN_DATE,0,10)}" type="DATE" pattern="yyyy-MM-dd" var="bformatedDate"/>
<fmt:formatDate value="${bformatedDate}" type="DATE" pattern="yyyy-MM-dd"/>
</c:set>

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Sascha_1
Member

Re: report error due to report parameters section

Hi Utkarsh,

 

now i changed the report section to:

 

<b> <rpt:resource name="FILTER_BY.TXT" />:</b>
<c:if test="${not empty P_CREATED_FROM}">
<c:set var="bDate" scope="session">
<fmt:parseDate value="${fn:substring(P_CREATED_FROM,0,10)}" type="DATE" pattern="yyyy-MM-dd" var="bformatedDate"/>
<fmt:formatDate value="${bformatedDate}" type="DATE" pattern="yyyy-MM-dd"/>
</c:set>
  <%-- c:out value="${bformatedDate}" / --%>

 

But now i get the following error message: The attribute prefix fn does not correspond to any imported tag library
It looks like I have to bind an additional library.

Please can you send me the more information?

 

Regards,

Sascha

Utkarsh_Mishra
Honored Contributor
Solution

Re: report error due to report parameters section

Include these taglib in your report

 

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
//Add this to "OnDomLoad" event