Convert a print to Rtf or doc

Convert a print to Rtf or doc

Postby MarcoBoschi » Wed Nov 29, 2023 12:59 pm

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!
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Convert a print to Rtf or doc

Postby karinha » Wed Nov 29, 2023 4:49 pm

richedit ?? no sirve?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Convert a print to Rtf or doc

Postby nageswaragunupudi » Thu Nov 30, 2023 1:31 am

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 view  RUN
PRINT oPrn [PREVIEW] FILE "name.docx"
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 8:00 am

Doing so, you get a Word document with images. Marco needs a Word document with text that can be selected.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby MarcoBoschi » Thu Nov 30, 2023 8:09 am

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: )
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 8:17 am

Hello Marco,

This is how we do it:
viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#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
Otto
 
Posts: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 9:11 am

Otto wrote:Hello Marco,

This is how we do it:
viewtopic.php?f=3&t=13495&p=69231&hilit=word+zip&sid=62c130be6eb450bc2a0aad7749c99f80#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
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 9:17 am

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: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 9:48 am

And where do you get the XML file?
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 10:11 am

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: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 10:17 am

Otto, you did not get the point.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 10:28 am

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
Otto
 
Posts: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 10:34 am

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
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby MarcoBoschi » Thu Nov 30, 2023 10:48 am

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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 10:54 am

Enrico,
You need to create a WORD document in parallel. The question then is whether you should use WORD as a preview.

If you want to convert a FW report, you must build the WORD document in any case.

However, by manipulating the document.xml, you can use WORD as a report generator. You create your report in WORD and insert your own placeholders. We use [NAME] [etc] which is only necessary once when creating the template.

When you then run a report, you replace the placeholders with the values.

But I can only recommend switching to HTML right away.

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: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests