The article describes how to request reports.
You can request reports for your account using the FCLite API system. Reports can show you information about your account activity, balance, orders, and trades for a specified period.
To request a report, you need to use the getReportUrl method of the ISystemSettingsProvider object.
getReportUrl Hide
typescriptjavascriptfunction getReportUrl(account, from, to, type, format, langID, callback)
This method takes an account object, a start date, an end date, a report type, a report format, a language, and a callback function as arguments. The callback function will receive either an error message or a URL that points to the generated report.
Use the method Hide
typescriptjavascriptconst main = async () => { try { // Create and log in to a session const session = FXConnectLiteSessionFactory.create('GetUrlSample') await login(session, options.user, options.password, options.tradingSystemUrl, options.connectionName) // Define a callback function that handles the result of the report request. const callback: IGetUrlCallback = { onError: function (error: string): void { console.log("Error: ", error) }, onSuccess: function (url: string): void { console.log("Url: ", url) }, } // Get the first account from the accounts manager. // Log out and exit await logout(session) } catch (error) { console.log('Failure:', { error }) process.exit(1) } process.exit(0) }
Provide the following parameters:
• Account ID: The unique identifier of the account you want to generate a report for.
• Start date and end date: The dates that define the beginning and the end of the report period. You can use any date format that is supported by JavaScript’s Date object.
• Report type: The type of report you want to generate. You can choose from different report types, such as CUSTOMER_ACCOUNT_STATEMENT, CUSTOMER_TRADE_ACTIVITY, or CUSTOMER_TRADE_SUMMARY.
• Report format: The format of the report output. You can choose from different formats, such as HTML, PDF, or CSV.
• Language: The language of the report content. You can use any language code that is supported by FCLite, such as enu for English or deu for German.
• Time zone: The time zone of the date and time values in the report. You can either use UTC for universal time or SERVER for the time zone of the server.
Questions and answers
How exactly can you get a report "From Inception" and "Till Now"?
It’s in public method IsystemSettingsProvider.getReportUrl. To skip the date parameter, you need to specify a year of date.
Get a report Hide
//From Date, Now session.getSystemSettingsProvider().getReportUrl(session.getAccountsManager().getAccountsInfo()[0], new Date(2022, 1, 10), new Date(0), ReportType.CUSTOMER_ACCOUNT_STATEMENT, ReportFormat.HTML, "enu", callback); https://fxpa.fxcorporate.com/fxpa/getreport.app/?token=CFDA48A22C4DE939917A4AB9E6A95B1ABF116CDF&cn=U100R8&report_name=REPORT_NAME_CUSTOMER_ACCOUNT_STATEMENT&lc=enu&outFormat=HTML&account=1144007343&from=2/10/2022 //Since Open, To Date session.getSystemSettingsProvider().getReportUrl(session.getAccountsManager().getAccountsInfo()[0], new Date(0), new Date(2022, 1, 15), ReportType.CUSTOMER_ACCOUNT_STATEMENT, ReportFormat.HTML, "enu", callback); https://fxpa.fxcorporate.com/fxpa/getreport.app/?token=2331A83132B3F00DCBDC8254DAFBC17D55ACB946&cn=U100R8&report_name=REPORT_NAME_CUSTOMER_ACCOUNT_STATEMENT&lc=enu&outFormat=HTML&account=1144007343&till=2/15/2022 //Since Open, Now session.getSystemSettingsProvider().getReportUrl(session.getAccountsManager().getAccountsInfo()[0], new Date(0), new Date(0), ReportType.CUSTOMER_ACCOUNT_STATEMENT, ReportFormat.HTML, "enu", callback); https://fxpa.fxcorporate.com/fxpa/getreport.app/?token=ED3065DEF693CA467406203998B7F166C6838C69&cn=U100R8&report_name=REPORT_NAME_CUSTOMER_ACCOUNT_STATEMENT&lc=enu&outFormat=HTML&account=1144007343