Report Builder - Get Data Directly from DB: Difference between revisions

From eStream Software
Line 30: Line 30:
:08. Click '''File | Save As''' & enter New report Name after done
:08. Click '''File | Save As''' & enter New report Name after done


<div style="float: right;">  [[#top|[top]]]</div>
===Example 2 - Get Picture Field from Maintain Item===
===Example 2 - Get Picture Field from Maintain Item===
Below is Example are doing following actions using '''Image'''
Below is Example are doing following actions using '''Image'''
* At Sales Invoice to get '''Picture''' field from '''Maintain Item'''
* At Sales Invoice to get '''Picture''' field from '''Maintain Item'''


Last Script Update : 00 Jul 2016<br />
Last Script Update : 18 Jul 2016<br />


'''Steps'''
'''Steps'''
:01. Click on '''SubRptNorm: Document_Detail'''
:02. Select the '''Image''' button (the Mountain & sun icon)
:03. Click on the place to be print/shown.
:04. Click on '''Calc''' Tab
:05. Right click here & Select '''Event''' & find the component just now we had placed (eg Image1)
:06. Click '''OnPrint'''
:07. Click here & enter the below script
<syntaxhighlight lang="delphi">
procedure Image1OnPrint;
var s: string;
begin
  s := 'SELECT Picture FROM ST_ITEM ' +
          'WHERE Code='+ QuotedStr(Document_Detail.GetFieldValue('ItemCode'));


  Image1.Visible := DBSQL_GetPicture(s, Image1.Picture);
end;
</syntaxhighlight>
:08. Click '''File | Save As''' & enter New report Name after done
<div style="float: right;">  [[#top|[top]]]</div>
===Example 2 - ===
* More coming soon...
* More coming soon...
<div style="float: right;">  [[#top|[top]]]</div>


==See also==
==See also==
* [[Report Designer]]
* [[Report Designer]]
* Others [[Customisation]]
* Others [[Customisation]]

Revision as of 07:42, 18 July 2016

Introduction

Sometime in the report you might wanted some extra information but you not able to select in the report design. So you had to self query to get the extra information.

Example 1 - Get Shelf Field from Maintain Item

Below is Example are doing following actions using Variable

  • At Sales Invoice to get Shelf field from Maintain Item

Last Script Update : 12 Oct 2015

Steps

RB-GetDirectDB-01.jpg
01. Click on SubRptNorm: Document_Detail
02. Select the Variable button (the Calculator icon)
03. Click on the place to be print/shown.
04. Click on Calc Tab
RB-GetDirectDB-02.jpg
05. Right click here & Select Event & find the component just now we had placed (eg Variable2)
06. Click OnCalc
07. Click here & enter the below script
procedure Variable2OnCalc(var value: Variant);
var s: string;
begin
  s := 'SELECT Shelf FROM ST_ITEM ' +
        'WHERE CODE=' + QuotedStr(Document_Detail.GetFieldValue('ItemCode'));
  Value := Trim(DBSQL_GetFieldValue(s));
end;
08. Click File | Save As & enter New report Name after done

Example 2 - Get Picture Field from Maintain Item

Below is Example are doing following actions using Image

  • At Sales Invoice to get Picture field from Maintain Item

Last Script Update : 18 Jul 2016

Steps

01. Click on SubRptNorm: Document_Detail
02. Select the Image button (the Mountain & sun icon)
03. Click on the place to be print/shown.
04. Click on Calc Tab
05. Right click here & Select Event & find the component just now we had placed (eg Image1)
06. Click OnPrint
07. Click here & enter the below script
procedure Image1OnPrint;
var s: string;
begin
  s := 'SELECT Picture FROM ST_ITEM ' +
          'WHERE Code='+ QuotedStr(Document_Detail.GetFieldValue('ItemCode'));

  Image1.Visible := DBSQL_GetPicture(s, Image1.Picture);
end;
08. Click File | Save As & enter New report Name after done

Example 2 -

  • More coming soon...

See also