<?xml version="1.0" encoding="UTF-8" ?>
<ActiveReportsLayout 
	GUIDLIB="{A17C4A82-60FE-4620-9EC4-30B1399CB9A8}" GUIDREP="{A7F1A70F-7A09-4CBC-B68D-0BC58604DCB9}" 
	LICENSE="10000000"
	PrintWidth="11000"
	ShowParamUI="0"
	DocumentName="Loan Ledger (Sub)"
	ScriptLang="VBScript"
>
<Watermark
		>
</Watermark>
<Script>
<![CDATA[option explicit

private mBalance

Sub OnReportStart

' Reset balance
  mBalance = 0
  rpt.Detail.backstyle = 1

  ' Hide if nothing to show
  rpt.GroupHeader1.Visible = Not rpt.data.Recordset.EOF 
  rpt.Detail.Visible = rpt.GroupHeader1.Visible
  rpt.GroupFooter1.Visible = rpt.GroupHeader1.Visible

End Sub

Sub OnDataInitialize
	
	' Create Fields for Debit/ Credit, check count as this will cause error
	' the second and subsequent times the Sub Report is generated.
	if rpt.fields.count = 0 then
		rpt.Fields.Add "Debit"
		rpt.Fields.Add "Credit"
		rpt.Fields.Add "Balance"
	end if

End Sub

Sub OnFetchData(eof)
	
	' Set Field Values.
	If rpt.data.Recordset.EOF then
		exit sub
	Elseif rpt.data.Recordset.Fields("Value").Value > 0 then
		rpt.Fields("Debit").Value = rpt.data.Recordset.Fields("Value").Value
		rpt.Fields("Credit").Value = ""
	Else
		rpt.Fields("Credit").Value = -rpt.data.Recordset.Fields("Value").Value
		rpt.Fields("Debit").Value = ""
	End If
	
	' Running balance.
	mbalance = mbalance + rpt.data.Recordset.Fields("Value").Value
	rpt.fields("Balance").Value = mbalance

End Sub
]]></Script>
<PageSettings>
</PageSettings>
<StyleSheet>
	<Style Name="Normal"
	Value="font-family: Arial; font-style: normal; font-variant: inherit; font-weight: normal; font-size: 10pt; font-size-adjust: inherit; font-stretch: inherit; color: rgb(0,0,0); background-color: rgb(255,255,255); background-image: inherit; background-repeat: inherit; background-attachment: inherit; background-x-position: inherit; background-y-position: inherit; opacity: inherit; word-spacing: inherit; letter-spacing: inherit; text-decoration: none; vertical-align: inherit; text-transform: inherit; text-align: inherit; text-indent: inherit; unicode-bidi: inherit; line-height: inherit; white-space: inherit; ddo-can-grow: inherit; ddo-can-shrink: inherit; ddo-char-set: 0; "
	/>
	<Style Name="Heading1"
	Value="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 16pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading2"
	Value="font-family: Times New Roman; font-style: italic; font-variant: inherit; font-weight: bold; font-size: 14pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading3"
	Value="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 13pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading4"
	/>
</StyleSheet>
<Sections>
	<Section Type="GroupHeader" Name="GroupHeader1"
		Height="580"
	>
		<Control 
		Type="AR.Label"
		Name="lblHeading"
		Left="30"
		Top="30"
		Width="10910"
		Height="260"
		BorderTopStyle="1"
		BorderTopColor="0"
		BorderLeftStyle="1"
		BorderLeftColor="0"
		BorderRightStyle="1"
		BorderRightColor="0"
		BorderBottomStyle="1"
		BorderBottomColor="0"
		BorderShadow="1"
		Caption="Transactions"
		ClassName="Normal"
		Style="font-weight: bold; ddo-char-set: 1; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblULine"
		Left="0"
		Top="360"
		Width="11440"
		Height="200"
		BorderBottomStyle="1"
		BorderBottomColor="0"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblReference"
		Left="1000"
		Top="360"
		Width="1100"
		Height="200"
		Caption="Reference"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblElement"
		Left="2100"
		Top="360"
		Width="750"
		Height="200"
		Caption="Element"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblComment"
		Left="6195"
		Top="360"
		Width="4785"
		Height="195"
		Caption="Comment"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblDate"
		Left="0"
		Top="360"
		Width="1000"
		Height="195"
		Caption="Date"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblDebit"
		Left="2850"
		Top="360"
		Width="1095"
		Height="195"
		Caption="Debit"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblCredit"
		Left="3945"
		Top="360"
		Width="1095"
		Height="195"
		Caption="Credit"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblBalance"
		Left="5055"
		Top="360"
		Width="1095"
		Height="195"
		Caption="Balance"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
<Script>
<![CDATA[
Sub OnFormat

End Sub
]]></Script>
	</Section>
	<Section Type="Detail" Name="Detail"
		Height="195"
		CanShrink="1"
	>
		<Control 
		Type="AR.DataControl"
		Name="Data"
		Left="-2000"
		Top="-2000"
		Width="16"
		Height="299"
		Visible="0"
		Tag="C:\Program Files\Intersoft\finPOWER5\SYSTEM.MDW?C:\Program Files\Intersoft\finPOWER5\finDEMO.mdb"
		ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Intersoft\finPOWER5\finDEMO.mdb;User Id=User;Password=user;Jet OLEDB:System database=C:\Program Files\Intersoft\finPOWER5\SYSTEM.MDW"
		RecordSource="SELECT ContractId,Date,ElementId,Reference,Value,Comment FROM Transactions WHERE ContractId=&apos;&lt;%ContractId%&gt;&apos; ORDER BY Date,TransactionId"
		LockType="1"
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtElementId"
		DataField="ElementId"
		Left="2100"
		Top="0"
		Width="750"
		Height="190"
		Text="ElementId"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtDate"
		DataField="Date"
		Left="0"
		Top="0"
		Width="1000"
		Height="190"
		Text="Date"
		OutputFormat="d/mm/yyyy"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtReference"
		DataField="Reference"
		Left="1000"
		Top="0"
		Width="1100"
		Height="190"
		Text="Reference"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numDebit"
		DataField="Debit"
		Left="2850"
		Top="0"
		Width="1100"
		Height="190"
		Text="Debit"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtComment"
		DataField="Comment"
		Left="6195"
		Top="0"
		Width="4785"
		Height="195"
		Text="Comment"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numCredit"
		DataField="Credit"
		Left="3950"
		Top="0"
		Width="1100"
		Height="190"
		Text="Credit"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numBalance"
		DataField="Balance"
		Left="5050"
		Top="0"
		Width="1100"
		Height="190"
		Text="Balance"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
<Script>
<![CDATA[
Sub OnFormat
	
	' Don't Show zero values
	rpt.numDebit.Visible = (rpt.numDebit <> "0.00")
	rpt.numCredit.Visible = (rpt.numCredit <> "0.00")

	' Format oddline feature
	rpt.Sections("Detail").backstyle = 1 - rpt.Sections("Detail").backstyle

End Sub
]]></Script>
	</Section>
	<Section Type="GroupFooter" Name="GroupFooter1"
		Height="60"
		CanGrow="0"
	>
<Script>
<![CDATA[
Sub OnFormat

End Sub
]]></Script>
	</Section>
</Sections>
</ActiveReportsLayout>
