strLFix in AX 2012 Cheque_US report

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!

Hi anton,

Once u try this Design–>fields—>properties—>DynamicHeight=Yes.

Thanks,

SureSh.

Before I also faced the same problem. But i was tried like this its was working fine.

The String or Real what ever your calling in your report.before this you add some Textcontrols in one programmable section of your report. And add that controlname in (string or real field) " ModelFieldname property".

see the below screen shot . you can easily understand .

5773.Doc1.docx (124 KB)Hi Anton,

Try in this way .

Thanks

Ramya.

Hi Anton,

Before I also faced the same problem. But i was tried like this its was working fine.

The String or Real what ever your calling in your report.before this you add some Textcontrols in one programmable section of your report. And add that controlname in (string or real field) " ModelFieldname property".

see the below screen shot . you can easily understand .

7206.Doc1.docx (124 KB)

Try in this way .

Thanks

Ramya.

Hi!

It seems I forgot to mention that this is the 2012 SSRS report Cheque_US that displays for the Slip parts one single field that is created in code by Ax from concatenating a lot of information.

Something like this:

while select crosscompany specTrans

order by specTrans.RecId

{

vendTrans = specTrans.vendTrans();

chequeSlipTxt += strFmt(’%1 %2 %3 %4 %5 %6\r\n’,

strLFix(vendTrans.Invoice,15),

strLFix(date2str(invoiceDate,-1,-1,-1,-1,-1,-1, DateFlags::None),10),

vendTrans.CurrencyCode,

num2str(-vendTrans.AmountCur, 16, 2, -1, -1),

num2str(vendCashDiscAmount, 12, 2, -1, -1),

num2str(paymAmount,16, 2, -1, -1));

}

tmpChequePrintout.SlipTxt += chequeSlipTxt ;

So, as you can see, all the information is put in one single field and that part of the report I am interested in contains just this one field. But, because if the string functions the way this information ends up arranged is problematic.

Thank you.

Hi anton,

you resolved this issue…
i am also facing same thing. My case i want just invoice number and description after some lines i need to print total amount …
can you share how u resolve this issue.

Thanks,

Hi Suresh,

I ended creating new fields on the temp table and populate them individually to have things flow correctly. Not exactly what I wanted to go for, but I didn’t have any other option.

Thanks,

Andreea

Hi Suresh,

I ended creating new fields on the temp table and populate them individually to have things flow correctly. Not exactly what I wanted to go for, but I didn’t have any other option.

Thanks,

Andreea

Hi andreea,

Thanks for sharing your experience.

If the field on the SSRS cheque “report” that is going to contain the slip text is font COURIER (or some other fixed width font) it should work with what you were originally doing with StrLfix

Hi Suresh,

Can you please send me code how you are approaching this . For me also same like Invoice number and Description need to be printed on report . But in ax2012 r3 it is an Str control . Format is changing

Can you please tell me how u did format the control .

Please advise me how to do that .