Report display method

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Not Verified) This post has 0 verified solutions | 4 Replies | 1 Follower

22 Posts
200 Points
Joined: 2012-8-8
Last Online:
2013-2-13 13:01
Location: Poland
Paul posted on 2012-10-13 18:32

Hi,

I have a problem with displaying a specific field in the report (body section). Let's assume that I have the following records in the table:

String1

String2

String3

I would like to display instead of "String1" just 1. Could you give me an advice how should I do it? 

Thank you.

All Replies

54 Posts
930 Points
Joined: 2012-5-18
Last Online:
2013-5-23 10:33
Location: INDIA
SAADULLAH replied on 2012-10-13 19:16

Hi Paul ,

Can u pls elaborate your Question . 

"I would like to display instead of "String1" just 1." Pls give with one Example ...


Don't Forget to Solution (Verified) Verify Solution Cool

Regards

SAADULLAH

www.msdynamicsax.weebly.com

 

22 Posts
200 Points
Joined: 2012-8-8
Last Online:
2013-2-13 13:01
Location: Poland
Paul replied on 2012-10-13 20:49

We have a field CollectionLetterCode in the CustCollectionLetterTrans table. For example we could have three transactions and each of them has a different CollectionLetterCode.

CollectionLetter1

CollectionLetter2

CollectionLetter3

What I would like to display on the report is just "1"  not "CollectionLetter1". So I can not use the field from the table. I want to create a method that will display it.

 

89 Posts
885 Points
Joined: 2011-11-22
Last Online:
2013-1-19 7:06
Location: india ,delhi
K.manish replied on 2012-10-14 18:41

Hi Paul,

you can create a display method like this

display str yourmethod()

{

str yourStr;

yourStr = surSrt( CollectionLetter1,  (strlen(CollectionLetter1) -1),  1);  // will get only "1" from here

return yourStr;

 

thanks

Manish

 

 

 

 

54 Posts
930 Points
Joined: 2012-5-18
Last Online:
2013-5-23 10:33
Location: INDIA
Solution (Not Verified) SAADULLAH replied on 2012-10-15 7:33
Suggested by SAADULLAH

Hi Paul,

 

Try this logic

/////////////

display str methodName()

{

    str s, s1;
    int len, i;
   

    s = "CollectionLetter1";
   
    len = strlen(s);
   
    for (i=1; i<=len; i++)
    {
        if (global::isInteger(substr(s,i,1)))
        {
            s1 = s1 + substr(s,i,1);
        }
    }
   
    return s1;

}

//////////////////////////////

Don't Forget to Solution (Verified) Verify Solution Cool

Regards

SAADULLAH

www.msdynamicsax.weebly.com

 

Page 1 of 1 (5 items) | Get this RSS feed | Bookmark and Share