Posted by a ceTe Software moderator
Hello Flemming,
Yes, you can add form fields to the PDF report without any problem using our DynamicPDF product. You will need to place an PlaceHolder in the DPLX file and use the LaidOut event of the PlaceHolder to add the page elements dynamically to the PDF report. Please refer the documentation on handling events at:
http://www.DynamicPDF.com/Support/NET_Help_Library_10_03/Handling%20Events.html. Also below is the sample code for it.
//Code to generate PDF report.
DocumentLayout report = new DocumentLayout(@"F:\temporary\DPLX\Version5.1.dplx");
PlaceHolder placeHolderField = (PlaceHolder)report.GetReportElementById("Placeholder1");
placeHolderField.LaidOut += new PlaceHolderLaidOutEventHandler(placeHolderField_LaidOut);
Document document = report.Run();
document.Draw(@"C:\MyDocument.pdf");
//LaidOut event handler to add the form field to the PDF report.
static void placeHolderField_LaidOut(object sender, PlaceHolderLaidOutEventArgs e)
{
TextField textField = new TextField("Text Field Name", 0, 0, e.ContentArea.Width, e.ContentArea.Height);
textField.TextAlign = Align.Center;
textField.BackgroundColor = RgbColor.AliceBlue;
textField.BorderColor = RgbColor.DeepPink;
textField.Font = Font.TimesItalic;
textField.FontSize = 16.0f;
textField.TextColor = RgbColor.Brown;
textField.DefaultValue = "ceTe Software";
textField.MultiLine = true;
textField.ToolTip = "Text";
e.ContentArea.Add(textField);
}
Thanks,
ceTe Software Support Team.