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.

Example of Internal TXT report

Download fileTEST.prs, if you to import
this exemplary report in your instance of ProReports

We want to create simple report that basing on internal database of ProReports system will generate *.txt file in following format:

<user_type>;<type_destription> 
<login>;<name> <surname>;<city> 

In example we present how to handle associate tables and we show single-level element nesting.

In first step we have to register report using prepared earlier form LOGIN:

Next we register elements of a report:

  • element A
SectionValue
SymbolA
TypeHEAD
Weight0
Parent---
DescriptionDefining variable desciption_types
SQL 
Expression/Code before Template
$V[desciption_types]=array("K"=>"Coordinator",
"U"=>"User","A"=>"Administrator","M"=>"Manager");
Template 
Expression/Code after Template 
  • element B
SectionValue
SymbolB
TypeBODY
Weight1
Parent---
DescriptionUser types selection
SQLselect distinct type as type from ge_users WHERE login like "$P[Login]"
Expression/Code before Template
$type=$F[B_type];
$V[description]=$V[desciption_types][$type];
Template$F[B_typ];$V[description]\r\n
Expression/Code after Template 
  • element C (ten element jest podrzÄ™dny w stosunku do elementu B)
SectionValue
SymbolC
TypBODY
Weight0
ParentB
DescriptionUsers selection
SQLSELECT * FROM ge_users WHERE typ="$F[B_type]" and login like "$P[Login]"
Expression/Code before Template 
Template$F[C_login];$F[C_name] $F[C_surname];$F[C_city]\r\n
Expression/Code after Template 

Registered elements are displayed on list according to hierarchy:

After compiling a report we can run by by choosing from menu option Execute:

Before actuall generation form linked with report will be shown:

Using button Generate starts process of report generation with a result of output file on *.txt format:

A;Administrator
admin;admin admin;-
K;Coordinator
test;Test Test;-
M;Manager
test1;Test1 Test1;-
U;User
user;User Test;Warszawa


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

Edit - History - Print - Recent Changes - Search
Page last modified on August 28, 2019, at 02:25 PM EST