SSRS issue that if we have a column datatype (38,23) in sql result set then the column bonding is not working in SSRS

Sevalkar, Niraj 6 Reputation points
2022-08-10T13:26:11.977+00:00

Hi Team,

we are working for larger decimal number for currency conversion mostly for crypto and we are ran into issue of overflow for SSRS reports and we came to know that SSRS’s table properties follows .NET decimal type internally. Which means it will support only 29 digits.

Ex: If we have a Quantity column in Sql table which holding (38,23) and tries to map this column into SSRS report then it throws an exception as – “The data extension returned an error during reading the field. System.OverflowException: Conversion overflows.”

Because it tries to map exact column definition defined in dataset (Sql server’s result).

Other option is, we can return varchar instead decimal but then will lose existing mathematical operations available at SSRS side i.e., Sum, Average etc.

Do we have any other workaround for the same.

Thank you in advance!

Regards,
Niraj Sevalkar

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,066 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Aniya 151 Reputation points
    2022-08-19T08:58:16.967+00:00

    Hi @Sevalkar, Niraj
    The tests I did show that decimal(38,23) cannot be achieved. Once it exceeds 29 digits, "Unable to read" will be displayed. I noticed your requirement is to convert larger decimal numbers for cryptocurrencies. The decimal data type has two parameters - precision and csale. precision represents the total number of digits, and csale represents the number of decimal places. If you want to display larger numbers, and the csale requirements are not high, then I suggest that you can reduce the csale.
    Or you can code: Is it possible to remove or exclude trailing zeros when it exceeds 28. You can refer to this link: https://github.com/dotnet/SqlClient/issues/95.
    Best regards,
    Aniya

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.