Tables and Radio Buttons

I have radio buttons inside of a table and when that table is at the bottom of the page the radio buttons get lost if the IsBroken property is set to false for the table.

Hello Stephanne,

Thanks for using our products.

Can you please share the code snippet so that we can test the scenario at our end. We apologize for your inconvenience.

Here’s the code that generates the formfield;

private Aspose.Pdf.FormField CreateRatingRadioButtons(string RatingType, int? Rating, int QuestionId)
{
FormField footerRadioButtons = new FormField();
footerRadioButtons.FieldName = string.Concat("RadioButtons_", RatingType, "_", QuestionId.ToString());
footerRadioButtons.FormFieldType = FormFieldType.RadioButton;
footerRadioButtons.IsReadOnly = true;
footerRadioButtons.RadioButtonCheckedIndex = (Rating.HasValue) ? (int)Rating : -1;
footerRadioButtons.Margin.Bottom = 0;
footerRadioButtons.TextFontSize = 7F;
footerRadioButtons.TextFontName ="Arial";
footerRadioButtons.FormHeight = 8F;
//footerRadioButtons.PositioningType = PositioningType.ParagraphRelative;
//footerRadioButtons.ReferenceParagraphID = string.Concat(RatingType, QuestionId.ToString());
//create the actual radio button
Aspose.Pdf.RadioButton rbNA = footerRadioButtons.RadioButtons.Add();
rbNA.PositioningType =PositioningType.ParagraphRelative;
rbNA.ReferenceParagraphID =string.Concat(“CellNA_”, RatingType, “_”, QuestionId.ToString());
Aspose.Pdf.RadioButton rbOne = footerRadioButtons.RadioButtons.Add();
rbOne.PositioningType =PositioningType.ParagraphRelative;
rbOne.ReferenceParagraphID =string.Concat(“CellOne_”, RatingType, “_”, QuestionId.ToString());
Aspose.Pdf.RadioButton rbTwo = footerRadioButtons.RadioButtons.Add();
rbTwo.PositioningType =PositioningType.ParagraphRelative;
rbTwo.ReferenceParagraphID =string.Concat("CellTwo_", RatingType, "_", QuestionId.ToString());
Aspose.Pdf.RadioButton rbThree = footerRadioButtons.RadioButtons.Add();
rbThree.PositioningType =PositioningType.ParagraphRelative;
rbThree.ReferenceParagraphID =string.Concat("CellThree_", RatingType, "_", QuestionId.ToString());
return footerRadioButtons;
}
And this is the code that calls it;
Aspose.Pdf.Table ratingTable = new Aspose.Pdf.Table();
//ratingTable.IsRowBroken = false;
ratingTable.ColumnWidths =
"200 125 125";
ratingTable.Alignment =
AlignmentType.Left;
//ratingTable.IsFirstRowRepeated = true;
//ratingTable.Margin.Top = 50;
//ratingTable.Margin.Bottom = 20;
HeaderSection.Paragraphs.Add(ratingTable);
//ratingTable.IsRowBroken = false;
//add the row
Row ratingRow = ratingTable.Rows.Add();
ratingRow.DefaultRowCellPadding = marginInfo;
ratingRow.DefaultCellTextInfo.FontName ="Arial";
ratingRow.DefaultCellTextInfo.FontSize = 8F;
ratingRow.Cells.Add(coreCompetency.CoreCompetencyQuestion);
ratingRow.Cells[0].Border =new BorderInfo((int)BorderSide.All, 0.1F, new Aspose.Pdf.Color("#cccccc"));
#region
Add Employee Rating
cellEmployeeRatings = ratingRow.Cells.Add();
cellEmployeeRatings.DefaultCellTextInfo.FontName ="Arial";
cellEmployeeRatings.Border =new BorderInfo((int)BorderSide.All, 0.1F, new Aspose.Pdf.Color("#cccccc"));
//create a table to hold the radio buttons
Aspose.Pdf.Table tblRadioButtons = CreateRatingTable(cellEmployeeRatings, "Employee_CoreCompetency", coreCompetency.QuestionId);
//tblRadioButtons.PositioningType = PositioningType.ParagraphRelative;
//tblRadioButtons.ReferenceParagraphID = string.Concat("Employee_CoreCompetency", coreCompetency.QuestionId.ToString());
//tblRadioButtons.Rows[0].Cells[1].Paragraphs[0].ID = string.Concat(“Employee_CoreCompetency”, coreCompetency.QuestionId.ToString());
FormField radioButtons = CreateRatingRadioButtons(“Employee_CoreCompetency”, coreCompetency.EmployeeRating, coreCompetency.QuestionId);
cellEmployeeRatings.Paragraphs.Add(radioButtons);//add the employee comments if they exist
if (!String.IsNullOrEmpty(coreCompetency.EmployeeSupportingComments))
{
Text txtEmployeeCommentTitle = new Text("Employee Comments:");
txtEmployeeCommentTitle.TextInfo.FontName ="Arial";
txtEmployeeCommentTitle.TextInfo.FontSize = 8F;
txtEmployeeCommentTitle.TextInfo.IsTrueTypeFontBold =true;
cellEmployeeRatings.Paragraphs.Add(txtEmployeeCommentTitle);
Text txtEmployeeComments = new Text(coreCompetency.EmployeeSupportingComments);
//txtEmployeeComments.;
txtEmployeeComments.Margin.Top = 2;
txtEmployeeComments.TextInfo.FontName ="Arial";
txtEmployeeComments.TextInfo.FontSize = 8F;
cellEmployeeRatings.Paragraphs.Add(txtEmployeeComments);
}
#endregion
#region
Add Manager Ratings
cellManagerRatings = ratingRow.Cells.Add();
cellManagerRatings.DefaultCellTextInfo.FontName ="Arial";
cellManagerRatings.Border =new BorderInfo((int)BorderSide.All, 0.1F, new Aspose.Pdf.Color("#cccccc"));
//create a table to hold the radio buttons
Aspose.Pdf.Table tblManagerRadioButtons = CreateRatingTable(cellManagerRatings, "Manager_CoreCompetency", coreCompetency.QuestionId);
FormField radioManagerButtons = CreateRatingRadioButtons("Manager_CoreCompetency", coreCompetency.ManagerRating, coreCompetency.QuestionId);
cellManagerRatings.Paragraphs.Add(radioManagerButtons);
//add the employee comments if they exist
if (!String.IsNullOrEmpty(coreCompetency.ManagerSupportingComments))
{
Text txtManagerCommentTitle = new Text("Manager Comments:");
txtManagerCommentTitle.TextInfo.FontName ="Arial";
txtManagerCommentTitle.TextInfo.FontSize = 8F;
txtManagerCommentTitle.TextInfo.IsTrueTypeFontBold =true;
cellManagerRatings.Paragraphs.Add(txtManagerCommentTitle);
Text txtManagerComments = new Text(coreCompetency.ManagerSupportingComments);
//txtEmployeeComments.;
txtManagerComments.Margin.Top = 2;
txtManagerComments.TextInfo.FontName ="Arial";
txtManagerComments.TextInfo.FontSize = 8F;
cellManagerRatings.Paragraphs.Add(txtManagerComments);
}

#endregion

Hello Stephanne,

Thanks for sharing the code snippet. We are working over this query and will get back to you shortly. We apologize for your inconvenience.

Hello Stephanne,

I have tested the scenario and I am able to reproduce the problem that RadioButton is missing when table reaches the end of page and also the table cells on subsequent pages does not contain RadioButtons. For the sake of correction, I have logged it in our issue tracking system as PDFNET-28047. We will investigate this issue in details and will keep you updated on the status of a correction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.

Any progress getting this resolved?

Hello Stephanne,

Thanks for your patience.

Our development team is working hard to get this issues fixed ASAP but I am afraid it's not yet completely resolved. Meanwhile I have requested the development team to share the ETA regarding its resolution. As soon as the information becomes available, we would be more than happy to share this information with you. Please be patient and spare us little time. We apologize for your inconvenience.