[if-mm !tables] [set ui_error]Not authorized for table.[/set] [bounce page="__UI_BASE__/error"] [/if-mm] [if-mm !advanced report] [bounce page="__UI_BASE__/error"] [value name=saved_report set=""] [/if-mm] [if !cgi mv_data_table] [and !value saved_report] [bounce page="__UI_BASE__/gentable"] [value name=saved_report set=""] [/if] [if cgi mv_data_table] [value name=saved_report set=""] [/if] [seti page_title]Custom report [if value mv_data_table][value mv_data_table][/if][/seti] [set help_name]report[/set] [set ui_class]Reports[/set] [set icon_name]icon_config.gif[/set] [seti name=tables][list-databases][/seti] [seti meta_header] [perl table="[scratch tables]"] my @tables = split /\s+/, $Scratch->{tables}; my $out; for(@tables) { $tables{$_} = [ $Db{$_}->columns() ]; } $out = "
EOF [/perl] [/seti] [calc] $Config->{NoSearch} = ''; [/calc] @_UI_STD_HEAD_@ [seti table_list] [loop prefix=table list="[scratch tables]"] [table-code] [/loop] [/seti]

Run saved report | Retrieve saved definition | Delete report
| [loop list="[list-glob spec='pages/__UI_BASE__/reports/* pages/__UI_BASE__/user/[data session mm_username]/reports/*']"] [calc] $lab = q{[loop-code]}; $lab =~ s:\.html.*::; $opt = $lab; $opt =~ s:^pages/::; $lab =~ s:.*/::; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; my $out = $Tag->page($opt); $out .= $lab; $out .= ' ' [/calc] [/loop] | [loop list="[list-glob spec='pages/__UI_BASE__/report_def/* pages/__UI_BASE__/user/[data session mm_username]/report_def/*']"] [calc] $lab = q{[loop-code]}; $lab =~ s:\.html.*::; $opt = $lab; $opt =~ s:^pages/::; $lab =~ s:.*/::; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; my $out = $Tag->page($opt); $out .= $lab; $out .= ' ' [/calc] [/loop] | [calc] delete $Scratch->{report_spec}; $reldir = $Config->{PageDir}; $reldir =~ s:^$Config->{VendRoot}/:: or do { $Scratch->{report_spec} = "Cannot do reports with absolute page directory."; return; }; $Session->{username} =~ /^\S+$/ or return "Bad username, no spaces allowed."; my @files = $Tag->list_glob("$reldir/__UI_BASE__/$Session->{username}/report*/*.html"); if($Tag->if_mm('super')) { push @files, $Tag->list_glob("$reldir/__UI_BASE__/report*/*.html"); } @files = sort @files; $Scratch->{report_spec} = join "\n", @files; return; [/calc] [set del_report] [calc] return unless $CGI->{ui_report_delete}; $reldir = $Config->{PageDir}; $reldir =~ s:^$Config->{VendRoot}/:: or return "Cannot do reports with absolute page directory."; @files = grep /$CGI->{ui_report_delete}$/, split /\n+/, $Scratch->{report_spec}; $out = ''; for(@files) { my $lab = $_; $lab =~ s:.*/([^/]+/.+)\.html:$1:; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $out .= "Delete $lab: "; $out .= $Tag->unlink_file($_, "$reldir/") ? 'success' : 'FAILED'; $out .= ' '; } $Scratch->{report_delete_message} = $out; return; [/calc] [/set] [scratchd report_delete_message] [form-session-id]

[form-session-id] [if-mm advanced mml] [/if-mm]
Report Title | Summary only Page size
[loop list="0 1 2"]
Search filter |
[/loop]
[loop list="0 1 2"]
Sort order [loop-increment] | Break: [if value break[loop-code]] no yes [else] no yes [/else] [/if]
[/loop] [loop list="[scratch column_nums]"]
Column [loop-increment] insert append delete | Heading: Summary: Align: Format: Edit as key for:
[/loop]
[if-mm advanced mml] [/if-mm]

@_UI_STD_FOOTER_@