Page 1 of 1

MySQL + Parameters

Posted: Wed Dec 01, 2010 8:29 am
by atzbit
I am new to this forum and I'm trying the version for Flex (2010.3), reading the posts I was able to solve the problems of Security Violation
but I found nothing that explains how to pass parameters of a query at run-time.

In Report Designer I've defined a connection to MySQL and a datasource "Contacts" with this query:

Code: Select all

select * from contacts where name like @param1
In Datasource I also defined a parameter: Name = param1, size = 0, Type = ?

In Flex Builder I have this code:

Code: Select all

private function onLoadComplete(event: Event): void
{
	var loader: URLLoader = event.target as URLLoader;
	reportString = loader.data as String;
	var report: StiReport = new StiReport();
	report.loadReportFromString(reportString);
	report.dictionary.dataSources.getByName("Contacts").parameters.getByName("param1").value = "a%";
	report.show();
}
Result: Report is empty

Can anyone help me or post an example?

Thanks



MySQL + Parameters

Posted: Wed Dec 01, 2010 9:33 am
by Vladimir
Hello,

Unfortunately, Reports.Fx for Flex does not support parameters in SQL queries. We plan to implement them during December.

Thank you.

MySQL + Parameters

Posted: Thu Dec 02, 2010 5:15 am
by atzbit
Thanks for your answer, try again with the next beta versions!

MySQL + Parameters

Posted: Thu Dec 02, 2010 8:00 am
by Andrew
Ok!

Have a nice day!

MySQL + Parameters

Posted: Wed Apr 27, 2011 8:04 am
by Aureo
I need use parameters in SQL queries. Is Posible?

MySQL + Parameters

Posted: Thu Apr 28, 2011 1:03 am
by Vladimir
Hello,

Yes, it is possible. You can use the report variables in SQL queries. To do this you need to create a variable and define it in the SQL query as an expression:

SELECT * FROM Table1 WHERE id = {Variable1}

Thank you.