Forum Discussion

SC07's avatar
SC07
Regular Visitor
1 year ago
Solved

Paginated Report Time Column Error

I have built a paginated report and all good. However when I export the data to excel the start_time column formats to ### and if I remove the - it changes to 23:58.51 which is not correct as s...
  • SolomonovAnton's avatar
    1 year ago

    The issue you're encountering with `start_time` exporting as ######### in Excel and showing values like 23:58:51 is likely due to a mismatch between the underlying data type and formatting in your Paginated Report and how Excel interprets negative or improperly parsed time values.

    πŸ›  Root Cause

    • In Excel, time values are stored as fractions of a day since 12:00 AM. A negative value like -0.999201388888889 isn't a valid time and renders as ######## or shows an incorrect time like 23:58:51 if forced.
    • This suggests that start_time in your dataset may contain negative durations or is being misinterpreted as a numeric value instead of a time value.

    βœ… Solution

    To ensure proper export of time values from your Paginated Report to Excel:

    1. Ensure the source value is a valid DateTime or TimeSpan (not a calculated numeric value).
    2. In your Paginated Report (Report Builder or Visual Studio RDLC Designer):
      • Select the start_time text box.
      • Right-click β†’ Text Box Properties β†’ Number β†’ Time β†’ Set to hh:mm:ss tt.
      • In the expression, confirm you're using something like:
        =Format(Fields!start_time.Value, "HH:mm:ss")
        Or, if it's a string:
        =TimeValue(Fields!start_time.Value)
    3. Check your dataset to ensure it returns the time in a proper SQL datetime or time format (not a float or numeric).
    4. Ensure your dataset field is not returning negative values or incorrect data types. Example for SQL Server:
      SELECT CAST(start_time AS TIME) AS start_time FROM your_table

    πŸ§ͺ Test

    Try previewing your report and exporting it to Excel after applying the above changes. Check if the time displays correctly.

    πŸ“Ž Related Resources

    βœ”οΈ If my message helped solve your issue, please mark it as Resolved!

    πŸ‘ If it was helpful, consider giving it a Kudos!