I have seen many articles that show how to use PreFiltering in SSRS with Sql query. They said to use CRMAF_[FilteredView] but didn't work for me and ever brings me the first Quote, not the current Quote.
I removed the sql query with CRMAF_ because it was not working well.
I have 3 DataSets
The main DataSet is this one:
SELECT
[produto].productid AS [productid]
,[produto].productnumber AS [productnumber]
,[produto].name AS [productname]
,[produto].description AS [description]
,[produto].smart_especificacaotecnica AS [productspecification]
,[produto].smart_buidname AS [BU]
,[produto].smart_especialidadesname AS [especialidade]
,[produto].ptr_representadaidname AS [representada]
,[produto].smart_gruponame AS [grupo]
,[produto].smart_subgruponame AS [subgrupo]
,[produto].smart_registroanvisa AS [registroanvisa]
,[produto].smart_lp_fabricantename AS [fabricante]
,[produto].ptr_ncm AS [ncm]
,[linha].priceperunit as [price]
,[linha].smart_valor_ipi as [ipi]
,[linha].smart_percentualipi as [percentualipi]
,[linha].smart_valor_unitario_ipi as [ipiunitario]
,[linha].tax as [tax]
,cast([linha].quantity as decimal) as [quantity]
,[produto].iskit as [explodir]
FROM
FilteredProduct AS [produto]
INNER JOIN
FilteredQuoteDetail AS [linha]
ON [produto].productid = [linha].productid
WHERE
[linha].quoteid = @quoteid