# Report Serch Condition Question

**URL:** <https://forum.inductiveautomation.com/t/report-serch-condition-question/9527>\
**Category:** Ignition\
**Created:** [January 12, 2015, 2:50pm UTC](https://forum.inductiveautomation.com/t/report-serch-condition-question/9527 "2015-01-12T14:50:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_t\_shoot](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Don\_t\_shoot](https://forum.inductiveautomation.com/u/Don_t_shoot)\
**Post date:** [January 12, 2015, 2:50pm UTC](https://forum.inductiveautomation.com/t/report-serch-condition-question/9527/1 "2015-01-12T14:50:57Z")

</div>

I want to create a report by using Report Viewer, and I want give user some condition to serch what they want . Like the picture in attachement ,I have three questions in the picture,thank all the friends !

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c5c6b663b0fb5c0ded551a2ff0f41120f80b52fb.png)

---

<div class="post-metadata">

**Author:** ![george](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/george/32/14066_2.png) [@george](https://forum.inductiveautomation.com/u/george)\
**Post date:** [January 16, 2015, 10:07am UTC](https://forum.inductiveautomation.com/t/report-serch-condition-question/9527/2 "2015-01-16T10:07:50Z")

</div>

For your production order list you’ll probably need to replace

```auto
SELECT OrderNo FROM ProductionOrders
```

with something like

`SELECT 'All'
UNION
SELECT OrderNo FROM ProductionOrders`

although it’s not always straightforward as (1) you may need to add an ORDER BY 1 or similar  
and (2) you may need a bit of extra code to deal with the case where All is selected (and basically not apply the filter).

What is the binding for your Data property currently?

---

<div class="post-metadata">

**Author:** ![Don\_t\_shoot](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Don\_t\_shoot](https://forum.inductiveautomation.com/u/Don_t_shoot)\
**Post date:** [January 18, 2015, 8:00am UTC](https://forum.inductiveautomation.com/t/report-serch-condition-question/9527/3 "2015-01-18T08:00:40Z")

</div>

Thanks for your help george.  
About the binding , the report had a analysis controller , and I gave it a binding by a select query as below .  
'"SELECT A.Name as Area,L.Name as Line ,W.WorkOrder AS WorkOrder,W.ProductCode AS PartNumber,P.Description AS Description,W.Quantity AS Quantity,S.ActualQuantity AS Produced ,(S.ActualQuantity / S.Quantity)\*100 AS CompletedPercentage ,S.FinishDateTime AS PlannedFinishDate,T.tooling1 AS ToolNumber  
FROM ign\_runtime.area A INNER JOIN ign\_runtime.line L INNER JOIN ign\_runtime.schedule S INNER JOIN ign\_runtime.workorder W INNER JOIN ign\_runtime.productcode P INNER JOIN ign\_mes.tooling T ON W.ProductCode=P.ProductCode and S.WorkOrderID=W.ID and A.ID=L.ParentID and L.ID=S.LineID and T.workOrder=W.WorkOrder

where S.FinishDateTime \>= ‘{Root Container.StartDate.date}’ AND  
S.FinishDateTime \<= ‘{Root Container.EndDate.date}’ AND  
L.Name=’{Root Container.Container 1.Production Line Selector .selectedLineName}’

order by S.FinishDateTime desc"

so the query is used for top five search conditions:‘report type’,‘area’,‘machine’,‘start date’ & ‘end date’, and the other 3 search conditions are my questions , about the ‘production order’, I used the ‘work order selector’ and biding it to the ‘selected line path’ of ‘machine’ search condition, I want the production order condition shows all work orders that the top 5 conditions had selected .  
so george, how can I use your query in this component ?  
And about ‘PartNum’ and ‘ToolNum’ , I don’t know which component should I use ?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cae4d543c211b20548c4961793890192c1da3c06.png)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2657477890f8b6ab04f6c743ea5acd91a526cda2.png)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9d1927835ec8c44ce18710005393a13ddf633a33.png)

---

<div class="post-metadata">

**Author:** ![Don\_t\_shoot](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@Don\_t\_shoot](https://forum.inductiveautomation.com/u/Don_t_shoot)\
**Post date:** [January 20, 2015, 7:46am UTC](https://forum.inductiveautomation.com/t/report-serch-condition-question/9527/4 "2015-01-20T07:46:00Z")

</div>

And about ‘PartNum’ and ‘ToolNum’ conditions, I also want to show their options list to select , is that good suggestion for them ? which component I can use ? And how to use it ? Thanks a lot my friends. 😆
