I want to save PDF file that generated in the path that user want for example Desktop or whatever , i have 2 button in the same page, the first is to generate report and the second to save the report as pdf , could any one help me how to do that like this box
PdfPTable tablee = new PdfPTable(3);
tablee.AddCell("ID");
tablee.AddCell("AGE");
tablee.AddCell("NAME");
lenthee = db.persions.ToArray().Length;
persion[] array = new persion[lenthee];
array = db.persions.ToArray();
for (int i = 0; i < lenthee; i++)
{
tablee.AddCell(array[i].ID.ToString());
tablee.AddCell(array[i].age.ToString());
tablee.AddCell(array[i].name.ToString());
}
Document doc = new Document(PageSize.A4, 1, 1, 1, 1);
// here i want to ask the user where to he want to save the file (dialog box)then put the path in (path String attribute)
String path = "C:\\Users\\se\\Desktop\\test.pdf";
PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream(path, FileMode.Create));
doc.Open();
Paragraph s = new Paragraph("report");
doc.Add(s);
doc.Add(tablee);
doc.Close();