Convert a print to Rtf or doc

Re: Convert a print to Rtf or doc

Postby Silvio.Falconi » Thu Nov 30, 2023 11:13 am

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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: Convert a print to Rtf or doc

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

Silvio,
I've posted the solution for WORD, and I've also allowed myself to represent my stance on Reports.
And it's the other way around. TESLA is HTML.

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

Re: Convert a print to Rtf or doc

Postby MarcoBoschi » Thu Nov 30, 2023 12:16 pm

Otto,
do you think that when Microsoft Access allows you to create a report it actually creates a word (RTF) in parallel or
when you have the preview and click on export RTF it does something different maybe simpler?

good lunch to all
User avatar
MarcoBoschi
 
Posts: 1015
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 1:25 pm

Marco, What kind of reports are these? Don't you have a sample report?

If you need a WORD document, you have to create the document.xml.
Look at the logic in xbrowse, see how the XCEL export is done there. You have to do something similar with WORD.

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

Re: Convert a print to Rtf or doc

Postby MarcoBoschi » Thu Nov 30, 2023 2:59 pm

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

Re: Convert a print to Rtf or doc

Postby Silvio.Falconi » Thu Nov 30, 2023 4:53 pm

Converte It on HTML is Easy, i made something of several with php and html with css
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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 6:51 pm

Hello Marco,

I've looked at the source code for editing document.xml in Word again.
It's complicated and has no future.

I'll post a small test program for HTML report later.
HTML is so easy to configure and it works everywhere.

Best regards,
Otto

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

Re: Convert a print to Rtf or doc

Postby Otto » Thu Nov 30, 2023 7:35 pm

Hello Marco,
This is a test for HTML report.
If you also make mod harbour programs later, you can adopt the reports 1:1.

You'll see that the report is saved as index.html in the program directory. You can then open this report with Word and save it as a docx file.

I hope you like it.

Please take your time for testing. I've experimented so much with reports, but HTML is the best.

Should you have further questions or specific requirements, especially regarding code customization, feel free to reach out to me again.
Best regards,
Otto

Download: https://mybergland.com/fwforum/marcob.zip

sourcecode and exe

***



Guide to Using the FiveWin-Based Program
1. Program Start and GUI Initialization
When the program starts, the main function Main is called.
In this function, various GUI elements such as a dialog window (oDlg), a browser object (oBrw), and buttons are created.
The size and properties of these elements are set up to form a user interface for displaying and editing data.
2. Data Preparation
An array aData is defined and filled with preliminary data to be displayed in the GUI. This data might include company names, addresses, invoice numbers, and similar information.
3. Displaying Data in the Browser Object
The browser object oBrw is used to display the data from aData in a tabular view.
Users can see and edit this data in the GUI.
4. Generating a Report
By pressing a button in the dialog, the Report function is invoked.
This function reads HTML templates and constructs a structured report that includes images, product descriptions, quantities, and prices.
5. Printing the Report
The PrintHtml function allows for printing the generated report.
This function utilizes an ActiveX object to handle the printing process.
6. Auxiliary and Control Functions
The function check4prn is used to determine which columns should be printed in the report.
The procedures PrgInit and PrgExit initialize and clean up system settings at the start and end of the program.
Important Notes
Data Customization: The data provided in the aData array should be adjusted according to actual requirements.
HTML Templates: External HTML templates are used for the report. These should be present and correctly formatted.
Printing Functionality: The printing functionality depends on the correct configuration and installation of the ActiveX object.





Image

Image

Image

Image

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

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Thu Nov 30, 2023 8:11 pm

Marco needs to export from a normal FWH print preview (TPrinter). HTML could be interesting, but maybe not for his current project.
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby nageswaragunupudi » Thu Nov 30, 2023 10:05 pm

Same way as we can generate editable pdf documents using TPrinter():lUseHaruPDF, we wanted to provide generation of editable Word Docx also. But the work is incomplete. We will soon provide this feature.

Till then one can consider using TWord class that is available free to generate word document.
Regards

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

Re: Convert a print to Rtf or doc

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

Dear Mr.Rao,

May I ask: Is there something wrong with HTML as a reporting language since everyone is against it?

The young developers do it. Most of them are web developers, why should they bother with another option.

Why should they, when they already have the preview - web browser - ready, take on additional work?
I don't see a future for separate systems.

