Problem with Text Box (Text Item) on Reports parameter form in Reports 10g [message #291981] |
Mon, 07 January 2008 06:09 |
shahmayur
Messages: 22 Registered: November 2007 Location: London, UK
|
Junior Member |
|
|
I am facing a problem with text box (text item) on Reports parameter form in Reports 10g.
I have created a parameter (lets call it P_START) whose data type is date and it is being used in the query of the report. I am displaying this parameter on my parameter form to accept any valid date as an input from user.
Now to make life more easier for the user, I am populating SYSDATE as default value in P_START so that if the user wants to run the report for today's date, he doesn't have to type it. I have assigned SYSDATE to this parameter P_START in report's BEFORE PARAMETER FORM trigger.
When I run this report, the parameter form appears and the system date (SYSDATE) is populated in this field. Now if I change the date in this field
to any valid date, (for e.g. 31-Aug-2007 which I know its matching records exist in tables) and run the report, the repport is not showing any output meaning the query didn't fetch any records.
The good thing is I know the reason for this behavior. This is happening because even though I change the value of this date field, the actual value being passed to the query in report is not the one which I have entered but it is the default value (SYSDATE) which was populated in this field !! And the cause of this I found it in the source code of this Report Parameter form which (in Reports 9i/10g) is in fact a HTML page.
I got the HTML code of this parameter form by clicking on View -> Source menu item in IE browser. It reads like this:
<td colspan=5 rowspan=3><INPUT type=TEXT name="P_START" size=27 maxlength=11 value="07-Jan-2008"></td>
I suspect it is this (value="07-Jan-2008") piece of code which is causing this problem. This is because I am also displaying the value of this parameter in
the same report. And it shows the value as 07-Jan-2008 instead of 31-Aug-2007.
To prove my point, I removed the assignment of SYSDATE to this parameter P_START from the BEFORE PARAMETER FORM trigger. I then ran the report. This time in the parameter form, no value was populated in this text item. The HTML code was reading like this:
<td colspan=5 rowspan=3><INPUT type=TEXT name="P_START" size=27 maxlength=11 ></td>
You will immediately notice that the argument (value="07-Jan-2008") is not present in the above code.
I then entered the same date as before (which was 31-Aug-2007) and ran the report, it fetched the records !!
So my suspicion is correct. But any ideas why this is happening ? Is it a known issue or is it a bug ?
Please can anyone advise me how do I overcome this problem ?
My Reports Builder version is 10.1.2.0.2. It is running on Windows XP SP2.
Many thanks in advance.
Cheers
Mayur
|
|
|
|
Re: Problem with Text Box (Text Item) on Reports parameter form in Reports 10g [message #292002 is a reply to message #291992] |
Mon, 07 January 2008 07:18 |
shahmayur
Messages: 22 Registered: November 2007 Location: London, UK
|
Junior Member |
|
|
Hi Littlefoot
Many thanks for your quick response.
I have also assigned the SYSDATE to the parameter in the BEFOREPFORM trigger exactly the same way as you have shown.
I am generating report by REPORT_OBJECT method. I have created REPORT_OBJECT method in the form and I am using RUN_REPORT_OBJECT to generate the report and then WEB.SHOW_DOCUMENT to show the report in the browser.
I am facing this problem using the method described above.
If you want I can post the actual code of my Forms for you here.
Cheers
Mayur
|
|
|
|
|