Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

strLFix in AX 2012 Cheque_US report

$
0
0

Hi!

My client needs some modifications to the Cheque_US report that will print on an already pre-printed paper. Basically, he has the design and what Ax prints must fit perfectly in there. So far, so good...

Standard AX deals with slips parts of checks by creating and concatenating a string variable where all the information is gathered, using mostly strLfix() or strRFix() to keep a somehow natural align on the reports.

 

But, these are not working quite as the client needs. If I have 2 records (one below each other) to concatenate in the chequeSlipTxt variable and just one field has distinct length values for each record, the resulting 2 lines will not be aligned. For example, if I would to print:          

strfmt("%1\r\n%2",

strLFix("abcd",20)+ "end",

strLFix("ab",20)+ "end")

the result will look like this:

abcd                end

ab                  end

So even if these two lines have a strLen of 20 plus strLen("end"), an equal length in theory, the physical length is distinct. I understand why this is happening, but for the client this is not acceptable. With longer string lines, the visual impact is noticeable and most important, it leads to some lines not fitting on the pre-printed paper, while some do.

Does anyone have an idea how to tweak these reports to have each column from each concatenated row to correctly align one below each other? Perhaps, using the third argument for these methods (which is by default ' ') might do the trick, but what character to use? Ideally, I am not looking for an overall modification of the reports (changing the standard variable concatenating method with actual fields from the Data Source or display methods), but any idea will be very welcomed.

Thank you!

 


Viewing all articles
Browse latest Browse all 9880