printing loan cards

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

printing loan cards

Postby samhans » Wed Feb 29, 2012 6:18 am

hai steve and all,
i have made a loan management system, where department head are issued with computer/peripherals in loan.
i have made the entire system using xataface. i am now stuck in a point that how could i make a loan card print out.

exactly in the loan card the name, department of the user and a list of computers or peripherals the user had held should be there. same what happens while booking tickets, a pre formatted page displays which a individual can take print out.

i am looking to the printable reports section but it is not making my conditions fullfilled.

can anyone suggest me something?
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: printing loan cards

Postby shannah » Wed Feb 29, 2012 10:52 am

The html reports module might be helpful here... but it requires Xataface 1.5 or higher (which isn't an official release.... it's just a tie down half way between 1.3.x and 2.0)
http://xataface.com/dox/modules/htmlreports/latest

Other than that you will likely need to create a custom function.

If you can create a static version of what you need, you can probably just put in some placeholders and do a find-replace on them to produce your output.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: printing loan cards

Postby samhans » Wed Feb 29, 2012 11:06 am

steve thanks for reply. the html reports functionality is good for.me but bad to know that it requires 1.5.

next you have told about custom function. can you elaborate it. onething is that i have made the template of loan card in html.what i need i the values got filed when some one gets printout. is it possible.through xataface
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: printing loan cards

Postby shannah » Wed Feb 29, 2012 11:12 am

Yes. Definitely possible in Xataface. You need to create a custom action:
http://xataface.com/documentation/tutor ... ce_actions
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: printing loan cards

Postby samhans » Wed Feb 29, 2012 11:43 am

Steve, i have used actions before. but i am thinking the other way. like can i make a form were one can select his employ id and click on submit. the moment he clicks on submit , a page opens that's my template with all values in it. now the question is can i define custom submit actions in xataface and also can i make.a.form in xataface manually .
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: printing loan cards

Postby shannah » Wed Feb 29, 2012 11:49 am

This is what custom actions are for.

Your action would probably be something like:

Code: Select all
<?php
class actions_loancard {

    function handle($params){

        $app = Datataface_Application::getInstance();
        $query = $app->getQuery();
        if ( $_POST ){
            // Output your loan card.
        } else {
            // Print the form.
            // Form just needs to be method "post" and should include a hidden field "-action" with value "loancard" so that it
            //  Will submit back to your action.
        }
    }
}

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: printing loan cards

Postby samhans » Wed Feb 29, 2012 12:05 pm

implementing your way. i will come back in some time
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 31 guests

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