Selecting Easy Chart pens at runtime

Are you binding that query to the Pens dataSet of an Easy Chart?

[quote]Nathan, if I use your
Code:
SELECT * FROM pens WHERE false

statement to initialise the dynamic variable, I still get a “Query returned no rows” error.[/quote]

Also, for the size of your configuration, I would have one pens table that has an additional profile column. You will list each pen multiple times for different profiles. A given profile will be all rows (pens) with the same profile value. It wouldn’t be too bad to flex your SQL muscles textbook style with 2 tables (pens and pen_profile_mapping).

You could populate the dropdown list with a query like this:

SELECT DISTINCT profile FROM pens

Then use the WHERE clause and the technique you described above for binding to the selected value in a list.

So you should have a dynamic property query that’s a string, which is bound to an expression like this:

'SELECT * FROM pens WHERE profile =' + {Root Container.lstAvailableTrends.data}[{Root Container.lstAvailableTrends.selectedIndex},0]

Next protect from an unselected index. You might then wrap the expression in an if statement as shown below or use my above false condition with the OR as described above.

if ({Root Container.lstAvailableTrends.selectedIndex} != -1, myQuery, myAltQuery)

You then bind the Easy Chart’s Pens property query to that dynamic property.

{Root Container.query}

I haven’t figured out how you’re getting an error from returning no rows. The chart should just have no values.