Need Help Resolving Compatibility Issue with Microsoft Word Versions
Hi Team,
The report generated through .NET code, including a table with radio buttons, is not functioning properly in Microsoft Word version 2308 (Build 16731.20234), while the same code works without issues in version 2302 (Build 16130.20714). I need assistance in resolving this matter.
Thanks, in advance!
Regards,
Prajwal
Word
.NET
Windows 10 Compatibility
-
Jiale Xue - MSFT 35,556 Reputation points • Microsoft Vendor
2023-10-30T02:11:56.9366667+00:00 Hi @Prajwal Zalaki , Welcome to Microsoft Q&A.
What code do you use to generate the report? What version of introp are you using? Will this problem also occur with newer versions of introp?
-
Prajwal Zalaki 5 Reputation points
2023-10-30T04:54:31.9466667+00:00 Hi @Jiale Xue - MSFT ,
We are using the below code to generate the report.
private void CreateDocForPrint(Reference reference, long customLanguageId) { // Get rating schema for the template associated with the current reference List<CoreXlatTable> ratingSchema = new List<CoreXlatTable>(); ratingSchema = RatingManager.GetRatingsByTemplateVersionId(reference.TemplateVersion.TemplateVersionId); // Get category for the template associated with the current reference List<HP.HR.Cap.ERG.Business.Entities.Category> categoryList = new List<HP.HR.Cap.ERG.Business.Entities.Category>(); categoryList = CategoryManager.GetCategoriesForWord(reference.ReferenceId, customLanguageId, reference.Employee.Sex, false); int id = 1; // Create the word output using the response object Response.Clear(); Response.AddHeader("Content-Disposition", "Attachment;Filename=" + reference.Employee.Name.Replace(",", "_") + ".doc"); Response.Buffer = true; Response.Charset = "UTF-8"; Response.ContentType = "application/vnd.word"; Response.Write("<html>"); Response.Write("<head>"); Response.Write("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">"); Response.Write("<meta name=ProgId content=Word.Document>"); Response.Write("</head>"); Response.Write("<body>"); //Write all the Employee details Response.Write(" <div style=\"font-family:verdana,'Times New Roman',Arial;font-size:10pt;\">"); Response.Write(" <div><b>Type of Reference: </b>" + reference.ReferenceType + "</div>"); Response.Write(" <div> </div>"); Response.Write(" <div><b>Employee: </b>" + reference.Employee.EmployeeType.ToString() + "</div>"); Response.Write(" <div> </div>"); Response.Write(" <div><b>Personal details</b></div>"); Response.Write(" <div>Name: " + reference.Employee.Name + "</div>"); Response.Write(" <div>EmplID: " + reference.Employee.ERGEmplid + "</div>"); if (reference.Employee.DateOfBirth == null) { Response.Write(" <div>Date of Birth: " + "unknown" + "</div>"); } else { Response.Write(" <div>Date of Birth: " + String.Format("{0:dd-MMM-yyyy}", reference.Employee.DateOfBirth) + "</div>"); } Response.Write(" <div>Birth Place: " + reference.Employee.BirthPlace + "</div>"); Response.Write(" <div>Birth Country: " + reference.Employee.BirthCountry + "</div>"); Response.Write(" <div>Phone Number: " + reference.Employee.Phone + "</div>"); Response.Write(" <div>Personal Email Address: " + reference.Employee.ERGEmail + "</div>"); Response.Write(" <div> </div>"); Response.Write(" <div><b>Job details</b></div>"); Response.Write(" <div>Hire/Rehire Date: " + String.Format("{0:dd-MMM-yyyy}", reference.Employee.ERGHiredate) + "</div>"); string terminationDate = string.IsNullOrEmpty(reference.TerminateDate.ToString()) ? string.Empty : String.Format("{0:dd-MMM-yyyy}", reference.TerminateDate); Response.Write(" <div>Termination Date: " + terminationDate + "</div>"); string actionReason = string.Empty; if (reference.TerminateReason != null) { List<ActionReason> reasonForLeaving = ReferenceManager.GetActiveTerminationReasons(); foreach (ActionReason reasonForLeavingObject in reasonForLeaving) { if (reference.TerminateReason == reasonForLeavingObject.ActionId + "-" + reasonForLeavingObject.ActionReasonId) { actionReason = reasonForLeavingObject.Description; break; } } } Response.Write(" <div>Reason for Leaving: " + actionReason + "</div>"); Response.Write(" <div>Job Title: " + reference.JobTitle + "</div>"); // Added on 30 sep 2014 Response.Write(" <div>Local Job Title: " + reference.LocalJobTitle + "</div>"); //End Response.Write(" <div>Job Level: " + reference.Employee.JobLevel + "</div>"); Response.Write(" <div>Current department: " + reference.CurDept + "</div>"); Response.Write(" <div>Business Sector: " + reference.Employee.BusinessSector + "</div>"); Response.Write(" <div>New department: " + reference.NewDept + "</div>"); Response.Write(" <div>Supervisor: " + reference.ManagerName + "</div>"); Response.Write(" <div>Legal Entity: " + reference.Employee.LegalEntity + "</div>"); if (reference.Employee.IsEmpSupervisor) { Response.Write(" <div>Number of Reports : " + reference.Employee.NumberReports.ToString() + "</div>"); } Response.Write(" <div> </div>"); // Write the rating schema for the template Response.Write(" <div><b>Ratings</b></div>"); Response.Write("<table width = 600 border = 1 style=\"font-family:verdana,'Times New Roman',Arial;font-size:7.5pt;\">"); Response.Write(" <tr>"); Response.Write(" <td td align=left width = 300>" + "Rating" + "</td>"); Response.Write(" <td td align=left >" + "Definition" + "</td>"); Response.Write(" </tr>"); foreach (CoreXlatTable rating in ratingSchema) { Response.Write(" <tr>"); Response.Write(" <td td align=left width = 300>" + rating.ShotDesc + "</td>"); Response.Write(" <td td align=left >" + rating.LongDesc + "</td>"); Response.Write(" </tr>"); } Response.Write("</table>"); Response.Write(" <div> </div>"); //Write the Radio Button categories Response.Write("<table width=600 border=1 style=\"font-family:verdana,'Times New Roman',Arial;font-size:7.5pt;\">"); Response.Write("<tr>"); Response.Write("<td align=left><b>Rating</b></td>"); foreach (CoreXlatTable rating in ratingSchema) { Response.Write("<td align=center><b>" + rating.ShotDesc + "</b></td>"); } Response.Write("</tr>"); foreach (HP.HR.Cap.ERG.Business.Entities.Category category in categoryList) { if (category.CategoryTypes == CategoryTypes.RadioButton) { Response.Write("<tr>"); if (category.Mandatory == Mandatory.Yes) { Response.Write(" <td >" + "*" + category.Name + "</td>"); } else { Response.Write(" <td >" + category.Name + "</td>"); } foreach (CoreXlatTable rating in ratingSchema) { if (category.ResponseValue == rating.FieldValue) { Response.Write("<td align='center'> <input type =radio checked=checked name =" + id + "/> </td>"); } else { Response.Write("<td align='center'> <input type =radio name =" + id + "/> </td>"); } } Response.Write(" </tr>"); id++; } } Response.Write("</table>"); //Write the Text Area categories Response.Write(" <div> </div>"); foreach (HP.HR.Cap.ERG.Business.Entities.Category category in categoryList) { if (category.CategoryTypes == CategoryTypes.TextArea) { if (category.Mandatory == Mandatory.Yes) { Response.Write(" <div>" + "*" + category.Name + ": " + "</div>"); } else { Response.Write(" <div>" + category.Name + ": " + "</div>"); } Response.Write(" <div>" + category.LongDesc + "</div>"); Response.Write(" <div> </div>"); Response.Write(" <div>" + category.ResponseText + "</div>"); Response.Write(" <div> </div>"); } } Response.Write("</body>"); Response.Write("</html>"); Response.End(); }
-
Jiale Xue - MSFT 35,556 Reputation points • Microsoft Vendor
2023-11-08T07:30:48.3966667+00:00 Hi @Prajwal Zalaki ,
Sorry for replying to you so late. I'm not sure how to run your code.
Can you give some reproduction procedures?
Which dll does Reference belong to?
Are you using Asp.Net?
-
Prajwal Zalaki 5 Reputation points
2023-11-08T08:16:29.7166667+00:00 -
Jiale Xue - MSFT 35,556 Reputation points • Microsoft Vendor
2023-11-09T11:16:00.7233333+00:00 Hi @Prajwal Zalaki ,
We consulted the engineer of our asp.net team and your project contains third-party libraries. Not in the scope of our handle. Can you provide a code version that does not include this library so that we can reproduce the problem? In addition, in view of this problem in designing Word, I will help you add the office development tag, and the invole-related team will join.
Sign in to comment