Page 1 of 1

Creating reports using qxorm

PostPosted: Sun Sep 30, 2012 7:31 pm
by nickla
I want to create reports in my system. Report is some SELECT query with SQL functions like SUM and GROUP BY. This means that output field will be different then in my business objects. Query will be like this:

SELECT status.caption, SUM(orders.amout)
FROM orders
JOIN status ON orders.status_id = status.id
GROUP BY status.id


How can i execute such SELECT query and output results to client using qxorm?

I see only one way to solve this: create business object for this and fetch all data using qx_query into this object manually.

Re: Creating reports using qxorm

PostPosted: Tue Oct 02, 2012 10:44 am
by qxorm
Hi,

I see only one way to solve this: create business object for this and fetch all data using qx_query into this object manually.

"manually" ===> not !

There are 2 new functions with QxOrm 1.2.4, and the FAQ was updated when the version released.
You can read more details about those 2 new functions here : http://www.qxorm.com/qxorm_en/faq.html#faq_280

So, you can use qx::dao::execute_query<T>() function to resolve your problem => using this function, you don't have to fetch your object manually => it will be done automatically !

Re: Creating reports using qxorm

PostPosted: Mon Oct 08, 2012 5:52 pm
by nickla
It works. I see it in qx::dump