MySQL + Parameters

Stimulsoft Reports.Flex discussion
Locked
atzbit
Posts: 5
Joined: Wed Dec 01, 2010 7:45 am

MySQL + Parameters

Post 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


Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

MySQL + Parameters

Post by Vladimir »

Hello,

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

Thank you.
atzbit
Posts: 5
Joined: Wed Dec 01, 2010 7:45 am

MySQL + Parameters

Post by atzbit »

Thanks for your answer, try again with the next beta versions!
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

MySQL + Parameters

Post by Andrew »

Ok!

Have a nice day!
Aureo
Posts: 1
Joined: Wed Apr 27, 2011 7:58 am
Location: Leon, Gto.

MySQL + Parameters

Post by Aureo »

I need use parameters in SQL queries. Is Posible?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

MySQL + Parameters

Post 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.
Locked