Skip to Content
0

How do I convert IP addresses in Decimal to dotted quad?

Apr 07, 2017 at 04:37 PM

308

avatar image

I have an MS-SQL database I will be querying that has IP addresses stored as Integers.

This is great for sorting IP address in the database.

When I report with Crystal, I will need these IP's converted from Decimal to Dotted Quad.

An example of the data is:

Decimal: 3232235778
Dotted Quad: 192.168.1.2

I am wondering if anyone has ever done this using Crystal Reports with this type of data before.

Thank you for any assistance.

-= Bruce D. Meyer

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ido Millet Apr 08, 2017 at 01:36 PM
0

You can implement this as a User Function Library (UFL) function.
I just added 2 functions to my UFL and, as shown below, they take care of Number to Dot conversion as well as the reverse.
.Net provides built in functions to handle this type of logic.


Show 1 Share
10 |10000 characters needed characters left characters exceeded

I didn't see this until long after you posted it. I ended up converting all the IntegerIP's to dotted quad on the source file using Powershell. Your answer however, is instructional. I learned I can apparently expose .Net functionality inside of Crystal via a UFL. Thank you for the teaching.

0
Brian Dong Apr 07, 2017 at 08:34 PM
0

Hi Bruce,

I haven't done it but Google is my friend.

https://drive.google.com/file/d/0B8jeLxypP81_N0FSQXRMdWpZZWs/view

You should be able to translate these formulas from Excel into Crystal.

Good luck,

Brian

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank-You Brian. I did google, but apparently, not as proficient as you!

I didn't see this until long after. I ended up converting on the back end. I can't access google drive from work also. :-) Didn't realize I can use excel formula's in Crystal. That's going to be handy.

-= Bruce

0