SSRS CByte Function

The SSRS CByte function is a Conversion function that will convert the given field or expression to a Byte. The syntax of the CByte function for converting to Byte type is as shown below.

=CByte(Fields!CarsOwned.Value)

To demonstrate the CByte function in reporting services, we use the Employee table below, which has 20 records. The image shows the records in the Table report.

Source Table

SSRS CByte function Example

For this, let me add a new column to the right side of the NumberCarsOwned column. Next, right-click the textbox under the CByte and choose Expression to open the expression window shown below. The CByte expression below will convert the small int column values of the Number of Cars Owned column to Byte.

  1. SSRS Conversion Functions
  2. SSRS
  3. Table Report in SSRS
  4. SSRS Charts
=CByte(Fields!NumberCarsOwned.Value)
SSRS CByte Function expression to convert to Byte

Similarly, let me create a new column to convert the TotalChildren values to Byte. The CByte function expressions to perform the same are shown below.

=CByte(Fields!TotalChildren.Value)

Please click the preview tab to see the report.

TIP: Please refer to the SSRS CChar and SSRS CDate functions from the list of available ones.

CByte Function to convert expression to Byte report preview