Welcome! Log In Create A New Profile

Advanced

[Solved] Re: Pass parameters to nested report

Posted by sivakrith 
[Solved] Re: Pass parameters to nested report
December 28, 2020 12:07PM
Hello,

I have a nested report within the main report. The nested report is based on the following query
***************************
SELECT b.usercode AS usercode,
a.totalweight AS totalweight,
a.amount AS amount
FROM js_transaction_detail a,
js_itemwise b
WHERE b.itemwisepk = a.itemnamefk
AND (
a.companycode = {Paramcompanycode}
AND a.branchcode = {Parambranchcode}
AND a.accountperiodid = {ParamPeriodID}
AND a.voucherseries = {ParamSeries}
AND a.voucherversion = {ParamVersion}
AND a.vouchernumber = {paramNumber}
AND a.vouchertype = {ParamVoucherType}
AND a.transactionindicator = {ParamTransactionIndicator}
)
*****************

******************************************************
-- Main Report Code: In 'BEFORE PRINTING END_BREAK1"

initReportQuery(RPT_Daybook_item_Breakup, "100", "100", 1, "INITMCUS", "001", 12, "C", "I")
iPrintReport(RPT_Daybook_item_Breakup)

* Value hardcode for clarity, in actual code, I pass the value from the main report
***********************

The above code doesn't retrieve any value for the nested report.

1. The query works fine when executed with the same hard-coded values.
2. Nested report prints when called without any parameter. like initReportQuery(RPT_Daybook_item_Breakup)
3. Nested report prints when called with only one parameter initReportQuery(RPT_Daybook_item_Breakup, "100")
4. Nothing gets printed when the 2nd parameter is added, like initReportQuery(RPT_Daybook_item_Breakup, "100", "100")

Looks like I'm missing something either in the design the of the nested report or in passing parameter to the nested report. Couldn't find what?

Any help is appreciated.

Happiness Always
BKR Sivaprakash

Solution: Order of passing parameter was the issue. Though I initially created in the correct order, later the order of parameter was changed in the query [due to a small correction by me]. Correcting the order in the query solved this issue.



Edited 1 time(s). Last edit at 12/29/2020 07:23AM by sivakrith.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: