DBIx::SQLCrosstab::Format 1.17 review

Download
by rbytes.net on

DBIx::SQLCrosstab::Format is a Perl module with formats results created by DBIx::SQLCrosstab. SYNOPSIS use DBIx::SQLCrossta

License: Perl Artistic License
File size: 65K
Developer: DBIx::SQLCrosstab::Format Team
0 stars award from rbytes.net

DBIx::SQLCrosstab::Format is a Perl module with formats results created by DBIx::SQLCrosstab.

SYNOPSIS

use DBIx::SQLCrosstab::Format;
my $dbh=DBI->connect("dbi:driver:database"
"user","password", {RaiseError=>1})
or die "error in connection $DBI::errstrn";

my $params = {
dbh => $dbh,
op => [ [ 'SUM', 'salary'] ],
from => 'person INNER JOIN departments USING (dept_id)',
rows => [
{ col => 'country'},
],
cols => [
{
id => 'dept',
value =>'department',
from =>'departments'
},
{
id => 'gender', from => 'person'
}
]
};
my $xtab = DBIx::SQLCrosstab::Format->new($params)
or die "error in creation ($DBIx::SQLCrosstab::errstr)n";

my $query = $xtab->get_query("#")
or die "error in query building $DBIx::SQLCrosstab::errstrn";

if ( $xtab->get_recs) {
# do something with records, or use a built-in function
# to produce a well formatted HTML table
#
print $xtab->as_html;

print $xtab->as_xml;
print $xtab->as_yaml;
print $xtab->as_csv('header');
$xtab->as_xls("xtab.xls");
use Data::Dumper;
print Data::Dumper->Dump ([ $xtab->as_perl_struct('hoh')],
['hoh']);
print Data::Dumper->Dump ([ $xtab->as_perl_struct('losh')],
['losh']);
print Data::Dumper->Dump ([ $xtab->as_perl_struct('loh')],
['loh']);
}
else {
die "error in execution $DBIx::SQLCrosstab::errstrn";
}

DBIx::SQLCrosstab::Format is a class descending from DBIx::SQLCrosstab. Being a child class, it inherits its parent methods and can be used in the same way.

In addition, it provides methods to produce formatted output.

Requirements:
Perl

What's New in This Release:
Embedding completely refactored by Michael Gray.
$w->embed( $e, @widgets) embeds into the supplied element.
New Fieldset element.
Can add elements to Fieldset elements, as an alternative to using embed.
New $w->xhtml_strict accessor. When true, doesn't allow non-block elements at the top-level of a form.
New $w->legend accessor. Sets the label for the top-level fieldset.
process() is now called for embedded widgets.
After form submission, $result->as_xml() no longer uses an elements' default value if that field wasn't submitted.
Removed In constraint change added in v1.08 (in which validate automatically passed an empty in() list)
Select elements no longer automatically get an implicit In constraint added. Set constrain_options() to true to get the old behaviour.
RadioGroup elements no longer automatically get an implicit In constraint added. Set constrain_values to true to get the old behaviour.
New $w->explicit_ids( 1 ) method, stops auto-generation of id's in the xml output.
New CallbackOnce constraint
New HTML::Widget::Manual::Developer.pod
Added checked() as an alias for value() in RadioGroup elements.
Fixed many bugs when submitted values are 0 (zero) - particularly with $result->as_xml output.
Fixed bug when element names contain regex characters.
Fixed Range constraints handling of missing and empty values.

DBIx::SQLCrosstab::Format 1.17 keywords