I am dumping information from a SQL Server table into an Excel file.
One of the fields that I overturn is a field of observations that may contain line changes.
If I dump the information without more the result is the following:
oRng = oSheet_Electronicos.Range(String.Format("{0}{1}", columna(nColumnaIniciobloque), nFila), String.Format("{0}{1}", columna(nColumnaFinbloque), nFila))
dataStr = New String(0, 1) {} ''2 Valores
dataStr(0, 0) = _fila("Documento")
dataStr(0, 1) = _fila("Observaciones")
oRng.WrapText = False
oRng.Value2 = dataStr
oRng.NumberFormat = "@"
oRng.NumberFormatLocal = "@"
oRng.EntireColumn.AutoFit()
The line change is done after the first "." so the idea is that on the first line write "THIS IS THE FIRST LINE." and in the second write "THIS IS THE SECOND LINE.".
This only happens after assigning the value to the cell by doing:
oRng = oSheet_Electronicos.Range(String.Format("{0}{1}", columna(nColumnaIniciobloque), nFila), String.Format("{0}{1}", columna(nColumnaFinbloque), nFila))
oRng.WrapText = False
oRng.EntireColumn.AutoFit()
oRng.WrapText = True
oRng.EntireColumn.AutoFit()
I find it strange to have to do this to the cell so that he finds out about the change.
Any ideas?