Convert a print to Rtf or doc

User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Convert a print to Rtf or doc

Post by MarcoBoschi »

Hi to all
I have a print

PRINT oPrn NAME "My Print" PREVIEW

PAGE
WHILE !EOF()
some instruction like
Prn:Say( nRow, nCol , bla bla )

ENDPAGE
PAGE
ENDDO
ENDPAGE
ENDPRINT

I need some hints about the possibility to save the print into rtf for or doc You know for instance when you have a report in Access you see preview you can export in RTF. Simple but functional. Many thanks to all!
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Convert a print to Rtf or doc

Post by karinha »

richedit ?? no sirve?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Convert a print to Rtf or doc

Post by nageswaragunupudi »

I need some hints about the possibility to save the print into rtf for or doc
You can save to MSWord doc.
In the preview click "W" button or Click SaveAs and then choose "Doc format". You will see the document in MSWord,
Then you many save as docx,doc or rtf from the Word application.

If you want to save as docx without seeing PREVIEW

Code: Select all | Expand

PRINT oPrn [PREVIEW] FILE "name.docx"
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Doing so, you get a Word document with images. Marco needs a Word document with text that can be selected.
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Convert a print to Rtf or doc

Post by MarcoBoschi »

EMG,
that's right I need an editable document, Thank you to have specified the question.
Thinking that the program creates an Rtf in a easy way maybe it's simple also for us (for you :lol: )
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Hello Marco,

This is how we do it:
https://forums.fivetechsupport.com/view ... f80#p69231

A DOCX file is essentially a ZIP file, and inside it, there's an XML file which is, in practice, a pure text file.

Best regards,
Otto


*************
But if you need a modern reporting tool, then you should use HTML. Everything else currently has no future.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Otto wrote:Hello Marco,

This is how we do it:
https://forums.fivetechsupport.com/view ... f80#p69231

A DOCX file is essentially a ZIP file, and inside it, there's an XML file which is, in practice, a pure text file.
The problem is not just to produce a docx file but to save a print preview as editable Word file.
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Hi Enrico,

Have you read the link? As far as I remember, I explained everything there. The XML file inside the DOCX is for that.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

DOCX-Format
The DOCX format is an XML-based file format for Word documents, used by Microsoft Word, especially since Word 2007. It replaces the older binary DOC format. DOCX files are actually ZIP archives containing multiple files and folders that collectively represent the entire document.

One key file within a DOCX archive is word/document.xml. This XML file contains the actual text of the document, along with information about its structure and formatting. The content of word/document.xml is written in a special markup language called WordprocessingML, designed for representing Word documents.

In word/document.xml, you will find:

Text Content: The actual text of the document, including paragraphs, headings, etc.

Formatting: Information about fonts, colors, alignment, paragraph formats, list formats, etc.

Structure: Tags defining the document's structure, such as section headings, footnotes, endnotes, margin notes, etc.

Elements like Tables and Images: References to other files in the DOCX archive that contain images, tables, and other non-text elements.

Special Tags: These are used to represent special features like tables of contents, hyperlinks, embedded objects, etc.

To view the contents of word/document.xml, you can open a DOCX file with an archiving program like WinRAR or 7-Zip, and then view the word/document.xml file with a text editor or an XML viewer. Knowledge of XML is helpful to understand the content and structure of this file.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Convert a print to Rtf or doc

Post by Otto »

Enrico, Please describe again exactly what you want to do. I'm sure it can be solved.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Convert a print to Rtf or doc

Post by Enrico Maria Giordano »

Ok. You have a normal FWH print preview. You can save the preview to Word but the result is not editable (it is a series of images). How to get an editable Word result instead?
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Convert a print to Rtf or doc

Post by MarcoBoschi »

Otto,
what can I do with the xml inside the word file?
In Access (microsoft) when yo have a preview of a report you can export as rtf
it's very very beautiful
Marco Boschi
info@marcoboschi.it
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Convert a print to Rtf or doc

Post by Silvio.Falconi »

Otto wrote:Enrico,
But I can only recommend switching to HTML right away.
Man beweist nie, dass man Unrecht hat, man wird um ein Word docgebeten und man möchte HTML kürzen. Es ist, als würde man einen Tesla kaufen und ihnen eine Kutsche liefern :D
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply