Jump to content

Exporting Text with Bold Style


Phil Maker
 Share

This topic is 5590 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Greetings-

I'm new to the forum and would appreciate feedback. I'm trying to export text (ultimately to MS Word) and hold onto the Bold style I've added in FileMaker. I've tried every character set in the "Specify Field Order for Export" dialog window and every file type for export (I think), but all I get is plain text.

Link to comment
Share on other sites

  • 1 month later...

I can give you some hints.

FM -> XML DSO Export -> XSLT -> RTF

(Yes I know DSO is depreciated, but I haven't had time to go back and change)

Basically you set up your FM DB to export to XML via and XSLT stylesheet that transforms the data into Microsoft's rich text format.

Below is a piece of my XSLT that does this for me - I push a button and get an RTF formatted document. It's just a snippet from my XSLT file. Things get a little more complicated if you're including relational data. You can also setup FM with some of the RTF code and get nicely formatted tables.

<?xml version="1.0" encoding="UTF-8"?>



	ENTITY tab ""

	ENTITY pr "par "

	ENTITY bold "b "

	ENTITY ul "ul "

	ENTITY it "i "

	ENTITY op "{"

	ENTITY cl "}"

]>



	

	

	

		{rtf1mac{fonttbl{f0froman Times New Roman;}{f1fswiss Arial;}}{colortbl ;red255green255blue255;red153green102blue51;red255green255blue204;}titlepg

		{headerqr{field{*{

		BMC4I IPT

		}}{fldrslt }}{par}}

		&op;

		[H2]Tests&cl;&pr;

        

			&op;[H3]

			&cl;&pr;

			&op;

			[H4]Objectives

			&cl;&pr;

			&pr;

			&op;

			[H5]Critical/Non-Critical Task

            &cl;&pr;

			&pr;

        

		{footer qr 

		 - page {field{*fldinst { PAGE }}{fldrslt }}{par }}}

		}

	



Edited by Guest
Link to comment
Share on other sites

Brudderman, just going to let you know that my "sample" is delayed a bit. Had to unexpectedly work most of the weekend. I'm about 70% of the way there. I thought it would be easy to cut my database down to a simple example. I didn't realize it had grown to over 66 layouts, 34 tables, and hundreds of fields. Cutting it down to the essentials (and removing the proprietary data) was a bigger job than I expected. It would have been easier to start from scratch, however I am most of the way there now.

Link to comment
Share on other sites

So I got done sooner than expected. Note this DB may have some left over funtionality of the larger database it was extracted from, so everything may not work. However, the basics work do as does the RTF export. Selecting the RTF button will automatically dump to an test.rtf file in the same directory as the database. For this to work, the rtf_extend2.xslt file has to also be in the same directory as the database. The database is completely unprotected so you should be able to see how I did part of the RTF formatting in the DB and part in the xslt file. I did part in the DB for easier adjustment on table parameters, plus I never could figure out more than one related field on the same line (in xslt) without combining them in FM. I know it can be done, but never could find a good example and ran out of time.

The RTF Pocket Guide from O'Reilly was very helpful in developing this format along with the RTF Spec from Microsoft.

Note that except for the tables, the output file doesn't have a lot of formatting. Most of the [H#] indicaters are where I would take the file into Word and do a replace all with the appropriate Heading level style - takes about 2 minutes with an 800 page document. Complex style formatting in RTF is flakey and I prefer the search and replace method in word using keys.

Sample.zip

Link to comment
Share on other sites

This topic is 5590 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.