Passing Parameter From Form to Report [message #378556] |
Tue, 30 December 2008 23:32 |
|
Hi,
I am working on a form where i need to print a Sales Order Report. To do that i am calling a predifined report after presseing the Save button. I have written the following code to run the report along with the parameter passing through form:
declare
al_button number;
pl_id ParamList;
begin
pl_id := Get_Parameter_List('repPara'); --create a parameter list
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
pl_id := Create_Parameter_List('repPara');
Add_Parameter(pl_id, 'PARAMFORM',TEXT_PARAMETER, 'NO');
Add_Parameter(pl_id, 'P_DO_NO',TEXT_PARAMETER, :Master_SALES.Do_Number); --passing inv_no as parameter
Add_Parameter(pl_id, 'P_DO_DATE',TEXT_PARAMETER, :MAster_SALES.Do_DATE); --passing inv_date as parameter
Run_Product(REPORTS, 'E:\Do_dcmbl Forms\REPORTS\DO_Food_Portrait', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
end;
But the problem is that the report is showing nothing, it seems that parameter value doesn't match with the existing data. What to do now?
|
|
|
|
Re: Passing Parameter From Form to Report [message #378574 is a reply to message #378556] |
Wed, 31 December 2008 00:30 |
|
Thanks for the reply. Report is running using the same parameter values but not showing any data, such that the parameter values doesn't match with the existing values stored in the DB. For your convinient i am attaching the .rdf file which i am calling from form. Please take a look and try to give a suggestion. Thanks in advance.
|
|
|
|
|
|
|
Re: Passing Parameter From Form to Report [message #378651 is a reply to message #378556] |
Wed, 31 December 2008 04:01 |
|
Hi,
The problem is in the parameter P_DO_DATE i have assign the date format as DD-MM-YYYY. and from the form i am sending the :MASTER_SALES.DO_DATE as a DD-MM-YYYY, While sending the parameter value to the report it shows 12-31-0008. What to do now, It showing something which i didn't write anywhere.
|
|
|
|
|
|
Re: Passing Parameter From Form to Report [message #378678 is a reply to message #378556] |
Wed, 31 December 2008 05:12 |
|
Which Queries? The one that i have used in report? I am really having fun working on such a silly mistakes don't know where and yet no results, but i truely appreciate your effort on helping me. Let me show you the queries that i have written for the report.
SQL> SELECT DISTINCT vsf.MRR_NO, vsf.MRR_DATE, vsf.DO_NO,
2 vsf.DO_DATE, vsf.DEPO_NAME, vsf.DISTRIBUTOR_NAME, vsf.ADDRESS
3 FROM V_DO_SALES vsf
4 WHERE (vsf.DO_NO = :P_DO_NO
5 AND vsf.DO_DATE = :P_DO_DATE);
Bind variable "P_DO_DATE" not declared.
SQL> /
Bind variable "P_DO_DATE" not declared.
SQL>
SQL>
SQL> SELECT DISTINCT vsf.PRODUCT_QUANTITY, vsf.PIECES,
2 vsf.PRODUCT_NAME, vsf.SL_NO, vsf.INV_RATE, vsf.SALES_AMOUNT
3 FROM V_DO_SALES vsf
4 WHERE (vsf.DO_NO = :P_DO_NO
5 AND vsf.DO_DATE = :P_DO_DATE);
Bind variable "P_DO_DATE" not declared.
SQL> SELECT DISTINCT NUMTOCHAR_PACK(SUM(VSF.PRODUCT_QUANTITY)) DISPLAY_COL1, NUMTOCHAR_PIECES(SUM(VS
F.PIECES)) DISPLAY_COL2,
2 SUM(VSF.PIECES) DISPLAY_COL3
3 FROM V_DO_SALES VSF
4 WHERE (VSF.DO_DATE = :P_DO_DATE
5 AND VSF.DO_NO = :P_DO_NO);
Bind variable "P_DO_NO" not declared.
SQL>
Guess you are looking for this. Otherwise let me know.
Thanks
|
|
|
|
Re: Passing Parameter From Form to Report [message #378681 is a reply to message #378556] |
Wed, 31 December 2008 05:30 |
|
Well, I have got three queries after varifying the query No. 1 I have got the following errors:
SQL> SELECT DISTINCT vsf.MRR_NO, vsf.MRR_DATE, vsf.DO_NO,
2 vsf.DO_DATE, vsf.DEPO_NAME, vsf.DISTRIBUTOR_NAME, vsf.ADDRESS
3 FROM V_DO_SALES vsf
4 WHERE (vsf.DO_NO = &P_DO_NO
5 AND vsf.DO_DATE = &P_DO_DATE);
Enter value for p_do_no: 114
old 4: WHERE (vsf.DO_NO = &P_DO_NO
new 4: WHERE (vsf.DO_NO = 114
Enter value for p_do_date: 31-12-2008
old 5: AND vsf.DO_DATE = &P_DO_DATE)
new 5: AND vsf.DO_DATE = 31-12-2008)
AND vsf.DO_DATE = 31-12-2008)
*
ERROR at line 5:
ORA-00932: inconsistent datatypes: expected DATE got NUMBER
|
|
|
|
|
|