PANTHEON™ Help

 Toc
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]Guides for PANTHEON
  [Expand]Guide for PANTHEON
  [Expand]Guide for PANTHEON Retail
  [Expand]Guide for PANTHEON Vet
  [Expand]Guide for PANTHEON Farming
 [Collapse]User Manuals for PANTHEON
  [Expand]User Manual for PANTHEON
  [Expand]User Manual for PANTHEON Retail
  [Expand]User manual for PANTHEON Vet
  [Expand]User Manual for PANTHEON Farming
[Collapse]PANTHEON Web
 [Collapse]Guides for PANTHEON Web
  [Expand]Guide for PANTHEON Web Light
  [Expand]Guide for PANTHEON Web Terminal
  [Expand]Guide for PANTHEON Web Legal
  [Expand]Old products Archive
 [Collapse]User Manuals for PANTHEON Web
  [Expand]Getting started PANTHEON Web
  [Expand]User Manual for PANTHEON Web Light
  [Expand]User Manual for PANTHEON Web Terminal
  [Expand]User Manual for PANTHEON Web Legal
  [Expand]Old products Archive
[Collapse]PANTHEON Granules
 [Collapse]Guides for PANTHEON Granules
  [Expand]Personnel Granule
  [Expand]Travel Orders Granule
  [Expand]Documents and Tasks Granule
  [Expand]Dashboard Granule
  [Expand]B2B Orders Granule
  [Expand]Field Service Granule
  [Expand]Fixed Assets Inventory Granule
  [Expand]Warehouse Inventory Granule
 [Collapse]User Manuals for PANTHEON Granules
  [Expand]Getting started
  [Expand]Personnel Granule
  [Expand]Travel Orders Granule
  [Expand]Documents and Tasks Granule
  [Expand]B2B Orders Granule
  [Expand]Dashboard Granule
  [Expand]Field Service Granule
  [Expand]Fixed Assets Inventory Granule
  [Expand]Warehouse Inventory Granule
  [Expand]Archive
[Expand]User Site

Load Time: 328.1016 ms
"
  6613 | 1 | |
Label


SQLEXP - Customer Address in the Sales Order Report

SQLEXP - Customer Address in the Sales Order Report

010379.gif010380.gif010381.gif010411.gif010382.gif010383.gif
000001.gif SQLEXP  is a function used by the program to generate reports which makes it possible to report information not available in the original RecordSet of a report. This way, you can include information from other tables and registers in reports for individual user reports..

Syntax:

SqlExp('<SQL stavek>')

Example of the Use on the Report 103 Order report - detailed

000001.gif Because the names of RecordSets and fields in the RecordSets could differ in each report, you must check the name of the RecordSets and fields for each concrete report.

You are collecting sales order and once a week you deliver these orders to consignees. In sales orders report you can create a report of non-dispatched orders with entered Delivery field (delivery method) Delivery - with own truck.

In the RecordSet of sales order report are not provided the customer's address or their contact person. All these data are available in the Subjects register, as for the the Subjects ID, it is already present in the RecordSet of the 103 Order report - detailed report.

All criteria were met to use the SQLEXP sentence in the report. Let's look!

 

1. Create a new record from the 103 Order report - detailed report for an invoice. Add a new Field with Statement by clicking the 007515.gif icon:

2. In the Statement field, enter the SQL sentence:

 

007516.gif

Report of the customer's address from the sales order

SQLEXP('select Naslov from Subjekt where Naziv = ''' + qReportIzpis.Narocnik + '''')
Comment:

qReportIzpis.Narocnik is a field from the recordset qReportIzpis, which is used to generate a report.

After replacing qReportIzpis.Narocnik, the SQL command is:

'select Naslov from Subjekt where Naziv = ''Neki kupec'''

and thus the query that is executed is:

select Naslov from Subjekt where Naziv = 'Neki kupec'.

 

Report of the customer's place and postal zone from the sales order

SQLEXP('select K.Naziv from Subjekt S left join Posta K on S.Posta = K.Posta 
where S.Naziv = ''' + qReportIzpis.Narocnik + '''')

 

Report of the customer's contact from the sales order

SQLEXP('select LTrim(RTrim(KontOseba)) + '' '' + 
Cast(case when (Tel is null) then '' '' else '' Tel: '' + 
Tel end as Char(30)) as Ko 
from KontOs where Subjekt = ''' + qReportIzpis.Narocnik + ''' 
order by Poz')

 

 Reports:

Because you would like to sort non-dispatched orders by customers and than by order numbers, you have to select the appropriate report criteria in the Report settings:

007517.gif

 

Primer izpisa obračuna naročil kupcev iz tako oblikovanega izpisa:

 007518.gif


 


  

     


Rate this topic
Was this topic usefull?
Comments
Comment will also bo visible in forum!