Creating reports using qxorm

Forum for posting problems using QxOrm library

Creating reports using qxorm

Postby nickla » Sun Sep 30, 2012 7:31 pm

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.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Creating reports using qxorm

Postby qxorm » Tue Oct 02, 2012 10:44 am

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 !
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Creating reports using qxorm

Postby nickla » Mon Oct 08, 2012 5:52 pm

It works. I see it in qx::dump
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron