It looks like something changed in the "export to excel, word, xml, etc" feature between PHPR 5.2 and 5.3 versions.
Back in 5.2 I had made custom changes (directly in the php output files) to some forms that used the export feature to allow my exports to retain the rich text formatting, while also introducing page breaks for dynamic form letters. Now, in 5.3 I noticed that the same export to word results in my form letters displaying withing a table inside word. Worst, it also displays the HTML tags and completely ignores page breaks for my letters.
I had to customize the output php files once again (files that are created every time you build) to achieve the same results I had back in PHPR 5.2. This time around, I decided to document my changes here to help anyone else looking for this feature.
As a little background info, I created a form that has a "text area" type field where I also applied the "Use Rich Text Editor" option in Visual Editor (using the Basic Rich Text editor option). I also made sure to select that field's "View As" setting as HTML type (this is important to maintain proper formatting when viewing and exporting to Word).
This form allows the user to write letters, format text, etc. Additionally, it allows them to input dynamic fields by placing # tags before and after certain keywords that I check using the "After record added" event in that form. I basically have a update query that replaces the keywords (it uses the # tags to identify those words) in my table, thereby generating individualized form letters to users.
I won't get into the details of how to do that here. The purpose of this post is to simply tweak the export file so you have formatted text and page breaks without a table in word.
1st. Find the output export file generated by PHPR in your root folder of your web app (it's always appended with the word "export").
2nd. Open the file in your favorite text editor (mine is Notepad++) and find the function ExportToWord() and comment out the line where you see:
//Comment out the lines below
echo "<table border=1>";
echo "</table>";
3rd. Find and comment out the line:
//Comment out the line below
echo htmlspecialchars($values["your_letter_body_fieldname"]);
4th. Add 2 new lines directly after commenting out line in previous step:
//Add these two new lines
echo htmlspecialchars_decode($values["your_letter_body_fieldname"]);
echo '<br style=\'page-break-before: always\'></br>';
That's it. You are done.
Now the export to Word will be smart enough to keep your formatting without displaying HTML tags in Word. It will also add page breaks after outputting your field(s), as well as eliminate the annoying table structure that the exported text is placed into.
Cheers,