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.
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.
=CByte(Fields!NumberCarsOwned.Value)
Similarly, let me create a new column to convert the TotalChildren values to Byte. The SSRS CByte function expressions to perform the same are shown below.
=CByte(Fields!TotalChildren.Value)
Please click the preview tab to see the report.