The sample code below shows how to retrieve DataSet of Debtor Statement.
classARStatements{privateUserSessionmyUserSession;publicARStatements(UserSessionuserSession){myUserSession=userSession;}publicSystem.Data.DataSetGetDebtorStatement(){AutoCount.ARAP.DebtorStatement.DebtorStatementstatement=AutoCount.ARAP.DebtorStatement.DebtorStatement.Create(myUserSession);AutoCount.ARAP.DebtorStatement.DebtorStatementCriteriacrit=newAutoCount.ARAP.DebtorStatement.DebtorStatementCriteria();//Set filter by date rangecrit.FromDate=newDateTime(2023,10,1);crit.ToDate=newDateTime(2023,10,31);//Load statement datastatement.Inquire(crit);returnstatement.ResultDataSet;}}
Export Debtor Statement to PDF
This sample uses class of DebtorStatement and method of ExportReportByName to generate PDF File.
classARStatements{privateUserSessionmyUserSession;publicARStatements(UserSessionuserSession){myUserSession=userSession;}publicSystem.Data.DataSetGetDebtorStatement(){AutoCount.ARAP.DebtorStatement.DebtorStatementstatement=AutoCount.ARAP.DebtorStatement.DebtorStatement.Create(myUserSession);AutoCount.ARAP.DebtorStatement.DebtorStatementCriteriacrit=newAutoCount.ARAP.DebtorStatement.DebtorStatementCriteria();//Set filter by date rangecrit.FromDate=newDateTime(2023,10,1);crit.ToDate=newDateTime(2023,10,31);//Load statement datastatement.Inquire(crit);returnstatement.ResultDataSet;}//debtorCode = "300-C001";//filepath = @"C:\Temp\MyExportName.pdf"publicvoidExportToPdfByDebtor(stringdebtorCode,stringfilepath){AutoCount.ARAP.DebtorStatement.DebtorStatementstatement=AutoCount.ARAP.DebtorStatement.DebtorStatement.Create(myUserSession);AutoCount.ARAP.DebtorStatement.DebtorStatementCriteriacrit=newAutoCount.ARAP.DebtorStatement.DebtorStatementCriteria();AutoCount.SearchFilter.ReportFilterfilterDebtor=newAutoCount.SearchFilter.ReportFilter();//Set filter by date rangecrit.FromDate=newDateTime(2023,10,1);crit.ToDate=newDateTime(2023,10,31);//Only one debtor in one document.filterDebtor.ByOne(debtorCode);crit.DebtorFilter=filterDebtor;//Load statement datastatement.Inquire(crit);//Export to PDF//"Debtor Statement - 6 Months" is the name of the Report TemplateAutoCount.Report.ReportTool.ExportReportByName("Debtor Statement - 6 Months",statement.GetReportDataSource(),myUserSession,newAutoCount.Report.BasicReportOption(),newAutoCount.Report.ReportInfo("","","",""),filepath,AutoCount.Report.ExportFormat.Pdf);}}