Check Printing

fahdfahd Member Posts: 226
Dear Experts,

We want to print the check from Nav, the report is already working fine.

But i have a problem that when the amount of check when shown in Alphabets the character of the first line breaks and continues in the second line.

I have attached the snap shot of how it is showing right now if you will see the attachment "Dir" is showing in first line and "hams. but it's just one word.

I have also tried using only one line with the multiline option and expanded it's height. But in multine option the gap between first and second line is less.Whereas in the physical check the second line is more down.

Please check it and let me know if it's possible to solve this.

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    What are the source expressions and length of the variables?
  • fahdfahd Member Posts: 226
    Dear Mohanna,
    Thanks for replying

    I have atted the the report design and the other snap consists of text length of each textline.

    FYI, i have tried decreasing and increasing the character lenght of each field.

    But if the amount is bigger than it will continue to the second line but with line broken.


    Thanks
  • SavatageSavatage Member Posts: 7,142
    Looks to me like you have a sizeable length.

    Try using "Arial Narrow" font or changing font size to something smaller.

    then you won't have to split the text description to make it fit on one line.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Set TextLine1 length to 80 and

    try by changing the copystr function from 1 to 50 to 1 to 80..
  • fahdfahd Member Posts: 226
    Hi Savatage,

    Thanks for the reply, but if in a case if the amount is bigger it will again break the line.

    i have tried using instead of 2 text line i used only text line1, and i have increased it's characters from 1 t0 150.

    i used the multiline option and expanded the box as much as it could.

    Now with with this application. it shows perfect, it's automatically takes the word to the next line.

    Now the only problem is if it goes to the next line the line space between first and second line is less. I just want like when it goes to the 2nd line there should be space.

    Please tell me if i can increase the line space between first and 2nd line. then the 2nd line will come exactly on the 2nd line of check.


    Kindly tell me how can i make this happen!
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    In general it is done by taking array varialbe of length 80 with Dimensions 2 (ex:DescriptionLine).

    call the function like this

    FormatNoText(DescriptionLine,<>,<>);

    Use DescriptionLine[1] and DescriptionLine[2] in your text boxes..
  • SavatageSavatage Member Posts: 7,142
    So what I'm reading is that the multiline property works exactly as you want except you wish there was more space between the lines.

    And if you break the description up into two lines you are having an issue of the first description ending in the middle of the word.

    I would use arial narrow and a small font size start the text as far to the left as possible - also use multiline and accept that the spacing is not going to be a wide as you like. :-k

    HMMm.Perhaps you can force the the Line break at the "&" symbol
  • fahdfahd Member Posts: 226
    Dear Harry,

    I have changed the font to Arial narrow (10). i can break the line "&" Symbol but it's not fixed because everyday the amount wil change sometimes it's in thousands sometimes might be hundred thousands so i can't fix it with & Symbol i guess.


    @ Mohanna, I didn't get u exactly. please tell me with little bit step's expalanation as i am not a proper programmer. :oops: So kindly help!

    Thanksss!
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I guess you are using report 1401 for Converting no. to text?

    If yes, Go to PrintCheck dataitem and check line

    FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");

    This is the line which converts CheckLedgEntry.Amount to text format and is stored in DescriptionLine variable which is a text datatype variable with 2 dimensions of length 80..

    And also check the sections PrintCheck-Footer
    which has 2 text boxes with Sourceexpr DescriptionLine[1] and DescriptionLine[2]
  • fahdfahd Member Posts: 226
    Dear Mohanna,

    Yes 1401 report is the one which converts.

    OK! Now i have found the following line in that report.


    FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");

    Please tell me what do i have to change here??


    FYI, This is the complete code under Printcheck Trigger.
    IF NOT TestPrint THEN BEGIN
      WITH GenJnlLine DO BEGIN
        CheckLedgEntry.INIT;
        CheckLedgEntry."Bank Account No." := BankAcc2."No.";
        CheckLedgEntry."Posting Date" := "Posting Date";
        CheckLedgEntry."Document Type" := "Document Type";
        CheckLedgEntry."Document No." := UseCheckNo;
        CheckLedgEntry.Description := Description;
        CheckLedgEntry."Bank Payment Type" := "Bank Payment Type";
        CheckLedgEntry."Bal. Account Type" := BalancingType;
        CheckLedgEntry."Bal. Account No." := BalancingNo;
        IF FoundLast THEN BEGIN
          IF TotalLineAmount < 0 THEN
            ERROR(
              Text020,
              UseCheckNo,TotalLineAmount);
          CheckLedgEntry."Entry Status" := CheckLedgEntry."Entry Status"::Printed;
          CheckLedgEntry.Amount := TotalLineAmount;
        END ELSE BEGIN
          CheckLedgEntry."Entry Status" := CheckLedgEntry."Entry Status"::Voided;
          CheckLedgEntry.Amount := 0;
        END;
        CheckLedgEntry."Check Date" := "Posting Date";
        CheckLedgEntry."Check No." := UseCheckNo;
        CheckManagement.InsertCheck(CheckLedgEntry);
    
        IF FoundLast THEN BEGIN
          IF BankAcc2."Currency Code" <> '' THEN
            Currency.GET(BankAcc2."Currency Code")
          ELSE
            Currency.InitRoundingPrecision;
          Decimals := CheckLedgEntry.Amount - ROUND(CheckLedgEntry.Amount,1,'<');
          IF STRLEN(FORMAT(Decimals)) < STRLEN(FORMAT(Currency."Amount Rounding Precision")) THEN
            IF Decimals = 0 THEN
              CheckAmountText := FORMAT(CheckLedgEntry.Amount,0,0) +
                COPYSTR(FORMAT(0.01),2,1) +
                PADSTR('',STRLEN(FORMAT(Currency."Amount Rounding Precision"))-2,'0')
            ELSE
              CheckAmountText := FORMAT(CheckLedgEntry.Amount,0,0) +
                PADSTR('',STRLEN(FORMAT(Currency."Amount Rounding Precision"))-STRLEN(FORMAT(Decimals)),'0')
          ELSE
            CheckAmountText := FORMAT(CheckLedgEntry.Amount,0,0);
          FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");
          VoidText := '';
        END ELSE BEGIN
          CLEAR(CheckAmountText);
          CLEAR(DescriptionLine);
          DescriptionLine[1] := Text021;
          DescriptionLine[2] := DescriptionLine[1];
          VoidText := Text022;
        END;
      END;
    END ELSE BEGIN
      WITH GenJnlLine DO BEGIN
        CheckLedgEntry.INIT;
        CheckLedgEntry."Bank Account No." := BankAcc2."No.";
        CheckLedgEntry."Posting Date" := "Posting Date";
        CheckLedgEntry."Document No." := UseCheckNo;
        CheckLedgEntry.Description := Text023;
        CheckLedgEntry."Bank Payment Type" := "Bank Payment Type"::"Computer Check";
        CheckLedgEntry."Entry Status" := CheckLedgEntry."Entry Status"::"Test Print";
        CheckLedgEntry."Check Date" := "Posting Date";
        CheckLedgEntry."Check No." := UseCheckNo;
        CheckManagement.InsertCheck(CheckLedgEntry);
    
        CheckAmountText := Text024;
        DescriptionLine[1] := Text025;
        DescriptionLine[2] := DescriptionLine[1];
        VoidText := Text022;
      END;
    END;
    
    ChecksPrinted := ChecksPrinted + 1;
    FirstPage := FALSE;
    
    PrintCheck - OnPostDataItem()
    
    FormatNoText(VAR NoText : ARRAY [2] OF Text[80];No : Decimal;CurrencyCode : Code[10])
    CLEAR(NoText);
    NoTextIndex := 1;
    NoText[1] := '';
                  // mod rw
    IF No < 1 THEN
      AddToNoText(NoText,NoTextIndex,PrintExponent,Text026)
    ELSE BEGIN
      FOR Exponent := 4 DOWNTO 1 DO BEGIN
        PrintExponent := FALSE;
        Ones := No DIV POWER(1000,Exponent - 1);
        Hundreds := Ones DIV 100;
        Tens := (Ones MOD 100) DIV 10;
        Ones := Ones MOD 10;
        IF Hundreds > 0 THEN BEGIN
          AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Hundreds]);
          AddToNoText(NoText,NoTextIndex,PrintExponent,Text027);
        END;
        IF Tens >= 2 THEN BEGIN
          AddToNoText(NoText,NoTextIndex,PrintExponent,TensText[Tens]);
          IF Ones > 0 THEN
            AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Ones]);
        END ELSE
          IF (Tens * 10 + Ones) > 0 THEN
            AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Tens * 10 + Ones]);
        IF PrintExponent AND (Exponent > 1) THEN
          AddToNoText(NoText,NoTextIndex,PrintExponent,ExponentText[Exponent]);
        No := No - (Hundreds * 100 + Tens * 10 + Ones) * POWER(1000,Exponent - 1);
      END;
    END;
    {
    AddToNoText(NoText,NoTextIndex,PrintExponent,Text028);
    AddToNoText(NoText,NoTextIndex,PrintExponent,FORMAT(No * 100) + '/100');
    
    IF CurrencyCode <> '' THEN
      AddToNoText(NoText,NoTextIndex,PrintExponent,CurrencyCode);
    }
    IF CurrencyCode <> '' THEN BEGIN
      Currency.GET(CurrencyCode);
       AddToNoText(NoText,NoTextIndex,PrintExponent,Currency.Description);
    END ELSE
      AddToNoText(NoText,NoTextIndex,PrintExponent,'Dirhams');
    
    IF CurrencyCode = 'AED' THEN
      AddToNoText(NoText,NoTextIndex,PrintExponent,Text028);
    
    TensDec := ((No * 100) MOD 100) DIV 10;
    OnesDec := (No * 100) MOD 10;
    IF TensDec >= 2 THEN BEGIN
      AddToNoText(NoText,NoTextIndex,PrintExponent,TensText[TensDec]);
      IF OnesDec > 0 THEN
        AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[OnesDec]);
    END ELSE
      IF (TensDec * 10 + OnesDec) > 0 THEN
        AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[TensDec * 10 + OnesDec])
      ELSE
       IF (CurrencyCode = 'AED') THEN
        AddToNoText(NoText,NoTextIndex,PrintExponent,Text026);
      IF (CurrencyCode = 'AED') THEN
       AddToNoText(NoText,NoTextIndex,PrintExponent,'Fills ONLY')
    
    ELSE
      AddToNoText(NoText,NoTextIndex,PrintExponent,' ONLY');
    

    Thanks alot!!
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Are you trying to print 1401 report or creating some other report using 1401?

    There is nothing to modify in 1401 report in both cases..
  • fahdfahd Member Posts: 226
    There is only one more report JV Report (50000). which i think uses amount to be converted into text.

    We barely use it.


    can it be possible if i use only TEXTLINE1 instead of two textlines and give characters range from 1 to 200. and within this when the line shifts to the second line it could give some space between first and the second line.

    For eg: amount like

    SEVEN HUNDRED TWENTY FIVE THOUSAND TWENTY
    TWO Dirhams & FIFTY FIVE Fills ONLY.


    So i could give some space between TWENTY TWO.

    If it's possible that i can make the same amount like this


    SEVEN HUNDRED TWENTY FIVE THOUSAND TWENTY


    TWO Dirhams & FIFTY FIVE Fills ONLY.


    I am just looking for a space between when the line shifts.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You didnt reply to my question..

    you need this in report1401 or customized report?
  • fahdfahd Member Posts: 226
    Specifically, for printing check there are 2 different reports according to different bank's check format.

    Which is getting printed from Payment Journal.


    Report 50022 and 50021.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    so you are using report1401 in those reports to convert numbers to text?
    If yes,can you show the where you called FormatNoText function
  • fahdfahd Member Posts: 226
    YEs.

    Ok in my report 50021 under the dataitem of Gen.JournalLine.

    Attached snapshot contains the code written on it.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    What is the datatype of numbertext?

    Make it similar to DescriptionLine in report 1401 (Texxt datatype with length 80 and dimensions 2)
  • fahdfahd Member Posts: 226
    The Length of numbertext is 100 already & it is the datatype of text.

    Should i change length to 80?
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Yes,
    what about the dimensions?

    After setting the dimentsions to 2, write numbertext[1] and numbertext[2] in textbox sourceexp..
  • fahdfahd Member Posts: 226
    yes it has 2 dimensions.

    ok now i have modify the following.


    1. Changed the variable Numbertext length to 80.

    2. in the form design i have changed the source exp from Textline 1 to Numbertext[1] and textline 2 to numbertext[2].


    But still it's breaking the word within the first line.
  • fahdfahd Member Posts: 226
    yessssss!!!


    I just decreased the text size from 80 to 50. now it's showing perfectly as i wanted.

    is there any harm if reduce it to 50 because the amount was within the 80 character that is why it was breaking it.

    If it's ok to reduce it to 50 characters then my work is done.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    fahd wrote:
    If it's ok to reduce it to 50 characters then my work is done.
    you should test this with all kinds of possibilities like big figures..
  • fahdfahd Member Posts: 226
    Yes i have went till the maximum and minimum as well it works fine.

    Thankssss alot Mohanna for such a great support!! you have really helped a lot, I really appreciate your time!

    Thanks once again!!
    :)
Sign In or Register to comment.