﻿<?xml version="1.0" encoding="utf-8"?>
<inherited BaseReport="..\..\Reports\Base.frx" ScriptLanguage="CSharp" DoublePass="true" StartReportEvent="_StartReport" ReportInfo.Created="05/15/2013 14:45:40" ReportInfo.Modified="06/08/2015 09:32:32" 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
  {

    int decimalValue = 0;
    
    
    private void _StartReport(object sender, EventArgs e)
    {
      decimalValue = Convert.ToInt32(Report.GetColumnValue(&quot;programs_config.QtyDecimalValue&quot;));
      string strHeader  = Report.GetParameterValue(&quot;Header&quot;).ToString();
      txtHeader.Text = &quot;Stock-take Item summary by :&quot; + strHeader;
      txtGroupName.Text = strHeader + &quot; Name&quot;;
      
    }
    
    
    

    private void Data1_AfterData(object sender, EventArgs e)
    {
      //total Qty Column format      
      
      decimal qtyVal = 0; 
      if (Decimal.TryParse(txtQtyAvailable.Text, out qtyVal))
      {
        txtQtyAvailable.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);
      }
     
    }

    private void DataFooter1_AfterData(object sender, EventArgs e)
    {
      //total Qty Column format      
      decimal qtyVal = 0; 
      if (Decimal.TryParse(txtQtyAvailableTotal.Text, out qtyVal))
      {
        txtQtyAvailableTotal.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);
      }
      
    }

    
   
    
  }
}
</ScriptText>
  <Dictionary>
    <MySqlDataConnection Name="Connection" ConnectionString="rijcmlqomabmqtwD7y3BaVO988XrjoBefSoHBX+xGSDpo0d+ot8yrzL17EhRvx7tW87ZuxDTsXprPmiOj80ATh2Aow+2w==">
      <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="Table" Alias="products" DataType="System.Int32" Enabled="true" SelectCommand="SELECT @Selection AS GroupName, SUM(QtyAvailable) AS QtyAvailable, SUM(CostPrice * QtyAvailable) AS TotalCost&#13;&#10;FROM products WHERE CompanyID = @CompanyID &#13;&#10;GROUP BY @Selection">
        <Column Name="QtyAvailable" DataType="System.Decimal"/>
        <Column Name="GroupName" DataType="System.String"/>
        <Column Name="TotalCost" DataType="System.Decimal"/>
        <CommandParameter Name="CompanyID" DataType="254" Expression="[CompanyID]"/>
        <CommandParameter Name="Selection" DataType="254"/>
      </TableDataSource>
      <TableDataSource Name="Table2" 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="CompanyID" DataType="System.Int32"/>
    <Parameter Name="Header" DataType="System.String"/>
    <Total Name="Total_Cost" Expression="[products.TotalCost]" Evaluator="Data1" PrintOn="DataFooter1"/>
    <Total Name="Total_QtyAvailable" Expression="[products.QtyAvailable]" Evaluator="Data1" PrintOn="DataFooter1"/>
    <Total Name="Count_Total_Items" TotalType="Count" Evaluator="Data1"/>
  </Dictionary>
  <inherited Name="Page1" RawPaperSize="9" FirstPageSource="15" OtherPagesSource="15">
    <inherited Name="PageHeader1">
      <inherited Name="_CompanyName"/>
      <ChildBand Name="Child1" ZOrder="-1" Top="41.8" Width="718.2" Height="103.95">
        <ShapeObject Name="Shape7" Top="56.7" Width="718.2" Height="37.8" Border.Color="Gainsboro" Fill.Color="WhiteSmoke" Shape="RoundRectangle"/>
        <TextObject Name="txtHeaderCost" Left="548.1" Top="66.15" Width="103.95" Height="18.9" Text="Total Cost" HorzAlign="Right"/>
        <TextObject Name="txtGroupName" Left="9.45" Top="66.15" Width="198.45" Height="18.9" Text="Group Name"/>
        <TextObject Name="txtHeaderQtyAvail" Left="434.7" Top="66.15" Width="103.95" Height="18.9" Text="Qty Available" HorzAlign="Center"/>
        <TextObject Name="txtHeader" Left="37.8" Width="652.05" Height="47.25" Text="Stock-Take summary by :" Font="Segoe UI Light, 22pt" TextFill.Color="OliveDrab"/>
      </ChildBand>
    </inherited>
    <DataBand Name="Data1" ZOrder="0" Top="149.75" Width="718.2" Height="18.9" AfterDataEvent="Data1_AfterData" DataSource="Table">
      <TextObject Name="Text4" Left="9.45" Width="198.45" Height="18.9" Cursor="Hand" Hyperlink.Kind="DetailPage" ClickEvent="Text4_Click" Text="[products.GroupName]" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtCostData" Left="548.1" Width="103.95" Height="18.9" Text="[products.TotalCost]" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtQtyAvailable" Left="434.7" Width="103.95" Height="18.9" Text="[products.QtyAvailable]" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <DataFooterBand Name="DataFooter1" Top="172.65" Width="718.2" Height="56.7" AfterDataEvent="DataFooter1_AfterData">
        <ShapeObject Name="Shape8" Top="9.45" Width="718.2" Height="37.8" Border.Color="Gainsboro" Fill.Color="WhiteSmoke" Shape="RoundRectangle"/>
        <TextObject Name="txtTotalCost" Left="548.1" Top="18.9" Width="103.95" Height="18.9" Text="[Total_Cost]" Format="Number" Format.UseLocale="true" HorzAlign="Right"/>
        <TextObject Name="txtQtyAvailableTotal" Left="434.7" Top="18.9" Width="103.95" Height="18.9" Text="[Total_QtyAvailable]" HorzAlign="Right"/>
        <TextObject Name="Text32" Left="9.45" Top="18.9" Width="245.7" Height="18.9" Text="Totals Excl Tax:   (Units X Qty's)" TextFill.Color="DimGray"/>
      </DataFooterBand>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" ZOrder="-1" Top="233.35" Width="718.2" Height="37.8">
      <TextObject Name="Text30" Left="189" Top="9.45" Width="94.5" Height="18.9" Text="[Count_Total_Items]"/>
      <TextObject Name="Text33" Top="9.45" Width="179.55" Height="18.9" Text="Group count:" HorzAlign="Right" TextFill.Color="DimGray"/>
    </ReportSummaryBand>
    <PageFooterBand Name="PageFooter1" ZOrder="-1" Top="275.15" Width="718.2" 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="434.7" Top="9.45" Width="94.5" Height="18.9" Text="Print Date:" HorzAlign="Right" TextFill.Color="DimGray"/>
      <TextObject Name="Text78" Left="538.65" Top="9.45" Width="160.65" Height="18.9" Text="[Date]" TextFill.Color="DimGray"/>
    </PageFooterBand>
  </inherited>
</inherited>
