Programmer:Debtor Statement (19)

From AutoCount Resource Center

References of AutoCount Accounting version 1.8 / 1.9

BCE.AutoCount.dll
BCE.AutoCount.CommonAccounting.dll
BCE.AutoCount.MainEntry.dll
BCE.Utils.dll
BCE.Utils.UI.dll
BCE.AutoCount.ARAP.dll

Extract data of Debtor Statement with API

The sample code below shows how to retrieve DataSet of Debtor Statement.

public System.Data.DataSet GetDebtorStatement(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.ARAP.DebtorStatement.DebtorStatement statement =
        BCE.AutoCount.ARAP.DebtorStatement.DebtorStatement.Create(dbSetting);

    BCE.AutoCount.ARAP.DebtorStatement.DebtorStatementCriteria crit = new
        BCE.AutoCount.ARAP.DebtorStatement.DebtorStatementCriteria();

    //Set filter by date range
    crit.FromDate = new DateTime(2018, 10, 1);
    crit.ToDate = new DateTime(2018, 10, 31);

    //Load statement data
    statement.Inquire(crit);

    return statement.ResultDataSet;
}

Export Debtor Statement to PDF

This sample uses class of DebtorStatement and method of ExportReportByName to generate PDF File.

//filepath =  @"C:\Temp\MyExportName.pdf"
public void ExportToPdfByDebtor(string debtorCode, string filepath, BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.ARAP.DebtorStatement.DebtorStatement statement =
        BCE.AutoCount.ARAP.DebtorStatement.DebtorStatement.Create(dbSetting);

    BCE.AutoCount.ARAP.DebtorStatement.DebtorStatementCriteria crit = new
        BCE.AutoCount.ARAP.DebtorStatement.DebtorStatementCriteria();
    BCE.AutoCount.ReportFilter.StringFilter filterDebtor = new BCE.AutoCount.ReportFilter.StringFilter();

    //Set filter by date range
    crit.FromDate = new DateTime(2018, 10, 1);
    crit.ToDate = new DateTime(2018, 10, 31);

    //Only one debtor in one document.
    filterDebtor.ByOne(debtorCode);
    crit.DebtorFilter = filterDebtor;

    //Load statement data
    statement.Inquire(crit);

    //Export to PDF
    //"Debtor Statement" is the name of the Report Template
    BCE.AutoCount.Report.ReportTool.ExportReportByName("Debtor Statement",
        statement.GetReportDataSource(), dbSetting,
        new BCE.AutoCount.BasicReportOption(),
        new BCE.AutoCount.Report.ReportInfo("", "", "", ""),
        filepath,
        BCE.AutoCount.Report.ExportFormat.Pdf);
}

See Also Report API

Category Reporting
AR
AP
Stock
Sales
Purchase

Go to menu

Go to top
Resources For AutoCount Software Developers