Page 1 of 1

PostPosted: Tue Jul 11, 2006 7:35 am
by Aoirthoir
I took a brief look at I-Report and Jasper reports.

I think a lot of the things that a report writer is used for is already built into SQL. That is the query end of it. Totals. Things like that.

So I think at least some of the things can be done simply with smarty templates. At least in our case any LETTER based reports. Like a mail merge.

Now when we start to get to headers, footers, orders, invoices and so on...the question I have is, is it worth my time in that case to start to look at smarty itself. And if so, would that be easy enough to integrate into dataface?

Now those report writers look great. I am thinking from a users perspective. So maybe a report writer isnt exactly the thing to call what I am thinking about.

Like with smarty..I could set up a letter template. Call it to display a letter. But the contents of the letter, who it is addressed to, the date fields and so on and so forth, would all be content which would be taken from a table. (As far as I understand my brief reading thus far)?

So could smarty in many cases be used for reports?

Holler

PostPosted: Tue Jul 11, 2006 8:00 am
by Aoirthoir
Ah. I have to read the instructions on using custom smarty templates with dataface yet. I will go over it. My question is, since dataface v0.6 allows actions...is it possible to do an sql query and call a specific smarty template to display it? All from within dataface?

If so that right there is leaps and bounds towards what I personally need.

Next I would just have to do some php statements to replace codewords stored in a field with field values. (For isntance in a letter it is easy to have a field at the top for the Name and Address but if they want the name in the text of the letter I would have to do a replace on some tag they created to know that the name goes here..or whatever..

Also can these then perhaps be stored just as memo fields, using fckEdit and TinyMCE?

PostPosted: Tue Jul 11, 2006 10:51 am
by shannah
The answer to these questions is almost all 'yes'. Dataface has smarty at its core, and it even extends it to be even more powerful, as the tutorials will show.

Just to give you an idea of how this would work:

Your application has an actions.ini file where you define your action. It might look something like this:

[FormLetter]
label = Create report
description = Display report of the user's transactions
icon = myicon.gif
template = FormLetter.html
category = record_actions
permission = view
mode = details

Your application also has a templates directory where your FormLetter.html file would be located.

The "category" tells dataface which group of actions the action belongs to. If you want it to show up in the "Actions menu" the category would be "table_actions" for example.

If you need to do some php crunching first, then you could add an "actions" directory to your application and place a file named "FormLetter.php" in there with a class that follows certain conventions. This class would essentially handle the request, do some crunching, and display your template when called.


More on this very soon!