Setting up reporting

A place for users and developers of the Xataface to discuss and receive support.

Postby fbermudez » Sun Aug 27, 2006 2:27 pm

I've pretty much done all the set up required as far as tables, permissions, etc... and get the application to run stable... And I can tell, from my experience, maybe not the widest, that this is one hell of a solution for most us...

However, even though I've struggled a few days over this, I would appreciatte a bit of guidance.

I have two other thing to work on, and I would like your opinion on the best way to go about it...

1 - I need to have my users copy a given list of records, changing in all of them just the date field, and afterwards, if needed they can edit them individually. It's just the same as the Dataface standard option of "deleting the selected records" but copying them instead. ÀShould I go with creating an action for this, which will call an html to get the new date or is there a better way???
If we go to the Widgetery example, it would be like copying the attendace from one day to another, and then just editing the records thet would need it.

2 - I need to set up a certain mumber of multiple table reports... I Have the SQL for them, but I have two holes... First, I'm thinking to set up a table with a record for each report, with the SQL in a field and a URL to redirect for the results. And second, sorry, but I haven't figured out yet how I can use the "toHtml" method that I find in many Dataface's PHP...
ÀAm I working in the right direction or are there better or more Dataface proper ways to do it?

If you can guide me and give me a clue of where in the Documentation I could find this, I would appreciate very much...

Thanks

FB
fbermudez
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Aug 28, 2006 10:36 am

For #1, creating a new record is indeed the best way to do this.

For #2, This is an interesting idea.

If you created a table called 'reports' where each record had an SQL query, then dataface could work with this table the same as it works with any other table.

You could override the view tab of this table to display the results of the SQL query stored in the current record by adding the block__view_tab_content() method to the delegate class as follows:

Code: Select all
class tables_reporting {
    function block__view_tab_content(){
        $app =& Dataface_Application::getInstance();
        $report =& $app->getRecord();
        if ( isset($report) ){
            $res = mysql_query($report->val('sql'), $app->db());
           
            // now that you have performed the query... iterate through
            // the results and print them.
        }
    }
}



The output of this method will be displayed in the view tab of the reports table.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved