Zeb dee

Zeb dee

  • NA
  • 21
  • 755

To Provide index as AA,AB,AC......So on for the list of records in PDF

Mar 18 2021 11:06 AM
Hi, I have to provide index as AA, AB, AC,.... etc to pdf list of rows/records using PDFPtable, but there are splits after some rows, i have code like below
  1. String index = "";   
  2. PdfPTable table = new PdfPTable(columnWidth.Count()) { TotalWidth = TABLE_WIDTH, LockedWidth = true };  
  3. index = GetIndex(table.Size);  
  4. public static string GetIndex(int value)  
  5. {  
  6. StringBuilder sb = new StringBuilder();  
  7. do  
  8. {  
  9. value--;  
  10. int remainder = 0;  
  11. value = Math.DivRem(value, 26, out remainder);  
  12. sb.Insert(0, Convert.ToChar('A' + remainder));  
  13. while (value > 0);  
  14. return sb.ToString();  
  15. }  
this code display records from A,B,C,D.. Z and After Z AA,AB,AC ....so on and whenever split occurs i.e if split table occurs after 5 rows it again start from A,b,c... So this is not working.
 
Note: 
My requirement is to display AA,AB,AC..... so on for total rows start to end in PDF if split occurs also. Can any one please help me on this, Thanks in advance, Zeb.

Attachment: Index_SplitRows.zip

Answers (5)