ItextSharp set field of a table from template pdf using c# - c#

I have PDF template.
In PDF template there is a table with the list of people with the columns name (name_dic) and surname (surname_dic). The field names are the same for all row.
With
stamper.AcroFields.SetField("NAME_DIC", "Lucas");
stamper.AcroFields.SetField("SURNAME_DIC", "Brown");
I write in the first line
How do I write in the second row?
Thank you

I have solution.
first row
Stati_Famiglia[0].#subform[0].details[0].detail[0].NAME_DIC[0]
second row
Stati_Famiglia[0].#subform[0].details[0].detail[1].NAME_DIC[0]

Related

How to not skip empty cell in Excel when creating .csv file

hope you guys can help!
I am trying to create .csv out of Excel which would have columns A - H filled with some data I want to read but data is optional. So some times the first column A can be empty. Now, when I save the .csv, unless I entered one space in the A column, Excel automatically trims A column, and the result is 7 cells to read A - G instead 8 cells A - H (with A column) being "empty". I would like to save client the trouble of needing to enter one space or -> ="" in the Excel formula to make first or last column "empty" but not trimmed in the resulting .csv.
Thank you!
There is no option in Excel to preserve empty columns, when exporting to .csv. But you could introduce a header text in the first row, so you will always have the columns filled atleast with the header text.
Plus it would make your data probably more readable, depending on what data this is.
Another possibility would be to implement a makro and embedd a button in your excel file:
see
how not to skip empty first cell when saving as .CSV?

How to save pdf with TextBoxes in ASP.NET

I want to save my gridview in pdf.
The point is that all the cells, except the header row (columns title) and the first column (rows title), have to be PDF textboxes, so once I open the file I can write text inside.
How can I do it?
I have found that it is possibe to create a pdf with textfields but I have not found a way to make them in a specific part of the sheet.
I have tried to do so: Link 1

How to set "keep with next" property on a table using Novacode DocX?

In Word there is a property "keep with next" under Paragraph > Line and Page Breaks. I was wondering if there is a way to set this property to a table created using Novacode DocX
Yes, set the paragraph of at least one cell in every row in the table using KeepWithNext(true). If you are building your tables dynamically, then this is easy to do.
Novacode.Table t = doc.InsertTable(2, 3); // 2 rows; 3 columns
t.Rows[0].Cells[0].Paragraphs[0].Append("A1").KeepWithNext(true);
t.Rows[0].Cells[1].Paragraphs[0].Append("B1");
t.Rows[0].Cells[2].Paragraphs[0].Append("C1");
t.Rows[0].Cells[0].Paragraphs[0].KeepWithNext(true);
t.Rows[1].Cells[0].Paragraphs[0].Append("A2").KeepWithNext(true);
t.Rows[1].Cells[1].Paragraphs[0].Append("B2");
t.Rows[1].Cells[2].Paragraphs[0].Append("C2");

Change value in 2nd row if PDFPTable of iTextSharp in C#

I have generated PDF file using "iTextSharp" API properly.
Now i want to add total quantity in second row, how i can change value in second row after writing last row of table.
Any ideas.
I have created one table with suppose 3 columns.
Then added 3 rows in table.
After third i want to change value in first row, is it possible ?
How can i do this in C# ?
Thanks.

Word Automation: deleteing table column by name

Does anyone know how i can delete a column of a table in word from c#? I basically search a word doc for tables and for each table ive found, i want to delete the entire column with the name "Student ID" from that table. I know you can delete by column index using code like:
wordTable.Columns[0].Delete();
But i need a way to delete the column based on the name of the column since each table in the doc may have the student id column in different indices.
Thanks
Tables don't have names as such - what you probably mean is the column whose top cell has "Student ID" in it. You're going to have to walk the columns and look at the top cell in each (presumably you can at least guarantee that has the lowest cell index) to find if it has the text you're looking for.
wordTable.Columns[n].Cells[0].Range.Text

Categories