Ръководство за PANTHEON™

 Категории
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]PANTHEON упатства
  [Collapse]Guide for PANTHEON
   [Collapse]Settings
    [Expand]Subjects
    [Expand]Items
    [Expand]POS
    [Expand]Manufacturing
    [Expand]Personnel
     Calendar
    [Expand]Financials
    [Expand]Customs
    [Collapse]Program
     [Expand]Document Types
     [Collapse]Reports in PANTHEON
       Settings in Administration Panel
      [Expand]Reports Register
       Print Preview
      [Expand]Report Designer
      [Expand]Creating Reports
      [Expand]Groups and Aggregates
      [Expand]Formatting and Highlighting
       Nested Reports (Subreports)
      [Expand]Specifics of Printouts in PANTHEON
      [Collapse]Script
        "Hello, World!" Script
        Using Variables, Database Fields, and Aggregate Functions
        Using Report Objects in the Script
        Events
        Example of Using the "OnBeforePrint" Event
        Printing a Group Sum in the Group Header
        Running Total
        "OnAfterData" Event
        Service Objects
        Using the "Engine" Object
       [Expand]PANTHEON Functions for FastReport
       [Expand]Examples with Tables and Queries
       Report Design Considerations
      Document Texts
      Delivery Methods
     [Expand]Loyalty Cards
     [Expand]Administration Panel
     [Expand]Dashboard Components
      Dashboard Reports
      Ad-hoc analysis
     [Expand]ARES
      SQL urejevalnik
    [Expand]Documentation
    [Expand]Logon
   [Expand]Orders
   [Expand]Goods
   [Expand]Manufacturing
   [Expand]POS
   [Expand]Service
   [Expand]Financials
   [Expand]Personnel
   [Expand]Analytics
   [Expand]Desktop
   [Expand]Помощ
   [Expand]Старите продукти
   [Expand]Messages and Warnings
   [Expand]Additional programs
  [Expand]Ръководство за PANTHEON Търговия
  [Expand]Ръководство за PANTHEON Vet
  [Expand]Ръководство за PANTHEON Фермерство
 [Expand]PANTHEON потребителски ръководства
[Expand]PANTHEON Web
[Expand]PANTHEON Гранула
[Expand]Потребителски сайт

Load Time: 749,9965 ms
print   |
Label

Primeri uporabe objektov v skriptah

Let's take a look at two examples of using report objects in the script.

Highlighting Every Second Row Line

Sometimes, in order to achieve greater transparency, we want each other line to appear with a different background color.

Let's take a look at an example of script  hat is defined to the item ID in order to appear in yellow on each second line. As a basis, we will use report '147 - Current Stock by Warehouses and Items', that is in the program menu 'Goods |Stock report | Current stock'. We replace script in the "DetailOnBeforePrint" event with the following:


procedure DetailOnBeforePrint(Sender: TfrxComponent);
begin
   if <Line#> mod 2 = 0 then
     fIdent.Color := clYellow
   else
      fIdent.Color := clNone;
end;

Value of Color property 'clNone' means transparent color.

Conditional Changing Font Style

Let's take a look at an example of a program code, which is already on report  '051 - Financial Report', that is in the program menu 'Financials |Reports | Financial Reports'. On the financial reports is a field "acBold" which defines whether data on report will be displayed  with bold font. Script on the report is the following:

procedure fNazivOnBeforePrint(Sender: TfrxComponent);
begin
    if <qReportIzpis."acBold"> = 'T' then
      begin
        fNaziv.Font.Style     := fsBold;
        fVrednost1.Font.Style := fsBold;
        fVrednost2.Font.Style := fsBold;
      end
    else
      begin
        fNaziv.Font.Style     := 0;
        fVrednost1.Font.Style := 0;
        fVrednost2.Font.Style := 0;
      end;
end;​

The value of the font style 0 means that no style is selected. If we want to set bold and italic font we write for example:

fNaziv.Font.Style     := fsBold + fsItalic;



Оценете темата
Темата беше ли ви полезна?
Коментар
Вашият коментар ще бъде видим и във форума!