Recent Changes - Search:

ProReports

edit SideBar

Respect my work!
If you are using commercially
ProReports please
bay a license:

or

        BTC: 

1MTFbBSKrocPK7G6GKfG8RoTw5N57WnnNa

If you have paid donate send me e-mail with Your data or transaction number to receive an access code to articles with limited access.

Snippet/Helper

Writing PHP plugin that will be used in reports Internal type, we can enrich him to Snippet/Helper. Thanks to him it becomes easier to use the plugin, as it allows to insert the element parts of the code.

Important!

Incorrectly written Snippet/Helper can lead to an error registering and editing report elements.

Helper may be provided as part of a menu or list item (see above). In plugin must be defined a function named by format:

function <name_of_plugin>_<menu|select>_<template|exp|SQL>_Helper

gdzie:

  • name_of_plugin – part of the function name coincides with the name of the plugin, eg. if the plugin has a name myplugin.php name_of_plugin is my_plugin
  • menu – helper on the menu
  • select – helper on the list
  • template – helper in section Template
  • exp – helper in section Expression/Code before Template i Expression/Code after Template

Example 1

Example 1 – main helper (main_Helper.php)

function main_Helper_menu_sql_Helper()
{
$out=array(
"SQL"=>"SELECT * FROM WHERE",
"SPL"=>"EXECUTE PROCEDURE"
);
return $out;
}
function main_Helper_select_sql_Helper()
{
$out=array(
"SQLORDER"=>"SELECT * FROM WHERE\\r\\nORDER BY",
"SQLGROUP"=>"SELECT * FROM WHERE\\r\\nGROUP BY"
);
return $out;
}

Example 2

Example 2 – helper in plugin pdfrep.php

function pdfrep_select_exp_Helper()
{
$out=array(
"f_HeadRepPDF"=>"\\\$V[out].=f_HeadRepPDF(\\\"oriantacja\\\",\\\"tytul\\\",\\\"data\\\");",
"f_AddHeadRepPDF"=>"\\\$V[out].=f_AddHeadRepPDF(\\\"tytul\\\", array(\\r\\n array(\\\"Data 1\\\",\\\"20\\\",\\\"C\\\")\\r\\n));",
"f_AddRowRepPDF"=>"\\\$V[oout].=f_AddRowRepPDF(array(\\r\\narray(\\\"row 1\\\",\\\"L\\\")\\r\\n));",
"f_FootRepPDF"=>"\\\$V[foot]=f_FootRepPDF();"
);
return $out;
}


This page may have a more recent version on pmwiki.org: PmWiki:PluginHelp, and a talk page: PmWiki:PluginHelp-Talk.

Edit - History - Print - Recent Changes - Search
Page last modified on August 29, 2019, at 09:44 AM EST