Problem with StiText component when TextFormat set to Number (16 digits)

Stimulsoft Reports.NET discussion
Post Reply
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Houssam Hamdan »

Hello,

The StiText exists inside a databand and bound to a string data column in a dataset.

The string data column contains credit card numbers which is 16 digits long.

The problem:

When setting the TextFormat of StiText to "Number", the data displayed in the report are not correct only for the said stiText. It is showing the same credit card number for all the datatable rows. After investigation, we discovered that when the string length is above 15 digits and the TextFormat is set to Number, this issue appears.

It is important to mention that the data are displayed correctly when the TextFormat is set to general.

Thank you in advance for your kind cooperation.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Houssam Hamdan »

It is important to mention that this issue appears only when exporting to Excel.

StiReportResponse.ResponseAsXls(this, objReport);

Cheers ,,,
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Alex K. »

Hello,

This problem is not in the designer, Excel displays only 15 digits, the rest are discarded. This problem can be solved only exporting that value to the string format.

Thank you.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Houssam Hamdan »

Hi Aleksey,

Did you mean setting the TextFormat to General instead of Number?

If this is what you are recommending then the designated Excel Cell would have a small green tooltip, at the top-right corner of the Cell, informing us to convert the string value to numeric value. Unfortunately, this behavior is not acceptable by our customer.

Waiting for your highly appreciated opinion.

Thx
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Alex K. »

Hello,

When you type a number that contains more than 15 digits in a worksheet cell, Microsoft Office Excel changes any digits past the fifteenth place to zeros.

Please see the article "Display numbers as credit card numbers" on http://office.microsoft.com/en-us/excel ... 36840.aspx


Thank you.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Houssam Hamdan »

Thank you for your prompt reply.

The best alternative is to split the credit number into

1234 1234 1234 1234 instead of 1234123412341234

So exporting the value as a string as you suggested :)

Best Regards,
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with StiText component when TextFormat set to Number (16 digits)

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
Post Reply