Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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.

  • 1 month later...
Posted (edited)

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
Posted

I'd sure be interested in seeing a small demo file that includes your whole xslt along with some sample date if you have such. Otherwise, thanks for the snippet!

James

Posted (edited)

I can't use my existing db file as it includes propietary data. I'll see if I can make sometime this weekend to make a simple example.

Edited by Guest
grammar
Posted

I can't use my existing db file as it includes propietary data. I'll see if I can make sometime this weekend to make a simple example.

Thanks, Hap! That would be splendid! I've had mixed results with exporting RTF and could learn a lot from your demo, I'm sure. Looking forward to it.

James

www.james-mc.com

Posted

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.

Posted

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

Posted

Hap, thanks so much for working this up! I'm out of town right now and am not on a computer with FM installed. But I am downloading your sample file to a flash drive to look at tomorrow. I'm interested to see what you have done and appreciate all of the time you've invested in it.

Will be in touch later!

James

www.james-mc.com

Posted

I've had a quick look, Hap, and this is helpful. Once I get home I will study how you assemble the RTF code from the various fields. I really appreciate you efforts on this.

Thanks!!

James

This topic is 6675 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
×
×
  • Create New...

Important Information

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