# BAQRpt & QuickSearch Pass Silent Parameters to BAQ

**URL:** <https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915>\
**Category:** Feature Requests and Suggestions\
**Tags:** unicorn, pony, golden, worldchanging\
**Created:** [October 17, 2019, 6:54pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915 "2019-10-17T18:54:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 17, 2019, 6:54pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/1 "2019-10-17T18:54:24Z")

</div>

In addition to the previously requested feature:

> [@Dashboard Pass Silent Parameters to BAQ](https://www.epiusers.help/t/dashboard-pass-silent-parameters-to-baq/46319):
>
> A Feature asked for ages; never delivered by Epicor yet it seems like a simple one… In a Dashboard allow Passing in Parameters to the BAQ Before Execution so we can stop running wide-open BAQs which hammer the server because Post-Filtering is not the answer. Example: Click on Parent Grid and have the Child Re-Run BAQ with specific Params. So if you are doing lets say CTEs Recursive or Sub-Queries and SUM() and MAX() you will get “accurate” number with little effort because each time the BAQ wil…

We the developer community would extremely find it useful to do something similar to BAQ Reports and Quick Searches, so we can pass one of those Form Bindable fields to the BAQ before it runs. Just like Dashboards… BAQRpt’s BAQ Grabs 10,000,000 rows (lets say you have that many Jobs) and then filters it after execution, thats the only reason I try to avoid them BAQRpts and Quick Searches etc… all have to run wide-open and can’t bind to a param.

Lets say a Quick Search if I can atleast bind the text-box to a BAQ Param and then when user types “123” I can do a LIKE “@txtBox1%”

Right now the workaround is… Grab everything but go back only 1 maybe 2 years (date range) and its filtered when it hits the Report Server / RDL… But somewhere it still hit the Main Server for 10,000,000 rows (assuming large jobs table)

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [October 17, 2019, 9:07pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/2 "2019-10-17T21:07:46Z")

</div>

It’s been a while since I worked on reporting so most of those neurons have died. Maybe I’m misunderstanding, but I’m pretty sure you can use the user supplied values from the report UI to filter your BAQs. I know I tested passing an Order Number and having it only return the appropriate orders in the main and child BAQs.

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 17, 2019, 9:19pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/3 "2019-10-17T21:19:42Z")

</div>

Filter is post, it probably grabbed all your orders from SQL and then filtered? Im more thinking run the BAQ with the Order # specified

What do you put into your BAQ, or do you join on a special table that houses those variables

```sql
SELECT * FROM Erp.OrderHed
WHERE OrderNum = [?something]

```

Right now we have to let the BAQ run wide-open (with no WHERE) and the Filter will happen, but after the fact, so if you have 5 million Orders, it might take 3min.

```sql
SELECT * FROM Erp.OrderHed

```

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [October 17, 2019, 9:49pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/4 "2019-10-17T21:49:44Z")

</div>

> [@Dashboard Pass Silent Parameters to BAQ](https://www.epiusers.help/t/dashboard-pass-silent-parameters-to-baq/46319/55):
>
> Filter is post, it probably grabbed all your orders from SQL and then filtered? Im more thinking run the BAQ with the Order # specified

And you think that’s bad for Haso, imagine the Cloud Users!

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [October 17, 2019, 10:43pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/5 "2019-10-17T22:43:26Z")

</div>

Like I said, it’s been a while, but you set up your BAQ to have a parameter (through Actions/Design Parameters menu item). You then set up the filter:

 ![image](https://epiusers.help/uploads/default/original/3X/3/5/355f357071ac9212fb5fe53a76c956698b078f55.png)

The “SQL” generated by BAQ from the Phrase Builder looks like this:  
… normal SQL stuff …  
where (Tip.TipNum = @MyTipNum)

Search for “Add Criteria Mapping” in Epicor help and you should see this:

 ![image](https://epiusers.help/uploads/default/original/3X/2/6/26ed5a162fe3f88bc42129a39d53be65e0c976ae.png)

You hook up the control from the Criteria Set to hook up to that specific BAQ’s parameter and life is good. You can hook that up to multiple BAQs as well.

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 18, 2019, 12:35am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/6 "2019-10-18T00:35:08Z")

</div>

Jeff! Where have you been hiding! I dont know why I kept doing BAQ Reports still… This works almost as identical as a BAQ Report. I do recall you mentioning it before. Shame on me.

![image](https://epiusers.help/uploads/default/original/3X/6/4/642fb3e5be4798521ae89e3b97504a42068ca6c7.png)  
 ![image](https://epiusers.help/uploads/default/original/3X/9/6/96fd1405ec16f0ac3a2b8697a1625590357abe42.png)

Little bit harder to setup because you have to create a RDL from Scratch but in this one I just used “Sync DataSet” and it even brought over my Calculated Field MEOW  
 ![image](https://epiusers.help/uploads/default/original/3X/c/e/cedd546e556403fa1b9b1090225299e1549ab593.png)

 ![image](https://epiusers.help/uploads/default/original/3X/b/2/b20b3d02ec6b8583c0fe5db20b22f30f39583771.png)

The Help File guides you to use Base Definition, so I changed mine to SQL Server Reporting, I could Sync and Output types showed up. Nice!

 ![image](https://epiusers.help/uploads/default/original/3X/2/b/2b7f99522bc5cb512b3e6365ae50e7a525a22517.png)

You can mix also Filters into it and it will be stored in XML Format in RptParams Column UserCriteria, for me Sync Dataset didnt break it up but I found other Epicor Reports that show how to get your param value.

 ![image](https://epiusers.help/uploads/default/original/3X/e/c/ec85b1cccf0ebb34c44ceb9ff02a3d8ce6749533.png)

```sql
" CAST(CONVERT(XML,CAST(UserCriteria as varchar(max))).value('UICriteria[1]/RptCriteriaPrompt[PromptName=""LCNRVReport""][1]/PromptValue[1]','VARCHAR(10)') as bit) as LCNRVReport "+
" ,CAST(CONVERT(XML,CAST(UserCriteria as varchar(max))).value('UICriteria[1]/RptCriteriaPrompt[PromptName=""InactiveSalesItemsReport""][1]/PromptValue[1]','VARCHAR(10)') as bit) as InactiveSalesItemsReport "+
" ,CASE WHEN CAST(CONVERT(XML,CAST(UserCriteria as varchar(max))).value('UICriteria[1]/RptCriteriaPrompt[PromptName=""CalculationMethod""][1]/PromptValue[1]','VARCHAR(50)') as nvarchar(50))='Classes' THEN 1 ELSE 0 END as CalculationByClass"

```

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [October 18, 2019, 12:47am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/7 "2019-10-18T00:47:11Z")

</div>

I thought we agreed we would never to use “Sync Dataset”. ☹

If you build your RDD and then create your style in Report Style Maintenance, you can just do a Action\Create SSRS Report and it will create you the template report just like in BAQ Report. Plus, you get all the data columns are mapped in for you. It should only take a couple more clicks to do RDD + BAQs instead of BAQ Report.

There is no reason to use the old BAQ Report… ever… again…

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [October 18, 2019, 12:52am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/8 "2019-10-18T00:52:50Z")

</div>

Don’t forget you can use this for the “Electronic Compliance” reports as well. Build a couple BAQs, map them to XML, JSON or CVS output. Sweet!

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 18, 2019, 12:52am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/9 "2019-10-18T00:52:58Z")

</div>

Nice! I tried it in 400.10 got some Template Missing Error, but works fine in 500. Probably screwed up the TemplateReport.rdl or something 🙂  
 ![2019-10-17_2052](https://epiusers.help/uploads/default/original/3X/9/2/924bdf8a6c558347edec5b7e936a19ea9fc3be31.png)

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [October 18, 2019, 1:13am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/10 "2019-10-18T01:13:31Z")

</div>

If you need to get this to work for earlier versions, back to 10.1.600 (I think), you could try copying the ReportTemplate.rdl from your 500 CustomReports area. The file should be there so something probably just got mixed up.

Also check out the code in the \*.rdl created by Report Style Maintenance (also in the ReportTemplate.rdl). The methods help get criteria parameter values.

I’m so excited you are finally investigating this!

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 18, 2019, 1:19am UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/11 "2019-10-18T01:19:16Z")

</div>

> [@Dashboard Pass Silent Parameters to BAQ](https://www.epiusers.help/t/dashboard-pass-silent-parameters-to-baq/46319/62):
>
> The methods help get criteria parameter values.

Aha!! Found it in the Global Code, ok that makes it much easier than adding the XML Values to SELECT ❤ 😃

 ![image](https://www.epiusers.help/uploads/default/original/3X/0/a/0a0b6b96c4d0821ccaa35440ffdb84451d43ce41.png)

---

<div class="post-metadata">

**Author:** ![pferrington](https://www.epiusers.help/user_avatar/www.epiusers.help/pferrington/32/9723_2.png) [@pferrington](https://www.epiusers.help/u/pferrington)\
**Post date:** [October 18, 2019, 1:02pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/12 "2019-10-18T13:02:03Z")

</div>

So does this mean you are planning to withdraw the request for BAQ Report enahncement? Honestly one of my personal if I ever have time, is to gut BAQ report - keep the elements but have it do the RDD creation using the elements you have discovered here. I’d rather just get rid of it but it has been heavily used for years and that is rarely an option. Someday - that is bigger than a one dark night project.

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [October 18, 2019, 1:45pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/13 "2019-10-18T13:45:33Z")

</div>

I’m gonna merge the answer here to that request and mark it solved!  
Look at that you guys solved an enhancement request without even trying!!! WAY TO GO! 😆

---

<div class="post-metadata">

**Author:** ![Evan\_Purdy](https://www.epiusers.help/user_avatar/www.epiusers.help/evan_purdy/32/69101_2.png) [@Evan\_Purdy](https://www.epiusers.help/u/Evan_Purdy)\
**Post date:** [October 18, 2019, 1:53pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/14 "2019-10-18T13:53:41Z")

</div>

Wow, I did not realize you could make a BAQ report this way. I feel like I should convert the existing reports now…

---

<div class="post-metadata">

**Author:** ![hkeric.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/hkeric.wci/32/52019_2.png) [@hkeric.wci](https://www.epiusers.help/u/hkeric.wci)\
**Post date:** [October 18, 2019, 2:05pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/15 "2019-10-18T14:05:06Z")

</div>

> [@josecgomez](#):
>
> Look at that you guys solved an enhancement request without even trying!!

Stuff sometimes happens like this when @Bart_Elia lets @JeffLeBert out of the dark room basement dungeon. 😱 🙂

---

<div class="post-metadata">

**Author:** ![amaragni](https://www.epiusers.help/user_avatar/www.epiusers.help/amaragni/32/5766_2.png) [@amaragni](https://www.epiusers.help/u/amaragni)\
**Post date:** [November 26, 2019, 1:02pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/16 "2019-11-26T13:02:36Z")

</div>

how does one get the control data type to match up?  
i have a RDD/BAQ report and the criteria filter datatype is empty and read only - it does not match up to my criteria mapping field datatype which is nVarChar and pulled in from the BAQ  
TIA  
i then get this error

 ![Capture](https://epiusers.help/uploads/default/original/3X/e/9/e99282dca818397a3f3992579a4f2a83295df880.jpeg)

---

<div class="post-metadata">

**Author:** ![JeffLeBert](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@JeffLeBert](https://www.epiusers.help/u/JeffLeBert)\
**Post date:** [November 26, 2019, 2:58pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/17 "2019-11-26T14:58:32Z")

</div>

Whenever you have an error like this, please click the Detail buttons and copy/paste the text. Sometimes the extra information will tell us exactly what the problem is. At worst, it gives me a place to start looking.

Unfortunately, I didn’t work on the UI portion of this so I would have to spend a bunch of time to guess at the specifics of your issue and try to reproduce it.

---

<div class="post-metadata">

**Author:** ![amaragni](https://www.epiusers.help/user_avatar/www.epiusers.help/amaragni/32/5766_2.png) [@amaragni](https://www.epiusers.help/u/amaragni)\
**Post date:** [November 26, 2019, 3:51pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/18 "2019-11-26T15:51:08Z")

</div>

sure thing…  
Application Error

Exception caught in: Ice.Lib.EpiClientLib

# Error Detail

Message: Control ‘grdFilterList’ of type EpiUltraGrid has an invalid binding to view FilterList1.  
Program: Ice.Lib.EpiClientLib.dll  
Method: EventSetup

# Client Stack Trace

at Ice.Lib.Framework.EpiUltraGrid.EventSetup()  
at Ice.Lib.Framework.EpiUltraGrid.set\_EpiTransaction(IEpiTransaction value)  
at Ice.UI.Rpt.DynamicCriteriaReport.FilterListPanel.set\_ReportTrans(Transaction value)  
at Ice.UI.Rpt.DynamicCriteriaReport.FilterPanel.BuildFilterPanel(Int32 filterID, String viewName, RptCriteriaFilterRow filterRow, Transaction trans)  
at Ice.UI.Rpt.DynamicCriteriaReport.FilterPanel.AddCustomSheetToDockManager(RptCriteriaFilterRow filterRow, Transaction trans)  
at Ice.UI.Rpt.DynamicCriteriaReport.FilterPanel.BuildDynamicFilters(RptCriteriaDataDataSet dsReportCriteria, Transaction trans)  
at Ice.UI.Rpt.DynamicCriteriaReport.DynamicCriteriaReportForm.BuildUIControls()  
at Ice.UI.Rpt.DynamicCriteriaReport.DynamicCriteriaReportForm.OnLoad(EventArgs e)  
at System.Windows.Forms.Form.OnCreateControl()  
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)  
at System.Windows.Forms.Control.CreateControl()  
at System.Windows.Forms.Control.WmShowWindow(Message& m)  
at System.Windows.Forms.Control.WndProc(Message& m)  
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)  
at System.Windows.Forms.Form.WmShowWindow(Message& m)  
at System.Windows.Forms.Form.WndProc(Message& m)  
at Ice.Lib.Framework.EpiForm.WndProc(Message& message)

---

<div class="post-metadata">

**Author:** ![amaragni](https://www.epiusers.help/user_avatar/www.epiusers.help/amaragni/32/5766_2.png) [@amaragni](https://www.epiusers.help/u/amaragni)\
**Post date:** [November 26, 2019, 3:52pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/19 "2019-11-26T15:52:41Z")

</div>

and then i get this when i try to associate the filter in criteria mapping  
which basically is telling me they are different - but i am NOT able to adjust the filter type, and it IS nvarchar?

Business Layer Exception

Parameter data type is different than Control data type.

Exception caught in: Epicor.ServiceModel

# Error Detail

Description: Parameter data type is different than Control data type.  
Program: Ice.Services.BO.RptDataDef.dll  
Method: RptCriteriaMappingBeforeUpdate  
Line Number: 3365  
Column Number: 21

# Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)  
at Ice.Proxy.BO.RptDataDefImpl.Update(RptDataDefDataSet ds)  
at Ice.Adapters.RptDataDefAdapter.OnUpdate()  
at Ice.Lib.Framework.EpiBaseAdapter.Update()  
at Erp.UI.App.RptDataDefEntry.Transaction.Update()

---

<div class="post-metadata">

**Author:** ![amaragni](https://www.epiusers.help/user_avatar/www.epiusers.help/amaragni/32/5766_2.png) [@amaragni](https://www.epiusers.help/u/amaragni)\
**Post date:** [February 20, 2020, 3:09pm UTC](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915/20 "2020-02-20T15:09:17Z")

</div>

Thanks!

[Next page](https://www.epiusers.help/t/baqrpt-quicksearch-pass-silent-parameters-to-baq/60915.md?page=2)
