Répéter les lignes et colonnes dans Excel via C# When Excel spreadsheets span several pages, the data is easier and quicker to read when we print the column or row titles at the right or top of every page (repeating). These are called Repeating Rows and Columns or Header Rows and Columns in Excel. IronXL can utilize this useful aspect of spreadsheets with just a few lines of code. SetRepeatingRows(startRow, endRow) This method is used to set repeating rows. For example, calling workSheet.SetRepeatingRows(3, 4) will set repeating on rows 4 and 5. SetRepeatingColumns(startColumn, endColumn) This method is used to set repeating columns. For example, calling workSheet.SetRepeatingColumns(0, 2) will set repeating on columns A to C. These two methods use zero-based indexing as parameters, such that column(0) is "A" and row(1) is 2. It's important to note that if these methods are used in combination, each page may have different repeating rules based on their position relative to the first page. The content that spans multiple pages along the right side of the first page will have the repeating column rule applied only. Figure 1 shows this phenomenon: Figure 1 Multiple pages spanning along the bottom side of the first page will contain repeating rows. Lastly, pages that are located on the inner side will have both repeating columns and row rules applied to them. Figure 2 shows the last two phenomena: Figure 2 Learn to Add Rows & Columns in Excel with C# Liens de documentation associés Voir sur Github Tutoriel connexe Guide pratique connexe Documentation de classe Télécharger IronXL DLL Signaler un problème sur cette page Prêt à commencer? Nuget Téléchargements 1,686,155 | Version : 2025.11 vient de sortir Téléchargement gratuit NuGet Total des téléchargements :1,686,155 Voir Licences
Testez dans un environnement en direct Testez en production sans filigranes.Fonctionne où que vous en ayez besoin.
Produit entièrement fonctionnel Profitez de 30 jours de produit entièrement fonctionnel.Configurez-le et faites-le fonctionner en quelques minutes.
Testez dans un environnement en direct Testez en production sans filigranes.Fonctionne où que vous en ayez besoin.
Produit entièrement fonctionnel Profitez de 30 jours de produit entièrement fonctionnel.Configurez-le et faites-le fonctionner en quelques minutes.