Hi
I have below code in Main Report. I have 2 parameters in Main Report. How i can pass these 2 parameters to Sub Report
SQL
SET @DocEntry = {?DocKey@}
IF @TipoObjeto = '112' -- Draft
BEGIN
SET @Tabela = 'DRF' -- Draft/Rascunhos - ODRF
END
ELSE
BEGIN
SET @Tabela = 'INV' -- Pedido de compra - O[TABELA]
ENDThanks

Mohammad HussainRank #513 · 4.8K reputationPosted Aug 20, 2023, 10:20 AM EDT
Please try this.
Main report:
Formula Name: strParams Formula: {@DocEntry} + "|" + {@TipoObjeto}
Subreport:
Parameter Name: strParams
Then in the subreport, parse the string to extract the values:
Local NumberVar docEntry; Local StringVar tipoObjeto;
docEntry := Split({?strParams}, "|")[1]; tipoObjeto := Split({?strParams}, "|")[2];
I hope it will help you. Thanks...
Cr BhargaviRank #420 · 5.9K reputationPosted Aug 20, 2023, 1:21 PM EDT