Serial No. increnment issue in report (i.e Classic / RTC)

manisharma31manisharma31 Member Posts: 285
edited 2012-04-24 in NAV Three Tier
I am trying to use the same, but the problem is the sr no. are not displayed correctly.

If there is one gap in the purchase line then the sr no. is not displayed correctly.

1 1001 Manual for Loudspeakers,Manual for Loudspeakers with

1 Stand for Loudspeakers LS-150

2 1002 Spike for LS-100

3 1003 Base speaker unit 15" 100W

I have tried many workarounds, but it does not work.

In india database there is a report id. 16593 which is an example of this issue..
Regards,
Manish

Answers

  • clauslclausl Member Posts: 455
    Love to help, but I don't have access to the India Database.

    So you need to be more specific on what the issue is for us to help you.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • manisharma31manisharma31 Member Posts: 285
    The sr no. are not displayed correctly in a purchase order report, below is the example of how the report is displayed.

    Sr No. Item Code Item Desc
    1 1001 Manual for Loudspeakers,Manual for Loudspeakers with
    1 Stand for Loudspeakers LS-150
    2 1002 Spike for LS-100
    3 1003 Base speaker unit 15" 100W
    with extened warranty.

    If there we enter description in second line of the purchase order then there is issue of displaying the serial no.

    I have tried many workarounds, but it does not work (i.e. Check Item Code for blank in 2nd line,try to hide the 2nd sr no. RTC)
    Regards,
    Manish
  • vijay_gvijay_g Member Posts: 884
    You need to increment serial no. when SalesInvoiceLine."No." is not equal to blank.(this is as per report no.16593 on integer1 dataitem where serial no. have been increment).
    Hope this help you..
  • manisharma31manisharma31 Member Posts: 285
    Here is an good example of the excise invoice.
    In the Posted Sales Invoice you can see that only 2 item are there & for 1st item the desc. is entered in line no. 10000,20000,30000 & 40000.
    Where as for 2nd item there is only single desc.

    In report the Sr No. is shown as 1,2,3,4,5 where as it should be shown as 1 & 2 only, cause the invoice is having only 2 items.
    Regards,
    Manish
  • mohana_cse06mohana_cse06 Member Posts: 5,503
    Try
    IF SalesInvoiceLine."No." <> '' THEN
      SNo := SNo + 1;
    
  • BeliasBelias Member Posts: 2,998
    Try
    IF SalesInvoiceLine."No." <> '' THEN
      SNo := SNo + 1;
    
    I don't know that report, but with this code, he will probably get something like

    1
    1
    1
    1
    2

    Isn't it? manish, IF this is not what you want, you can do:
    a. use another variable to show the serial no. and clear the variable while looping the rows
    clear(SNoToShow);
    IF (SalesInvoiceLine."No." <> '') AND (SalesInvoiceLine.type <> SalesInvoiceLine.type::" ") THEN BEGIN
      //I would add the condition on "type", too...in case they use extended texts.
      SNo := SNo + 1;
      SNoToShow := SNo;
    END;
    

    or (this is more funny), use the "hideduplicates" property of the rdlc report, on the textbox of serial no. (this must be done after applying mohana's code, obviously)...otherwise you won't have duplicates to remove :wink:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • rhpntrhpnt Member Posts: 688
    I am trying to use the same, but the problem is the sr no. are not displayed correctly.

    If there is one gap in the purchase line then the sr no. is not displayed correctly.

    1 1001 Manual for Loudspeakers,Manual for Loudspeakers with

    1 Stand for Loudspeakers LS-150

    2 1002 Spike for LS-100

    3 1003 Base speaker unit 15" 100W

    I have tried many workarounds, but it does not work.

    In india database there is a report id. 16593 which is an example of this issue..

    Considering all your passed exams under your signature I'm amazed that this represents such a problem that you are forced to post it on this forum. Next time do please stick to NAV naming rules and write "Line No.".
  • manisharma31manisharma31 Member Posts: 285
    This forum is not to test anyone of what he has achived, rather than to help others of their problems.

    Looks you have not read all the reply posted here.
    Regards,
    Manish
  • rhpntrhpnt Member Posts: 688
    This forum is not to test anyone of what he has achived, rather than to help others of their problems.
    I agree, untill you don't expect others (even MVP's) to do basic programming tasks for you!
    Looks you have not read all the reply posted here.
    I read enough to know how you managed to pass those exams...
  • vijay_gvijay_g Member Posts: 884
    #-o
    :mrgreen:
    \:D/
  • manisharma31manisharma31 Member Posts: 285
    So you can surely help me out of the basic problem rhpnt then.
    Regards,
    Manish
  • manisharma31manisharma31 Member Posts: 285
    @Belias

    Hideduplicates is also not working, also tried with the visibility property also but no luck.
    Regards,
    Manish
  • mohana_cse06mohana_cse06 Member Posts: 5,503
    You can try something like
    SNoTxt := '';
    IF SalesInvoiceLine."No." <> '' THEN BEGIN
      IF SNoTxt <> FORMAT(SNo) THEN BEGIN
        SNo := SNo + 1;
        SNoTxt := FORMAT(SNo);
      END;
    END;
    

    Where SNoTxt is a text type variable
    Assign SNoTxt in SourceExp
  • rhpntrhpnt Member Posts: 688
    So you can surely help me out of the basic problem rhpnt then.
    I don't have to, Belias already (nearly) solved it some posts ago...
  • BeliasBelias Member Posts: 2,998
    yes, i gave you 2 solutions (even code snippets by me and mohana) that if applied correctly are supposed to solve your problem .
    Your problem is most probably "dirty data" that spans from line "1" to the subsequent lines in the dataset.
    It's now your duty (and job) to figure out how to apply our suggestions and make the report work (actually, as rhpnt remarked, if you got certified you should have experience to solve the problem..which is PROBABLY solvable without even opening the rdlc designer)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • manisharma31manisharma31 Member Posts: 285
    Both Solutions.
    rhpnt wrote:
    I don't have to, Belias already (nearly) solved it some posts ago...
    Regards,
    Manish
  • mohana_cse06mohana_cse06 Member Posts: 5,503
    Can you show us the lines in your Table and sorting order in report?
  • manisharma31manisharma31 Member Posts: 285
    Already posted the screen shot on 23rd April.

    You can also see the same in Cronus India DB, Posted Sales Invoice No. 103014 & Print Excise Invoice.
    Regards,
    Manish
  • mohana_cse06mohana_cse06 Member Posts: 5,503
    I tried with below code and working fine..
    Integer1 - OnAfterGetRecord()
    //IF NOT (SNo = 1) THEN
    IF Number = 1 THEN
      SalesInvoiceLine.FINDFIRST
    ELSE
      SalesInvoiceLine.NEXT;
    
    PrevSNo := '';
    IF SalesInvoiceLine."No." <> '' THEN BEGIN
      IF PrevSNo <> FORMAT(SNo) THEN BEGIN
        SNo := SNo + 1;
        PrevSNo := FORMAT(SNo);
      END;
    END;
    
  • manisharma31manisharma31 Member Posts: 285
    Thanks mohana_cse06

    I tried something & it worked, below is the code.

    IF SalesInvoiceLine."No."<>'' THEN BEGIN
    SrNo:=INCSTR(SrNo1);
    SrNo1:=SrNo;
    END ELSE
    SrNo:='';

    SrNo & SrNo1 data types = code.
    SrNo1:=0; assigned on OnPreReport trigger
    Attaching the screen shot.
    Regards,
    Manish
Sign In or Register to comment.