How to use or simulate INCSTR in new VS report environment

victor73victor73 Member Posts: 55
edited 2009-08-06 in NAV Three Tier
Hello I have the following Issue:

in a report header section as GL Entry (in classic client navision 2009) i need to simply
view a text using the following code line


VAT Register, Header (2) - OnPreSection()
CurrReport.SHOWOUTPUT(Type = Type::Sale);

IF Type = Type :: Sale THEN BEGIN
IF gBlnFirstPage THEN
gBlnFirstPage:= FALSE
ELSE
gCodNoSeriesForPage:= INCSTR(gCodNoSeriesForPage);
END


lets focus on the following line: gCodNoSeriesForPage:= INCSTR(gCodNoSeriesForPage);

this obviously increases the string (a series number)
I know that The trigger is not supported in RDLC environment, so I tried to define a textbox in the VAT Register, Header (2) - OnPreSection() in nav client
and set its sourexpr to a function that does what the OnPreSection exactly does: it returns the string increased by 1.
On the Classic nav client it works but I don't know how I can do the same exaclty thing in the rdlc side (in Visual Studio).
Can someone help me?
Thank you in advance

Comments

  • victor73victor73 Member Posts: 55
    Hello to all mibuso collaborators, can anybody give me an answer, or try to do so, to my topic?
    Thank you in advance
  • matttraxmatttrax Member Posts: 2,309
    So you need to code INCSTR in .NET?

    Well parse the string backwards until you get to something that's not a number. From that point to end of the string is the number you want to increment. Use something Int16 or Int32.Parse to convert the string to a number. Add 1 to it and append it to the part of the first string that came before the number.
  • victor73victor73 Member Posts: 55
    Thank you for your response,
    Exactly not,
    My issue is how to transform the line codes in OnPreSection trigger of the classic report client into the new reporting client and at that point precisely where and how to put my INCSTR function (using the suggestions you have just made),

    thank you
  • ara3nara3n Member Posts: 9,256
    why does your code need to be onpresection? and not onaftergetrecord trigger?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.