Exporting a DataTable from WinForms to a docx file takes a lot of time
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Reproduce the report using the shown DocX.Create, InsertSection, AddTable, and InsertTableAfterSelf flow, comparing behavior between versions 2.3.0 and 2.4.0. Inspect why table-cell paragraphs remain empty and why section header/footer warnings appear during export. Done means table contents are populated and the export time is no longer unexpectedly slow.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi.
I've just updated from 2.3.0 to 2.4.0, because I just want to use the new parameter from Section page numeration. But now the exporting process takes a lot of time, and I don't know why, because I'm using the same code as I used on the previous version. What happened with the new version?
Edit: More than that, my all table is empty. Seems none of the paragraphs inside the table object are filled. But is the same code as in 2.3.0, what has been changed?
OK. I've started debugging this thing and I found the following:
After each line of code which is using some appending operation, or anything that involve an object on the file, I get the following lines of information in debugger:
This document contains more than 1 section. Consider using Sections[wantedSection].Headers.
This document contains more than 1 section. Consider using Sections[wantedSection].Headers.
This document contains more than 1 section. Consider using Sections[wantedSection].Headers.
This document contains more than 1 section. Consider using Sections[wantedSection].Footers.
This document contains more than 1 section. Consider using Sections[wantedSection].Footers.
This document contains more than 1 section. Consider using Sections[wantedSection].Footers.
My code is the following, what I'm doing wrong?
DocX doc = DocX.Create(filePath, DocumentTypes.Document);
while (doc.Sections.Count < numeGrup.Count)
{
// I need to insert sections for each group in "numeGrup" list
doc.InsertSection();
}
var sec = doc.Sections[0];
for (int k = 0; k < numeGrup.Count; k++)
{
sec = doc.Sections[k];
sec.PageLayout.Orientation = Orientation.Landscape;
sec.PageNumberType.PageNumberStart = 1;
sec.PageWidth = 800;
sec.MarginLeft = 20;
sec.MarginRight = 20;
sec.MarginTop = 20;
sec.MarginBottom = 20;
sec.InsertParagraph(numeGrup[k].Key.Nume).SpacingBefore(20d).Font("Arial").FontSize(10).Bold().SpacingAfter(10d);
var table = doc.AddTable(detaliiPeFirma.Count() + 1 + groups.Count, 9);
table.SetTableCellMargin(TableCellMarginType.left, 1);
table.SetTableCellMargin(TableCellMarginType.right, 1);
table.SetTableCellMargin(TableCellMarginType.top, 1);
table.SetTableCellMargin(TableCellMarginType.bottom, 1);
var p = sec.InsertParagraph();
p.InsertTableAfterSelf(table);
table.Design = TableDesign.LightGrid;
var headerRow = table.Rows.First();
headerRow.TableHeader = true;
headerRow.Cells[0].Paragraphs[0].Append("Field1").Bold().FontSize(10);
headerRow.Cells[1].Paragraphs[0].Append("Field2").Bold().FontSize(10);
headerRow.Cells[2].Paragraphs[0].Append("Field3").Bold().FontSize(10);
headerRow.Cells[3].Paragraphs[0].Append("Field4").Bold().FontSize(10);
headerRow.Cells[4].Paragraphs[0].Append("Field5").Bold().FontSize(10);
headerRow.Cells[5].Paragraphs[0].Append("Field6").Bold().FontSize(10);
headerRow.Cells[6].Paragraphs[0].Append("Field7").Bold().FontSize(10);
headerRow.Cells[7].Paragraphs[0].Append("Field8").Bold().FontSize(10);
headerRow.Cells[8].Paragraphs[0].Append("Field9").Bold().FontSize(10);
}
I put only a part of my code, the generation of tables and filling of headers of the tables. But no paragraph inside table's cells are filled. And it's working very slow now! Maybe because of those messages in the debugger?
- Lenguaje dominante
- C#
- Estrellas
- 1.9k
- Forks
- 482
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de xceedsoftware/DocX
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
xceedsoftware/DocX#489 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
xceedsoftware/DocX#488 · 1 comentario · 1 reacción ·
-
keep formatAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
xceedsoftware/DocX#487 · 3 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
xceedsoftware/DocX#485 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
xceedsoftware/DocX#482 · 4 comentarios ·
Todos los issues de xceedsoftware/DocX
Issues similares
-
bug front-end social
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
gameguild-gg/gameguild#1237 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/microsoft-ui-xaml#12515 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
[v5-preview5] `func new` displays incorrect command in error message when project is not initializedAbiertoNeeds: Triage (Functions) v5 v5-preview5
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Azure/azure-functions-core-tools#5838 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
customer-reported needs-team-triage question server-Azure.Mcp tools-Pricing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/mcp#4087 · 1 comentario ·
Los mantenedores suelen responder en 1 día