﻿<?xml version="1.0" encoding="utf-8"?>
<inherited BaseReport="..\Base.frx" ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="05/15/2013 14:45:40" ReportInfo.Modified="08/20/2015 08:20:29" ReportInfo.CreatorVersion="1.6.57.0">
  <ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;

namespace FastReport
{
  public class ReportScript
  {

    
    
    private void Form1_Shown(object sender, EventArgs e)
    {
      dtpFromDate.Text = System.DateTime.Now.ToString(&quot;d MMMM yyy&quot;);
      dtpToDate.Text = System.DateTime.Now.ToString(&quot;d MMMM yyy&quot;);
      
      cboOrderBy.Text = &quot;Date&quot;;
    }

    
   

    private void btnOk_Click(object sender, EventArgs e)
    {
      if (txtItemCode.Text.Length &gt; 0)
      {
        Report.SetParameterValue(&quot;FromDate&quot;, dtpFromDate.Value.ToString(&quot;yyyy-MM-dd&quot;));
        Report.SetParameterValue(&quot;ToDate&quot;, dtpToDate.Value.ToString(&quot;yyyy-MM-dd&quot;));
        //Report.SetParameterValue(&quot;OrderBy&quot;, cboOrderBy.Text); DOES NOT WORK ?????
        string orderBy = String.Empty;
      
        //For Selected Item
        TableDataSource tSelItem = Report.GetDataSource(&quot;Item_History&quot;) as TableDataSource;
        if (cboOrderBy.Text == &quot;Date&quot;)
          orderBy = &quot;DATE_FORMAT(`TransDate`,'%Y-%m-%d %H:%i%s')&quot;;      
        else if (cboOrderBy.Text == &quot;Document #&quot;)      
          orderBy = &quot;TransID&quot;;      
        else if (cboOrderBy.Text == &quot;Client Name&quot;)
          orderBy = &quot;ClientName&quot;;
        else if (cboOrderBy.Text == &quot;Sales Rep&quot;)
          orderBy = &quot;SalesRep&quot;;  
        tSelItem.SelectCommand = tSelItem.SelectCommand.ToString().Replace(&quot;@OrderBy&quot;, orderBy);
      }
      else
      {
          MessageBox.Show(&quot;Please provide an item code, then try again.&quot;, &quot;Missing Item code&quot;, MessageBoxButtons.OK);
          
      }
        
    }
   

    private void Data1_AfterData(object sender, EventArgs e)
    {
      //Description
      txtDescription.Text =  Convert.ToString(Report.GetColumnValue(&quot;Item_History.Description&quot;));
      
      //total Qty Column format      
      int decimalValue = Convert.ToInt32(Report.GetColumnValue(&quot;programs_config.QtyDecimalValue&quot;));
      decimal qtyVal = 0; 
      if (Decimal.TryParse(txtQty.Text, out qtyVal))
      {
        txtQty.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);        
      }
      decimal prevQtyVal = 0; 
      if (Decimal.TryParse(txtPrevQty.Text, out prevQtyVal))
      {
        txtPrevQty.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, prevQtyVal);        
      }
    }
    

    

