How to modify the custom cheque layout to use the CPA date format.
Steps:
On the right hand side you will see a window with Events listed out. Select the OnGetText event and click on the window below. Select the window at the bottom it will automatically show you some text like begin, Text:= and End. Delete all the text in this and paste the following code and save the layout.
procedure ChqDateOnGetText(var Text: String); i, j : Integer; begin Text := FormatDateTime('ddmmyyyy',CustomPaycards['Pay Date']); i := length(Text) * 2; j := 1; while j < i do begin Insert(' ', Text, j+1); j := j +2; end; end; |
**Note**
If you want some other date format other than the one shown in the code you can change the ddmmyyyy in the above code to other formats like (mmddyyyy. yyyymmdd etc).Also make sure in the above code the CustomPaycards is the datapipeline value and Pay Date is the Datafield value which you noted in step 2. If it is different than use what you have noted in step 2.
This above code is to insert one blank space between each date character if you need to have more than one blank space you can increase the spaces by editing the code. For Example:Insert(' ', Text, j+1); (insert one blank space between date characters)
Insert(' ', Text, j+1); (insert two blank spaces, between the date characters)