Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Nov 09, 2022 4:32 pm

Buenos dias,
tengo un documento en WORD el cual contiene una tabla de excel con un formato ya prediseñado (Ancho de columna, fondo de celda, formato fuente, etc). A esta tabla le envió información de un JSON para luego poder ver el documento con esta información. Inicialmente utilizo
for (int f = 0; f < dataCuenta.Length; f++)
{
Table copied_Table = tableCuenta.Clone();
TableRow lastRow = copied_Table.LastRow;
for (int i = 0; i < lastRow.Cells.Count; i++)
{
lastRow.Cells[i].Paragraphs[0].Text = string.Empty;
}
tableCuenta.Rows.Insert(tableCuenta.Rows.Count, lastRow);
}
Funciona bien, pero se presenta problemas cuando en el datacuenta se envían mas de 300 registros el error System.OutOfMemoryExeption, revisando el problema se da por el CLONE().
Probe con ROW.ADD() y TABLE.ADDROW(TRUE) inserta un nuevo registro pero sin formato.
por favor si me pueden ayudar indicando una forma de como adicionar filas nuevas a una tabla existente manteniendo el formato original del diseño.
GRacias

piquitin
 
Posts: 1
Joined: Tue Sep 27, 2022 1:00 pm

Thu Nov 10, 2022 9:53 am

Hello,

Thanks for your inquiry.
Now the latest version of Spire.Doc is V10.11.0, if you don’t use the latest version, please update to it and have a test again, if the issue still exists, to help us reproduce your issue and work out solution for you, please offer the following message. Your full test code that can reproduce your issue.

1) Your all input file, you can attach here or send it to us via email ([email protected]).
2) Application type, such as Console App, .NET Framework 4.8.
3) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
In addition, we don't have any Spanish speaking colleagues, so it would be great if you could communicate with us in English to us better understand your requirement. Thanks for your assistance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc

cron