    private void DataFooter1_AfterData(object sender, EventArgs e)
    {
      //total Qty Column format      
      int decimalValue = Convert.ToInt32(Report.GetColumnValue(&quot;programs_config.QtyDecimalValue&quot;));
      decimal qtyVal = 0; 
      if (Decimal.TryParse(txtQtyAvail.Text, out qtyVal))
      {
        txtQtyAvail.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);
      }
    }
  }
}
</ScriptText>
  <Dictionary>
    <MySqlDataConnection Name="Connection" ConnectionString="rijcmlqmUGi0DHzhik04BO5+uxHPNJg6XdWlo9sfl3oNLbLcC5ELgVy3yM4U7/vviW/yU/VlCYnkUjA+BNt9VEI/Ru/VvVZmtXYFe8YZqCcS0BTXro=">
      <TableDataSource Name="companies" DataType="System.Int32" Enabled="true" TableName="companies" SelectCommand="SELECT * FROM companies WHERE ID = @CompanyID">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="Name" DataType="System.String"/>
        <Column Name="Email" DataType="System.String"/>
        <Column Name="Address" DataType="System.String"/>
        <Column Name="RegNo" DataType="System.String"/>
        <Column Name="VATno" DataType="System.String"/>
        <Column Name="ContactNo" DataType="System.String"/>
        <Column Name="AltNo" DataType="System.String"/>
        <Column Name="FaxNo" DataType="System.String"/>
        <Column Name="CellNo" DataType="System.String"/>
        <Column Name="LogoPath" DataType="System.String"/>
        <Column Name="InvoiceStylePath" DataType="System.String"/>
        <Column Name="InvoiceSize" DataType="System.String"/>
        <Column Name="VATrate" DataType="System.String"/>
        <Column Name="BankingDetails" DataType="System.String"/>
        <CommandParameter Name="companyID" DataType="254" Expression="[CompanyID]"/>
      </TableDataSource>
      <TableDataSource Name="Item_History" DataType="System.Int32" PropName="Table" Enabled="true" TableName="Item_History" SelectCommand="DROP TEMPORARY TABLE IF EXISTS item_history; &#13;&#10;CREATE TEMPORARY TABLE item_history (&#13;&#10;TransType VARCHAR(45) NOT NULL,&#13;&#10;TransDate DATETIME NOT NULL default '2000-01-01 01:00:00',&#13;&#10;TransID INT(10) UNSIGNED NOT NULL DEFAULT 0,&#13;&#10;ClientID INT(10) UNSIGNED NOT NULL DEFAULT 0,&#13;&#10;ClientName VARCHAR(245) NOT NULL,&#13;&#10;CompanyID INT(10) UNSIGNED NOT NULL DEFAULT 0,&#13;&#10;TransTotalCost DECIMAL(10,2) NOT NULL DEFAULT 0.00,&#13;&#10;TransTotalExcl DECIMAL(10,2) NOT NULL DEFAULT 0.00,&#13;&#10;TransTotalIncl DECIMAL(10,2) NOT NULL DEFAULT 0.00,&#13;&#10;ProductID INT(10) UNSIGNED NOT NULL DEFAULT 0,&#13;&#10;ProductCode VARCHAR(45) NOT NULL,&#13;&#10;Description VARCHAR(450) NOT NULL,&#13;&#10;Qty DECIMAL(14,2) NOT NULL DEFAULT 0.00,&#13;&#10;IsProduct TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,&#13;&#10;SalesRep VARCHAR(45) NOT NULL,&#13;&#10;InternalTransID INT(10) UNSIGNED NOT NULL DEFAULT 1,&#13;&#10;QtyAvailable DECIMAL(14,2) NOT NULL DEFAULT 0.00);&#13;&#10;/*InternalTransID: 1 = Sales, 2 = Purchases*/&#13;&#10;/*Insert from the SALES cash, credit, refund &amp; return items*/&#13;&#10;INSERT INTO item_history (TransType, TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Cash Sale' AS TransType, `Date`, RelatedID, ClientID, '' AS ClientName, CompanyID, TotalCost*-1, TotalSellingExcl*-1, TotalSellingIncl*-1, ProductID, ProductCode, Description, Qty*-1, IsProduct, SalesRep, 1, QtyAvailable FROM cash_sales_items &#13;&#10;WHERE CompanyID = @CompanyID AND (DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d')) AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Cash Refund' AS TransType, `Date`, RelatedID, ClientID, '' AS ClientName, CompanyID, TotalCost, TotalSellingExcl, TotalSellingIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, 1, QtyAvailable FROM cash_refunds_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Credit Sale' AS TransType, `Date`, RelatedID, ClientID, '' AS ClientName, CompanyID, TotalCost*-1, TotalSellingExcl*-1, TotalSellingIncl*-1, ProductID, ProductCode, Description, Qty*-1, IsProduct, SalesRep,1, QtyAvailable FROM credit_sales_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Credit Note' AS TransType, `Date`, RelatedID, ClientID, '' AS ClientName, CompanyID, TotalCost, TotalSellingExcl, TotalSellingIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep,1, QtyAvailable FROM credit_notes_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;/*Insert from the PURCHASES cash, credit, refund &amp; return items*/&#13;&#10;INSERT INTO item_history (TransType, TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Cash Purchase' AS TransType, `Date`, RelatedID, SupplierID, '' AS ClientName, CompanyID, TotalExcl, TotalExcl, TotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, `User`, 2, QtyAvailable FROM cash_purchases_items &#13;&#10;WHERE CompanyID = @CompanyID AND (DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d')) AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Cash Purch. Return' AS TransType, `Date`, RelatedID, SupplierID, '' AS ClientName, CompanyID, TotalExcl*-1, TotalExcl*-1, TotalIncl*-1, ProductID, ProductCode, Description, Qty*-1, IsProduct, `User`, 2, QtyAvailable FROM cash_purchases_returns_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Credit Purchase' AS TransType, `Date`, RelatedID, SupplierID, '' AS ClientName, CompanyID, TotalExcl, TotalExcl, TotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, `User`, 2, QtyAvailable FROM credit_purchases_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;INSERT INTO item_history (TransType,TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Debit Note' AS TransType, `Date`, RelatedID, SupplierID, '' AS ClientName, CompanyID, TotalExcl*-1, TotalExcl*-1, TotalIncl*-1, ProductID, ProductCode, Description, Qty*-1, IsProduct, `User`, 2, QtyAvailable FROM debit_notes_items &#13;&#10;WHERE CompanyID = @CompanyID AND DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d') AND ProductCode = @ItemCode;&#13;&#10;/*Insert the linked items sold*/&#13;&#10;INSERT INTO item_history (TransType, TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT Reason AS TransType, `Date`, Note AS RelatedID, '' AS ClientID, '' AS ClientName, CompanyID, (CostPrice * ABS(QtyFound - QtyAvailable)) AS TotalCost, (SellingPrice * ABS(QtyFound - QtyAvailable)) AS TotalSellingExcl, &#13;&#10;(SellingPriceIncl* ABS(QtyFound - QtyAvailable)) AS TotalSellingIncl, ProductID, ProductCode, Description, (QtyFound - QtyAvailable) AS Qty, IsProduct, User AS SalesRep, 1, QtyAvailable FROM item_maintenance &#13;&#10;WHERE CompanyID = @CompanyID AND (DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d')) &#13;&#10;AND ProductCode = @ItemCode AND LEFT(Reason, 6) = 'Linked';&#13;&#10;/*Insert the Item Maintenance records*/&#13;&#10;INSERT INTO item_history (TransType, TransDate, TransID, ClientID, ClientName, CompanyID, TransTotalCost, TransTotalExcl, TransTotalIncl, ProductID, ProductCode, Description, Qty, IsProduct, SalesRep, InternalTransID, QtyAvailable) &#13;&#10;SELECT 'Maintenance' AS TransType, `Date`, 0 AS TransID, 0 AS ClientID, Reason AS ClientName, CompanyID, ((QtyFound - QtyAvailable) * CostPrice)*-1 AS TotalCost, ((QtyFound - QtyAvailable) * SellingPrice)*-1 AS TotalSellingExcl, &#13;&#10;((QtyFound - QtyAvailable) * SellingPrice)*-1 AS TotalSellingIncl, ProductID, ProductCode, Description, (QtyFound - QtyAvailable) AS Qty, IsProduct, User AS SalesRep, 1, QtyAvailable FROM item_maintenance &#13;&#10;WHERE CompanyID = @CompanyID AND (DATE_FORMAT(`Date`,'%Y-%m-%d') BETWEEN DATE_FORMAT(@FromDate,'%Y-%m-%d') AND DATE_FORMAT(@ToDate,'%Y-%m-%d')) AND ProductCode = @ItemCode;&#13;&#10;/*Retrieve the records*/&#13;&#10;UPDATE item_history i, clients c SET i.ClientName = c.Name WHERE i.ClientID = c.ClientID AND (c.CompanyID = @CompanyID) AND InternalTransID = 1;&#13;&#10;UPDATE item_history i, suppliers c SET i.ClientName = c.Name WHERE i.ClientID = c.SupplierID AND (c.CompanyID = @CompanyID) AND InternalTransID = 2;&#13;&#10;SELECT TransType, TransDate, TransID, ClientID, ClientName, CompanyID, SalesRep, SUM(TransTotalCost) AS TransTotalCost, SUM(TransTotalExcl) AS TransTotalExcl, &#13;&#10;SUM(TransTotalIncl) AS TransTotalIncl, ProductID, ProductCode, Description, SUM(Qty) AS Qty, IsProduct, SUM(IF(TransTotalCost &lt;&gt; 0, (TransTotalExcl - TransTotalCost), 0)) AS Profit, &#13;&#10;SUM(IF(TransTotalCost &lt;&gt; 0, ((TransTotalExcl - TransTotalCost)/TransTotalExcl)*100, 0)) AS ProfitPercentage, &#13;&#10;SUM(IF(TransTotalCost &lt;&gt; 0, ((TransTotalExcl - TransTotalCost)/IF(TransTotalCost = 0, 1, TransTotalCost))*100, 0)) AS MupPercentage, QtyAvailable  &#13;&#10;FROM item_history &#13;&#10;GROUP BY TransType, TransID &#13;&#10;ORDER BY @OrderBy&#13;&#10;">
        <Column Name="TransDate" DataType="System.DateTime"/>
        <Column Name="TransID" DataType="System.UInt32"/>
        <Column Name="ClientID" DataType="System.UInt32"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="TransTotalCost" DataType="System.Decimal"/>
        <Column Name="TransTotalExcl" DataType="System.Decimal"/>
        <Column Name="TransTotalIncl" DataType="System.Decimal"/>
        <Column Name="ProductCode" DataType="System.String"/>
        <Column Name="Description" DataType="System.String"/>
        <Column Name="Qty" DataType="System.Decimal"/>
        <Column Name="IsProduct" DataType="System.Byte"/>
        <Column Name="Profit" DataType="System.Decimal"/>
        <Column Name="ProfitPercentage" DataType="System.Decimal"/>
        <Column Name="MupPercentage" DataType="System.Decimal"/>
        <Column Name="ProductID" DataType="System.UInt32"/>
        <Column Name="ClientName" DataType="System.String"/>
        <Column Name="TransType" DataType="System.String"/>
        <Column Name="SalesRep" DataType="System.String"/>
        <Column Name="QtyAvailable" DataType="System.Decimal"/>
        <CommandParameter Name="FromDate" DataType="254" Expression="[FromDate]"/>
        <CommandParameter Name="ToDate" DataType="254" Expression="[ToDate]"/>
        <CommandParameter Name="CompanyID" DataType="254" Expression="[CompanyID]"/>
        <CommandParameter Name="orderBy" DataType="254"/>
        <CommandParameter Name="ItemCode" DataType="254" Expression="[ItemCode]"/>
      </TableDataSource>
      <TableDataSource Name="Table" Alias="Curr_QtyAvailable" DataType="System.Int32" Enabled="true" SelectCommand="SELECT QtyAvailable FROM products WHERE CompanyID = @CompanyID AND ProductCode = @ItemCode">
        <Column Name="QtyAvailable" DataType="System.Decimal"/>
        <CommandParameter Name="ItemCode" DataType="254" Expression="[ItemCode]"/>
        <CommandParameter Name="CompanyID" DataType="254" Expression="[CompanyID]"/>
      </TableDataSource>
      <TableDataSource Name="Table1" Alias="programs_config" DataType="System.Int32" Enabled="true" SelectCommand="SELECT QtyDecimalValue FROM programs_config WHERE CompanyID = @CompanyID">
        <Column Name="QtyDecimalValue" DataType="System.UInt32"/>
        <CommandParameter Name="CompanyID" DataType="254" Expression="[CompanyID]"/>
      </TableDataSource>
    </MySqlDataConnection>
    <Parameter Name="FromDate" DataType="System.String"/>
    <Parameter Name="ToDate" DataType="System.String"/>
    <Parameter Name="CompanyID" DataType="System.Int32"/>
    <Parameter Name="ItemCode" DataType="System.String"/>
    <Parameter Name="OrderBy" DataType="System.String"/>
  </Dictionary>
  <inherited Name="Page1" Landscape="true" PaperWidth="297" PaperHeight="210" RawPaperSize="9" FirstPageSource="15" OtherPagesSource="15">
    <inherited Name="PageHeader1" Width="1047.06">
      <inherited Name="_CompanyName"/>
      <ChildBand Name="Child1" ZOrder="-1" Top="41.8" Width="1047.06" Height="122.85">
        <TextObject Name="Text1" Left="812.7" Top="9.45" Width="189" Height="18.9" Text="[FromDate]" Format="Custom" Format.Format="d MMMM yyy"/>
        <TextObject Name="Text3" Left="812.7" Top="37.8" Width="189" Height="18.9" Text="[ToDate]" Format="Custom" Format.Format="d MMMM yyy"/>
        <TextObject Name="Text22" Left="699.3" Top="9.45" Width="94.5" Height="18.9" Text="From Date:" HorzAlign="Right" TextFill.Color="DimGray"/>
        <TextObject Name="Text23" Left="699.3" Top="37.8" Width="94.5" Height="18.9" Text="To Date:" HorzAlign="Right" TextFill.Color="DimGray"/>
        <TextObject Name="Text31" Left="37.8" Top="9.45" Width="642.6" Height="56.7" Text="Item History for [ItemCode]" Font="Segoe UI Light, 22pt" TextFill.Color="OliveDrab"/>
        <ShapeObject Name="Shape11" Top="75.6" Width="1039.5" Height="37.8" Border.Color="Gainsboro" Fill.Color="WhiteSmoke" Shape="RoundRectangle"/>
        <TextObject Name="Text90" Left="9.45" Top="85.05" Width="94.5" Height="18.9" Text="Date"/>
        <TextObject Name="Text91" Left="160.65" Top="85.05" Width="85.05" Height="18.9" Text="Document #" HorzAlign="Right"/>
        <TextObject Name="Text92" Left="869.4" Top="85.05" Width="170.1" Height="18.9" Text="Client\Supplier Name"/>
        <TextObject Name="Text93" Left="463.05" Top="85.05" Width="85.05" Height="18.9" Text="Qty change" HorzAlign="Right"/>
        <TextObject Name="Text94" Left="557.55" Top="85.05" Width="94.5" Height="18.9" Text="Total Cost" HorzAlign="Right"/>
        <TextObject Name="Text95" Left="661.5" Top="85.05" Width="94.5" Height="18.9" Text="Total Excl" HorzAlign="Right"/>
        <TextObject Name="Text96" Left="255.15" Top="85.05" Width="94.5" Height="18.9" Text="Trans Type"/>
        <TextObject Name="Text97" Left="765.45" Top="85.05" Width="94.5" Height="18.9" Text="User"/>
        <TextObject Name="Text111" Left="378" Top="85.05" Width="75.6" Height="18.9" Text="Prev. Qty" HorzAlign="Right"/>
        <TextObject Name="txtDescription" Left="240.25" Top="49.25" Width="387.45" Height="18.9" NullValue="''" Font="Segoe UI, 11pt" TextFill.Color="OliveDrab"/>
      </ChildBand>
    </inherited>
    <DataBand Name="Data1" ZOrder="0" Top="168.65" Width="1047.06" Height="37.8" CanGrow="true" CanShrink="true" AfterDataEvent="Data1_AfterData" DataSource="Item_History">
      <TextObject Name="Text98" Left="9.45" Width="141.75" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.TransDate]" Format="Custom" Format.Format="yyyy/MM/dd HH:mm"/>
      <TextObject Name="Text99" Left="160.65" Width="85.05" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.TransID]" HorzAlign="Right"/>
      <TextObject Name="Text100" Left="869.4" Width="170.1" Height="37.8" CanGrow="true" CanShrink="true" Text="[Item_History.ClientName]"/>
      <TextObject Name="txtQty" Left="463.05" Width="85.05" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.Qty]" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text102" Left="557.55" Width="94.5" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.TransTotalCost]" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text103" Left="661.5" Width="94.5" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.TransTotalExcl]" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text104" Left="255.15" Width="113.4" Height="37.8" CanGrow="true" CanShrink="true" Text="[Item_History.TransType]"/>
      <TextObject Name="Text105" Left="765.45" Width="94.5" Height="18.9" CanGrow="true" CanShrink="true" Text="[Item_History.SalesRep]"/>
      <TextObject Name="txtPrevQty" Left="378" Width="75.6" Height="18.9" Text="[Item_History.QtyAvailable]" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <DataFooterBand Name="DataFooter1" Top="210.45" Width="1047.06" Height="56.7" AfterDataEvent="DataFooter1_AfterData">
        <ShapeObject Name="Shape12" Top="9.45" Width="1039.5" Height="37.8" Border.Color="Gainsboro" Fill.Color="WhiteSmoke" Shape="RoundRectangle"/>
        <TextObject Name="txtQtyAvail" Left="255.15" Top="18.9" Width="122.85" Height="18.9" Text="[Curr_QtyAvailable.QtyAvailable]" WordWrap="false" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text112" Left="66.15" Top="18.9" Width="179.55" Height="18.9" Text="Current Qty Available: " HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      </DataFooterBand>
    </DataBand>
    <PageFooterBand Name="PageFooter1" ZOrder="-1" Top="271.15" Width="1047.06" Height="37.8">
      <TextObject Name="Text36" Left="9.45" Top="9.45" Width="94.5" Height="18.9" Text="[PageNofM]" Font="Arial, 9pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text79" Left="765.45" Top="9.45" Width="94.5" Height="18.9" Text="Print Date:" HorzAlign="Right" TextFill.Color="DimGray"/>
      <TextObject Name="Text78" Left="869.4" Top="9.45" Width="160.65" Height="18.9" Text="[Date]" TextFill.Color="DimGray"/>
    </PageFooterBand>
  </inherited>
  <DialogPage Name="Form1" ZOrder="1" Width="594" Height="398" AcceptButton="btnOk" CancelButton="btnCancel" ShownEvent="Form1_Shown">
    <ButtonControl Name="btnOk" Left="406" Top="307" Height="40" Anchor="Bottom, Right" Font="Segoe UI Light, 11pt" TabIndex="0" Text="OK" ClickEvent="btnOk_Click" DialogResult="OK"/>
    <ButtonControl Name="btnCancel" Left="489" Top="307" Height="40" Anchor="Bottom, Right" Font="Segoe UI Light, 11pt" TabIndex="1" Text="Cancel" DialogResult="Cancel"/>
    <DateTimePickerControl Name="dtpFromDate" Left="272" Top="96" Width="220" Height="27" Font="Segoe UI, 11pt" ForeColor="DimGray" TabIndex="2" CustomFormat="d MMMM yyy" Format="Custom" Value="01/02/2014 16:15:55"/>
    <DateTimePickerControl Name="dtpToDate" Left="272" Top="144" Width="220" Height="27" Font="Segoe UI, 11pt" ForeColor="DimGray" TabIndex="3" CustomFormat="d MMMM yyy" Format="Custom" Value="01/02/2014 16:14:02"/>
    <LabelControl Name="Label1" Left="120" Top="100" Width="74" Height="20" Font="Segoe UI Light, 11pt" TabIndex="4" Text="From Date"/>
    <LabelControl Name="Label2" Left="120" Top="144" Width="56" Height="20" Font="Segoe UI Light, 11pt" TabIndex="5" Text="To Date"/>
    <LabelControl Name="Label3" Left="24" Top="24" Width="154" Height="37" Font="Segoe UI Light, 20pt" ForeColor="OliveDrab" TabIndex="6" Text="Item History"/>
    <ComboBoxControl Name="cboOrderBy" Left="272" Top="244" Width="221" Font="Segoe UI Light, 11pt" TabIndex="7" ClickEvent="" DropDownStyle="DropDownList" DropDownWidth="233" ItemHeight="20" ItemsText="Date&#13;&#10;Document #&#13;&#10;Transaction Type&#13;&#10;Client Name&#13;&#10;Sales Rep"/>
    <LabelControl Name="Label5" Left="120" Top="244" Width="116" Height="20" Font="Segoe UI Light, 11pt" TabIndex="5" Text="Order records by"/>
    <LabelControl Name="Label6" Left="120" Top="200" Width="73" Height="20" Font="Segoe UI Light, 11pt" TabIndex="5" Text="Item Code"/>
    <TextBoxControl Name="txtItemCode" Left="272" Top="200" Width="220" Height="27" Font="Segoe UI, 11pt" TabIndex="8" ReportParameter="ItemCode"/>
  </DialogPage>
</inherited>
