Home > Net >  Asp.net read data from the database export excel how to realize the carriage returns?
Asp.net read data from the database export excel how to realize the carriage returns?

Time:11-13

Data in the database for:
674: new form constructing basic-level party branch party construction work; & lt; Br& gt; 25: inspire dedication; & lt; Br& gt; 61: keep up with the new era of development; & lt; Br& gt;
When asp.net export excel, to achieve carriage returns, I tried a number of ways, not
's4=Replace (s4, & amp; "" lt; Br& Gt;" , "& amp; # 13;" )
's4=Replace (s4, & amp; "" lt; Br& Gt;" , "& lt; Br style='the oledata.mso - data - placement: same - cell; '/& gt;
")XlApp. Cells (I + 4, 4)=Server HtmlDecode (s4)
Consult ace!

CodePudding user response:

NPOI derived words can create a new CellStyle
Set the WrapText to true
And then to place in line a newline

CodePudding user response:

Thank you very much! Is there any other way?

CodePudding user response:

Content to replace & lt; br/> As \ n to wrap, and at the same time to set up the cell automatic line feed

CodePudding user response:

& lt; Br& Gt replaced with \ n

CodePudding user response:

Using third-party components convenient many, NPOI or Aspose. Cell
  • Related