What I see is that it's high time for us to move towards the web. Only a few desktop versions are being updated anymore.
Most customers then switch to web applications.
I think we should collaborate on HTML reports and support each other. It's also ideal for learning HTML and getting a feel for the web.

I have young people in my company, and I want us to be well-positioned for the future.


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

Re: Convert a print to Rtf or doc

Postby nageswaragunupudi » Fri Dec 01, 2023 2:42 am

May I ask: Is there something wrong with HTML as a reporting language since everyone is against it?


Nothing wrong at all.

But for this, the programmers need to learn HTML and even master web programming.
You have already mastered this subject and it is very easy for you.
In fact, you have made your own syntax and a very powerful library of your own and I admire you for that.

You have been pushing this idea and this will take sometime to catch up with other programmers.

Once the programmers reach this stage, they don't any more need FWH.
Once we use php we do not need Harbour either.

A programmer who starts now to learn html, needs a very long time to produce html code and also requires a large html code with same functionality as a one line program in FWH
Code: Select all  Expand view
XBROWSER "CUSTOMER.DBF" FASTEDIT

with vertical and horizontal scrolling and facility to edit values inside the cell, validate and immediately save to dbf,recordset or whatever.
So they choose what helps them to develop the application faster.

In fact I have been thinking of personally approaching you to help me with a html module with the same functionality like this.

Next:
In this particular post, our friends wants to generate a word document.
You can help us on that requirement.
I saw your advice in the thread. But that works for template reports. We need to generate word doc for free form reporting.
I will be personally interested in your suggestions.
Regards

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

Re: Convert a print to Rtf or doc

Postby Enrico Maria Giordano » Fri Dec 01, 2023 9:16 am

Otto wrote:May I ask: Is there something wrong with HTML as a reporting language since everyone is against it?


Who is against it? I am not, for sure. But you can't answer to any question with "use HTML", sorry.
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Convert a print to Rtf or doc

Postby Otto » Fri Dec 01, 2023 9:45 am

Hello Enrico,
We should not become a retirement home.

If it has worked for most of us until now, then that must have been it. We need to focus on future topics.

We have only limited resources. And if we can't attract young people to our project here, then it's over.

It would really be a pity.

We have all the prerequisites. Only the stubbornness of the 'Best Agers' is in our way.


I currently feel the mood in the forum is like this:
(Look also at the eyes of the two young people)

Image

I so wish - and Christmas is near,
that the mood will be like this again:

We should become the boys we used to be.

Image

But that's just my personal perception. Maybe I am the problem?
Have a nice weekend and

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

Re: Convert a print to Rtf or doc

Postby Silvio.Falconi » Fri Dec 01, 2023 9:49 am

May I ask: Is there something wrong with HTML as a reporting language since everyone is against it?




It's not about being against HTML

it is the incessant fact of imposing a language like "Mod_Harbour"

Continued imposition by Mr Otto as the official ambassador of "Mod_harbour",

It's as if now one has to stop programming in Fwh and start studying the "Mod_harbour" which is absolutely not the same as fwh.

In fwh there are many things that don't work or work incorrectly, first let's improve the fwh and then we can think about the web.

and from what I can continuously read in the various forums this is not only my thought but the thought of the majority of fwh users who when they have to make a program for a management for a client encounter countless problems for classes that do not work or work badly and they are forced to do their own work to adapt them to their needs

I often see problems with Web-type management programs, I work at school and in my secretariat almost everything is now on the web and it's wrong because the day the servers don't work or the internet doesn't work everything stops and the same thing happens in commercial e-services: it is true that mod_jarbour works locally as Mr. Otto has always told me, but the management software is often located in CLOUD-type servers and are unreachable if there is a problem on the network.


In the initial proposals there was talk of a language identical to the fwh and the possibility of bringing it "portability" to the web but in reality this was not the case, a completely different language, starting with the non-compatible archives.

I have regularly used Html, javascript, Php for many years (for e-commerce management and study management, without the aid of mod_harbour or other languages which Mr Otto boasts of knowing and of which he is a repeated ambassador.

even viewing this image

Image


is a clear sign that you are constantly taking the piss out of me

because if he had a bit of love he wouldn't make a list with reference to umbrellas since there is no sea in Sillian unless Mr. Otto created it tonight


it is a clear sign of allusion to my person

and I'm deeply fed up with this
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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests