Issue in Tabs added in Telerik RadEditor missing/not rendered in SSRS (SQL Server Reporting Service) report.

1 Answer 22 Views
Editor
Mohamed
Top achievements
Rank 1
Mohamed asked on 01 Apr 2024, 01:08 PM | edited on 01 Apr 2024, 01:09 PM

 

  • In our application we are using the Telerik RadEditor to save the information in the database. And use the same information in the SSRS reports.
  • We are facing the issue while using “Tab” key in the Telerik RadEditor.
  • In the MS-SQL database the tabs are being saved in the following HTML format,       

 <span style="white-space: pre;">     </span>

Screen Shot 1: Below screen shot shows the Telerik RadEditor where, 5 Tabs are being entered after the Amount text. 

  • The Html text saved in database field is as shown below,

     

    <p>Amount<span style="white-space:pre;">     </span>54123</p>  <p>Test Amount<span style="white-space:pre;">    </span>87596</p>

     

  • We are unable to see any tabs (spaces) in the SSRS report as shown below,

    Screen Shot 2:  Missing Tabs in SSRS report as shown below, 

    Screen Shot 3: SSRS report text field accepting HTML.


  • The report field is HTML enabled. And it Interprets Html tags as Styles.

 

Can you please help us to find the solution for the above issue ?

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Apr 2024, 02:19 PM

Hi Mohamed,

The issue you're experiencing with tabs not being displayed in SSRS reports, despite being saved correctly in the database from the Telerik RadEditor, is related to how SSRS interprets HTML content. The RadEditor is designed to work with HTML content, and as such, it uses a combination of HTML tags and CSS to replicate the appearance of tabs. This is why you see <span style="white-space: pre;">     </span> in your database for tab spaces.

However, SSRS's ability to interpret HTML is limited and does not fully support all HTML tags and CSS properties. Specifically, SSRS may not fully support the white-space: pre; CSS property used by RadEditor to preserve whitespace (including tabs). This is why the tabs are not being displayed in your SSRS reports.

Since SSRS may not interpret the white-space: pre; style correctly, a possible solution is to convert tabs into a specific number of spaces before saving the content to the database. This can be done by replacing the tab character with spaces in the RadEditor's content. Here's a simple code snippet:

// Assuming RadEditor1.Content contains the HTML content
// Replace the tab-span with a sequence of non-breaking spaces
string tabReplacement = "&nbsp;&nbsp;&nbsp;&nbsp;"; // Example: 4 non-breaking spaces

// Replace each occurrence of the tab-span with the tabReplacement string
RadEditor1.Content = RadEditor1.Content.Replace("<span style=\"white-space: pre;\">	</span>", tabReplacement);
A similar case is discussed at StackOverflow at https://stackoverflow.com/questions/3048949/can-i-get-a-tab-to-display-in-a-rendered-report.

    Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    Editor
    Asked by
    Mohamed
    Top achievements
    Rank 1
    Answers by
    Rumen
    Telerik team
    Share this question
    or