0

I have a excel report like below screen:

One cell has two lines with 2 stars

I would like to show this in the same manner in the report. When I inserted data in the database, it shows line this:

Data in the table

The requirement is, I need to enter the data from excel to database table. Then show this in SSRS report same way as in excel( 1st screenshot). I'm using SQL Server 2017, does SQL Server 2017 has some feature to insert as is data as excel? How can I achieve this?

Zoe
  • 27,060
  • 21
  • 118
  • 148
AskMe
  • 2,495
  • 8
  • 49
  • 102
  • SSMS does not display line breaks in Grid View. They will still exist in the data, if inserted, but won't be displayed. SSMS is a management tool; the display format of data is meaningless in it. The way the data should be displayed is up to your application. The image you've shown up has nothing to do with SSRS here; so what is it you're asking exactly? If the display of your data is incorrect in SSRS, you should be showing us that, along with your rdl and/or report designer. – Thom A May 11 '19 at 13:45
  • Also, why have you tagged SSRS 2008 and 2017? Those are very different versions. Please only tag the version you are using. – Thom A May 11 '19 at 13:50
  • Considering SQL 2017 modern DB I was thinking it might have some feature like this. SSRS 2008 is taged thinking someone might have achieve this using 2008. So if this is the case, Any clue, how I can achieve this in the report? – AskMe May 11 '19 at 13:51
  • Achieve what? A line break? Is it in your data? If so, then it'll appear, if it isn't, it won't. If you need one, then make sure your data has a line break (and carriage return) as part of the value. – Thom A May 11 '19 at 13:53
  • Tagging multiple versions of something makes questions harder to answer, not easier. If we don't my know what version you're using, then we don't know what functionality you do (or don't) have access to. Only tag the version you're using. If you're using SQL Server 2017, they youll have SSRS 3017, so tagging SSRS 2008 only confused matters; especially as there's been a few changes in the 9 years between them. – Thom A May 11 '19 at 13:56
  • Removed tag. In excel in the cell, the new line is entered by ALT+Enter. And, this excel given like this. – AskMe May 11 '19 at 13:57
  • A literal string , in SQL Server, containing a line break will be inserted with a line break. You don't need to use key conbinations; as return (in excel) moves you to the next cell down, rather than inserting a new line within the cell's value. – Thom A May 11 '19 at 14:00
  • As you can see in this [db<>Fiddle](https://dbfiddle.uk/?rdbms=sqlserver_2017&fiddle=93415538d6302a4c8030bd5466f82105), as the string has a line break, the line break is stored (and db<>Fiddle is set up to display them, unlike the Grid View in SSMS). – Thom A May 11 '19 at 14:18
  • Thanks. Got what you are trying to say. However, is there any ways to read the excel cell via SSIS and insert line break so that it can be entered into DB tables (as per your clue)? OR if I can directly put a line break in SSRS using any expression? Note: the excel is provided to me and don't have control in this data. – AskMe May 11 '19 at 14:52
  • If the excel cell contains a line break and you import it, it (the line break) will be inserted in the data flow in SSIS; unless you explicitly remove them. – Thom A May 11 '19 at 14:56
  • How excel cell can contain line break? As per my knowledge, ALT+Enter in excel gives line break. I did ALT+Enter, do I need to load that from SSIS? Then it will work. IS there any other ways to do this in excel cell? So that, SSIS can read these line break and insert the text from single cell as is (including the line break). Anyways, I'll try this out. please let me know if you have any specific link. Thanks again. – AskMe May 11 '19 at 15:06
  • What do you mean how? You just explained how. – Thom A May 11 '19 at 15:08
  • This is starting to very much sound like you're asking how your code (package) will behave without actually running it. If you run the package, you'll find out how it will behave; there's no need to ask us as we can't see your package; you are the best person to answer your own question. – Thom A May 11 '19 at 15:10

0 Answers0