Report Methods, Subroutines and Component

Report Methods

The report methods are called when a browser makes a pdf query request (see Testing Queries).
The query request is initiated with printSelected() function, from DisplayBinding object.
The printSelected() uses the printUrl() function, from DataBinding object, to construct query request url with attached parameters.

Method Name Parameter Name Description Default Value
pdf   The method wraps around the PDF method. The method gets $GROUP_ID and $report_ids by calling SqlSelect2report_id() and passes them to the PDF method. Afterwards, when the PDF returns, it removes all $GROUP_ID records from public.report_id table with delete print group query.  
PDF   Prepares the parameters for the report.pdf component.  
  $GROUP_ID Is simply passed forward. Not defined.
  $report_ids It's checked if the REPORT_ID argument exists which overrides the $report_ids. The REPORT_ID can be defined defined in the ODT Reports as one of the cmd_parameters that are used for testing ODT reports. Then the $report_ids is passed forward to the report.pdf component. Not defined.
  $LANDSCAPE If it finds $LANDSCAPE parameter in a list of parameters it is discarded. Not defined.
  $report The parameter represents name of the report file used by the Reportman or ODT Reportman to generate the report. Not defined.
  $report_method The report method is determined by the ReportMethod() subroutine. Valid values are: rep, odt or pdf. None.
  $report_file The $report_file is used by the Reportman. The value is determined by the FindReportmanFile() subroutine.  
PRINT_FORM   Schema/form_name to be used for the report with attached orientation. See the button example. <%method PRINT_FORM>\
% my $schema = $m->scomp('SELF:SCHEMA');
% if($schema eq 'public'){
<& SELF:FROM &>\
% }else{
<& SELF:SCHEMA &>/<& SELF:FROM &>\
% }
, PORTRAIT, \
</%method>
PRINT_RECORDS   The method inserts the primary key of the public.recorset table and the group_id in the public.report_id table.  
  $WHERE   Empty string.
  $GROUP_ID   Not defined.

Report Subroutines

DBMS Library subroutines related to reporting.

Subroutine Name Parameter Name Valid Input Value Description
Array2report_idSql()     Inserts each key from the $arr list into the public.report_id table. Returns $group_id and $report_ids.
  $group_id   Group ID.
  $arr   A list of parameters.
FindReportmanFile()     Uses request_to_comp_path() subroutine with different combinations of the parameter $report and the Apache config variable ReportmanADOserver to find the right Reportman configuration file.
  $report   The report name.
  ReportmanADOserver   If this Apache configuration variable exists the subroutine searches for and validates the Wine report configuration files. Otherwise the subroutine searches for and validates the Kylix report configuration files.
ReportMethod()     Analyzes the report name to determine which reporting method is used (Reportman or ODT Report. The subroutine first tries to determine the reporting method from the $report suffix. If there is no suffix present it uses the value of the Apache config variable DefaultReportEngine. If it finds unknown report suffix or if the DefaultReportEngine is not defined it raises an error.
  $report   The report name. Optional suffix determines the reporting method. See the button example to understand how the $report name is constructed.
    my_report_name.rep The report will be created with the Report Manager and printed in .pdf format.
    my_report_name.odt The report will be created with the ODT Report and printed in .odt format.
    my_report_name.pdf The report will be created with the ODT Report and printed in .pdf format.
NewGroupId()     Uses Apache config variable PrintNextValQuery to obtain new group ID value.
By default, if the config variable is missing, it uses select nextval('public.report_id_id_seq') query.
SqlSelect2report_id()     It uses the NewGroupId() to get a new $group_id value. Initializes the report_id table with the IDs of the records to be printed. Returns $group_id and $report_ids to be passed as parameters to the PDF method. The returned parameter $group_id contains a $GROUP_ID value. The returned parameter $report_ids contains a reference to an array of a $REPORT_ID values.
  $Params->{'reportlist'}   If the reportlist parameter is defined the function returns Array2report_idSql()
  $Params->{'type'}   Otherwise, if the reportlist parameter is not defined, the $Params->{'type'} is set to records
  $Params->{'where'} and $Params->{'numrec'}   Both parameters are used for making SqlSelect2report_id numrec query.
The result of the query is saved to $SQL{MAX_ROWS}
  $Params->{'where'}   Is also used for making SqlSelect2report_id print query.

Report Component

report.pdf Component
Topic revision: r6 - 21 Sep 2016, JanezStangelj
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies