<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="3.22" DotMatrixReport="False" EngineOptions.UseFileCache="True" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" ReportOptions.Author="A. Fediachov" ReportOptions.ConnectionName="FR Demo Base" ReportOptions.CreateDate="37871,9959574884" ReportOptions.Description.Text="This report shows how to use dialog selection filter and scripts in client-server mode." ReportOptions.LastChange="38874,0343504861" ReportOptions.VersionBuild="0" ReportOptions.VersionMajor="1" ReportOptions.VersionMinor="0" ReportOptions.VersionRelease="0" ScriptLanguage="PascalScript" ScriptText.Text="// VERY IMPORTANT!&#13;&#10;// If you want use of the script and dialog forms in client-server mode please follow&#13;&#10;// the next rules:&#13;&#10;// 1. You can use global report script for fill any data in the forms controls.&#13;&#10;// 2. You should place any DB components (SQL, table, etc) on report page not on the form.&#13;&#10;// 3. You can use 'OnDeactivate' event handler of the dialg form for setup of&#13;&#10;// global variables and further use in queryes, etc.&#13;&#10;&#13;&#10;var&#13;&#10;  s: String;&#13;&#10;  i: Integer;&#13;&#10;&#13;&#10;// 'OnDeactivate' event handler&#13;&#10;procedure DialogPage1OnDeactivate(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  s := ComboBox1.Text;&#13;&#10;  i := Pos('''', s);&#13;&#10;  if i &#62; 0 then&#13;&#10;    Insert('''', s, i);&#13;&#10;  Set('CompSelected', ''''+ s + '''');&#13;&#10;  // 'CompSelected' variable is used in 'Sales' query on the report page&#13;&#10;end;&#13;&#10;&#13;&#10;// Global report script&#13;&#10;begin&#13;&#10;  Customers.Open;&#13;&#10;  // fill in a combobox on the form&#13;&#10;  while not Customers.EOF do&#13;&#10;  begin&#13;&#10;    ComboBox1.Items.Add(Customers.FieldByName('Company').AsString);&#13;&#10;    Customers.Next;&#13;&#10;  end;&#13;&#10;  ComboBox1.ItemIndex := 0; // set first item as default&#13;&#10;  Customers.Close;&#13;&#10;end." OnStartReport="frxReport1OnStartReport" PropData="08446174617365747301010C2400000020446174615365743D2253616C65732220446174615365744E616D653D2253616C65732200010C2C00000020446174615365743D22437573746F6D6572732220446174615365744E616D653D22437573746F6D657273220000095661726961626C657301010C16000000204E616D653D22204E65772043617465676F7279312200010C2A000000204E616D653D22436F6D7053656C6563746564222056616C75653D2227416374696F6E20436C756227220000055374796C650100">
  <TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="5" RightMargin="5" TopMargin="5" BottomMargin="5" Columns="1" ColumnWidth="210" ColumnPositions.Text="0" PrintOnPreviousPage="True" HGuides.Text="" VGuides.Text="">
    <TfrxPageFooter Name="Band1" Height="22,67718" Left="0" Top="325,03958" Width="755,906">
      <TfrxMemoView Name="Memo5" Left="3,77953" Top="3,77953000000002" Width="710,55164" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="4" Frame.Width="2" HAlign="haRight" ParentFont="False" Text="[Page#]"/>
    </TfrxPageFooter>
    <TfrxGroupHeader Name="Band4" Height="45,35436" Left="0" Top="18,89765" Width="755,906" Condition="Sales.&#34;Cust No&#34;">
      <TfrxMemoView Name="Memo17" Left="3,77953" Top="0" Width="272,12616" Height="18,89765" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="5" GapX="6" ParentFont="False" VAlign="vaCenter" Text="Company"/>
      <TfrxMemoView Name="Memo19" Left="275,90569" Top="0" Width="177,63791" Height="18,89765" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" ParentFont="False" VAlign="vaCenter" Text="Phone"/>
      <TfrxMemoView Name="Memo20" Left="453,5436" Top="0" Width="260,78757" Height="18,89765" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="6" ParentFont="False" VAlign="vaCenter" Text="Fax"/>
      <TfrxMemoView Name="Memo21" Left="275,90569" Top="18,89765" Width="177,63791" Height="26,45671" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-19" Font.Name="Arial" Font.Style="2" ParentFont="False" VAlign="vaCenter" Text="[Sales.&#34;Phone&#34;]"/>
      <TfrxMemoView Name="Memo22" Left="453,5436" Top="18,89765" Width="260,78757" Height="26,45671" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-19" Font.Name="Arial" Font.Style="2" Frame.Typ="2" ParentFont="False" VAlign="vaCenter" Text="[Sales.&#34;FAX&#34;]"/>
      <TfrxMemoView Name="Memo18" Left="3,77953" Top="18,89765" Width="272,12616" Height="26,45671" Color="8388608" Font.Charset="1" Font.Color="16777215" Font.Height="-19" Font.Name="Arial" Font.Style="2" Frame.Typ="1" GapX="6" ParentFont="False" VAlign="vaCenter" Text="[Sales.&#34;Company&#34;]"/>
    </TfrxGroupHeader>
    <TfrxGroupHeader Name="Band5" Height="37,7953" Left="0" Top="86,92919" Width="755,906" Condition="Sales.&#34;Order No&#34;">
      <TfrxMemoView Name="Memo3" Left="3,77953" Top="18,89765" Width="52,91342" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="1" ParentFont="False" Text=""/>
      <TfrxMemoView Name="Memo8" Left="3,77953" Top="0" Width="124,72449" Height="18,89765" Color="12632256" Frame.Typ="1" GapX="4" Text="Order No [Sales.&#34;Order No&#34;]"/>
      <TfrxMemoView Name="Memo9" Left="128,50402" Top="0" Width="585,82715" Height="18,89765" Color="12632256" Frame.Typ="2" Text="Date [Sales.&#34;Sale Date&#34;]"/>
      <TfrxMemoView Name="Memo10" Left="56,69295" Top="18,89765" Width="71,81107" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Part"/>
      <TfrxMemoView Name="Memo11" Left="128,50402" Top="18,89765" Width="279,68522" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Description"/>
      <TfrxMemoView Name="Memo12" Left="408,18924" Top="18,89765" Width="83,14966" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Price"/>
      <TfrxMemoView Name="Memo13" Left="491,3389" Top="18,89765" Width="60,47248" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Qty"/>
      <TfrxMemoView Name="Memo14" Left="551,81138" Top="18,89765" Width="90,70872" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="Total"/>
      <TfrxMemoView Name="Memo31" Left="642,5201" Top="18,89765" Width="71,81107" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="2" ParentFont="False" Text=""/>
    </TfrxGroupHeader>
    <TfrxMasterData Name="Band6" Height="18,89765" Left="0" Top="147,40167" Width="755,906" Columns="1" ColumnWidth="200" ColumnGap="20" DataSet="Sales" DataSetName="Sales" RowCount="0">
      <TfrxMemoView Name="Memo2" Left="3,77953" Top="0" Width="52,91342" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="1" ParentFont="False" Text=""/>
      <TfrxMemoView Name="Memo23" Left="56,69295" Top="0" Width="71,81107" Height="18,89765" DataField="Part No" DataSet="Sales" DataSetName="Sales" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="[Sales.&#34;Part No&#34;]"/>
      <TfrxMemoView Name="Memo24" Left="128,50402" Top="0" Width="279,68522" Height="18,89765" DataField="Description" DataSet="Sales" DataSetName="Sales" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[Sales.&#34;Description&#34;]"/>
      <TfrxMemoView Name="Memo25" Left="408,18924" Top="0" Width="83,14966" Height="18,89765" DataField="List Price" DataSet="Sales" DataSetName="Sales" DisplayFormat.FormatStr="%2.2m" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[Sales.&#34;List Price&#34;]"/>
      <TfrxMemoView Name="Memo26" Left="491,3389" Top="0" Width="60,47248" Height="18,89765" DataField="Qty" DataSet="Sales" DataSetName="Sales" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="[Sales.&#34;Qty&#34;]"/>
      <TfrxMemoView Name="Memo27" Left="551,81138" Top="0" Width="90,70872" Height="18,89765" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[&#60;Sales.&#34;Qty&#34;&#62;*&#60;Sales.&#34;List Price&#34;&#62;]"/>
      <TfrxMemoView Name="Memo32" Left="642,5201" Top="0" Width="71,81107" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="2" ParentFont="False" Text=""/>
    </TfrxMasterData>
    <TfrxGroupFooter Name="Band7" Height="30,23624" Left="0" Top="234,33086" Width="755,906">
      <TfrxMemoView Name="Memo28" Left="3,77953" Top="0" Width="710,55164" Height="18,89765" Color="12632256" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Frame.Typ="11" Text="Total sales this customer: [Sum(&#60;Sales.&#34;Qty&#34;&#62;*&#60;Sales.&#34;List Price&#34;&#62;)]"/>
    </TfrxGroupFooter>
    <TfrxGroupFooter Name="Band8" Height="22,67718" Left="0" Top="188,9765" Width="755,906">
      <TfrxMemoView Name="Memo1" Left="3,77953" Top="0" Width="52,91342" Height="22,67718" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="1" ParentFont="False" Text=""/>
      <TfrxMemoView Name="Memo15" Left="56,69295" Top="0" Width="585,82715" Height="22,67718" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="128" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="Total this order: [Sum(&#60;Sales.&#34;Qty&#34;&#62;*&#60;Sales.&#34;List Price&#34;&#62;)]"/>
      <TfrxMemoView Name="Memo33" Left="642,5201" Top="0" Width="71,81107" Height="22,67718" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="2" ParentFont="False" Text=""/>
    </TfrxGroupFooter>
    <TfrxADOQuery Name="Sales" UserName="Sales" CloseDataSource="True" FieldAliases.Text="a.CustNo=Cust No&#13;&#10;Company=Company&#13;&#10;Addr1=Addr1&#13;&#10;Addr2=Addr2&#13;&#10;City=City&#13;&#10;State=State&#13;&#10;Zip=Zip&#13;&#10;Country=Country&#13;&#10;Phone=Phone&#13;&#10;FAX=FAX&#13;&#10;a.TaxRate=Tax Rate&#13;&#10;Contact=Contact&#13;&#10;LastInvoiceDate=Last Invoice Date&#13;&#10;b.OrderNo=Order No&#13;&#10;b.CustNo=b.Cust No&#13;&#10;SaleDate=Sale Date&#13;&#10;ShipDate=Ship Date&#13;&#10;EmpNo=Emp No&#13;&#10;ShipToContact=Ship To Contact&#13;&#10;ShipToAddr1=Ship To Addr1&#13;&#10;ShipToAddr2=Ship To Addr2&#13;&#10;ShipToCity=Ship To City&#13;&#10;ShipToState=Ship To State&#13;&#10;ShipToZip=Ship To Zip&#13;&#10;ShipToCountry=Ship To Country&#13;&#10;ShipToPhone=Ship To Phone&#13;&#10;ShipVIA=Ship VIA&#13;&#10;PO=PO&#13;&#10;Terms=Terms&#13;&#10;PaymentMethod=Payment Method&#13;&#10;ItemsTotal=Items Total&#13;&#10;b.TaxRate=b.Tax Rate&#13;&#10;Freight=Freight&#13;&#10;AmountPaid=Amount Paid&#13;&#10;c.OrderNo=c.Order No&#13;&#10;ItemNo=Item No&#13;&#10;c.PartNo=Part No&#13;&#10;Qty=Qty&#13;&#10;Discount=Discount&#13;&#10;d.PartNo=d.Part No&#13;&#10;VendorNo=Vendor No&#13;&#10;Description=Description&#13;&#10;OnHand=On Hand&#13;&#10;OnOrder=On Order&#13;&#10;Cost=Cost&#13;&#10;ListPrice=List Price" SQL.Text="select * from customer a, orders b, items c, parts d&#13;&#10;where a.custno = b.custno&#13;&#10;  and b.orderno = c.orderno&#13;&#10;  and c.partno = d.partno&#13;&#10;  and a.company = :1&#13;&#10;order by a.company, b.orderno" CommandTimeout="30" PropData="0A506172616D657465727301010C45000000204E616D653D2231222044617461547970653D22667457696465537472696E67222045787072657373696F6E3D22262336303B436F6D7053656C6563746564262336323B220000"/>
    <TfrxADOQuery Name="Customers" UserName="Customers" CloseDataSource="True" FieldAliases.Text="CustNo=CustNo&#13;&#10;Company=Company&#13;&#10;Addr1=Addr1&#13;&#10;Addr2=Addr2&#13;&#10;City=City&#13;&#10;State=State&#13;&#10;Zip=Zip&#13;&#10;Country=Country&#13;&#10;Phone=Phone&#13;&#10;FAX=FAX&#13;&#10;TaxRate=TaxRate&#13;&#10;Contact=Contact&#13;&#10;LastInvoiceDate=LastInvoiceDate" SQL.Text="select * from customer order by company" CommandTimeout="30" PropData="0A506172616D65746572730100"/>
  </TfrxReportPage>
  <TfrxDialogPage Name="DialogPage1" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="0" BorderStyle="bsDialog" Caption="Selection" Height="168" Left="346" Top="263" Width="402" OnDeactivate="DialogPage1OnDeactivate">
    <TfrxLabelControl Name="Label1" Left="16" Top="28" Width="76" Height="13" Caption="Select customer" Color="-16777201"/>
    <TfrxComboBoxControl Name="ComboBox1" Left="120" Top="24" Width="257" Height="21" Color="-16777211" Items.Text="" Text="ComboBox1" ItemIndex="-1"/>
    <TfrxButtonControl Name="Select" Left="160" Top="84" Width="75" Height="25" Caption="Select" Default="True" ModalResult="1"/>
  </TfrxDialogPage>
</TfrxReport>
