To Antonio : Preview in FWH 10.12

To Antonio : Preview in FWH 10.12

Postby driessen » Wed Jan 19, 2011 4:28 pm

Hello,

I tried out the new rpreview class in FWH 10.12.

It is great that we will be able to save reports into a word-document or a pdf-file.

I recompiled my application. At the preview box, I noticed 2 new buttons : a save-button (to save as word or pdf) and a word-button to export the report to word.

Unfortunately I got a problem. If I click on one of those 2 new buttons, my application is quited without any error-message.

Any idea what's wrong ?

Thank you very much in advance.
Last edited by driessen on Fri Jan 21, 2011 8:58 am, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Preview in FWH 10.12

Postby nageswaragunupudi » Wed Jan 19, 2011 4:46 pm

Seems difficult to say. Can you try with bcc582 and check if there is problem? May I know what version of MS Office you are using?
Also, can you please test with this small program compiling with bcc582 ?
Code: Select all  Expand view  RUN
#include "fivewin.ch"
#include "xbrowse.ch"

function Main()

   local oWnd, oBar

   DEFINE WINDOW oWnd
   DEFINE BUTTONBAR oBar OF oWnd 2007
   DEFINE BUTTON OF oBar ACTION XBrowse( 'CUSTOMER.DBF' )

   ACTIVATE WINDOW oWnd ON INIT XBrowse( "customer.dbf" )

return nil
 
Regards

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

Re: Preview in FWH 10.12

Postby driessen » Wed Jan 19, 2011 4:56 pm

I use bcc582 already for some time.

I'm using Office 2010 Professional.

The test with your small program went well.

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Preview in FWH 10.12

Postby TimStone » Wed Jan 19, 2011 4:57 pm

This is a great addition. However, it would be nice to have a way to add buttons without constantly modifying the source code. For example, I have a button to send any document as an email. It converts the preview to a PDF and then attaches it to an email.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Preview in FWH 10.12

Postby nageswaragunupudi » Wed Jan 19, 2011 6:08 pm

TimStone wrote:This is a great addition. However, it would be nice to have a way to add buttons without constantly modifying the source code. For example, I have a button to send any document as an email. It converts the preview to a PDF and then attaches it to an email.

The functionality you are now asking for was already provided long back in 2009 May and its there for almost 20 months.

We can use the function RPrevUserBtns( bNewUserBtns ) --> bPrevButtons.

Please see this posting for a working sample
viewtopic.php?f=3&t=17510&p=91155&hilit=ReportExtend#p91155
Regards

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

Re: Preview in FWH 10.12

Postby nageswaragunupudi » Wed Jan 19, 2011 6:11 pm

driessen wrote:I use bcc582 already for some time.

I'm using Office 2010 Professional.

The test with your small program went well.

Thanks.

Well. Then can you help to isolate the problem? Is it working with bcc582 but not with xhb or working with bcc582 with the above sample but not in a different application built with same 5.82?
Regards

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

Re: Preview in FWH 10.12

Postby George » Wed Jan 19, 2011 8:38 pm

I recompiled my application. At the preview box, I noticed 2 new buttons : a save-button (to save as word or pdf) and a word-button to export the report to word.
Unfortunately I got a problem. If I click on one of those 2 new buttons, my application is quited without any error-message.

I have the same problem as mentioned by Driessen.

My configuration is:
xHarbour builder
FWH 10.12
Ms-Office 2010

Regards,

George
George
 
Posts: 725
Joined: Tue Oct 18, 2005 6:49 pm

Re: Preview in FWH 10.12

Postby nageswaragunupudi » Wed Jan 19, 2011 9:19 pm

Mr George

May I ask you, if you are compiling with xhb? And does the above simple program work well for u?
Regards

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

Re: Preview in FWH 10.12

Postby George » Wed Jan 19, 2011 10:47 pm

Mr. Rao
Your sample code is compiling fine, but when I press the MS-Word button, in preview screen, I get the message:
"TEST1.EXE has stopped working". No error message.
The same message is displayed if I press MS-Excel button or when I try to save the document in any format (DOC or PDF) in preview screen, otherwise the program is working OK.

I am using xHarbour Builder from xharbour.com + FWH 10.12 under Windows 7 Pro 64 bits OS.

Regards,

George
George
 
Posts: 725
Joined: Tue Oct 18, 2005 6:49 pm

Re: To Antonio : Preview in FWH 10.12

Postby driessen » Fri Jan 21, 2011 8:58 am

Antonio,

Any idea what the problem might be ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Fri Jan 21, 2011 11:06 am

driessen wrote:Antonio,

Any idea what the problem might be ?

Thanks.

Can we see any sample code that is giving the problem?
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby reinaldocrespo » Fri Jan 21, 2011 4:14 pm

Mr. Rao;
The functionality you are now asking for was already provided long back in 2009 May and its there for almost 20 months.

We can use the function RPrevUserBtns( bNewUserBtns ) --> bPrevButtons.


Thank for the information. I didn't know that.

May I ask; Is there a way also to remove buttons? I mean; may I remove the word and pdf buttons?

Thank you;


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Fri Jan 21, 2011 5:53 pm

May I ask; Is there a way also to remove buttons? I mean; may I remove the word and pdf buttons?

As of now, the answer is No.
Either we need to modify the code or much better include 10.11 rpreview.prg in our application which overrides the current rpreview.prg.

Probably, if that is our wish, FWH may provide for more customization of the buttons and bar possible in the next release.
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby ukservice » Fri Jan 21, 2011 8:29 pm

Mr Rao,

I think Preview should export to Excel, Word and PDF. In the case of PDF without using Word, because in some cases Office would not be installed.

A possible solution could be this:

Code: Select all  Expand view  RUN
Function PDFSAVE(aFiles)
Local cString
Local cDestino

Local x:=0
Local cTexto:=""


cDestino := cGetFile("Export Report (*.pdf) | *.pdf |","Save as...", NIL, nil, .T., .T. )



If Len(aFiles) = 1
   cString:="nConvert -o " + cDestino + " -quiet -out pdf -c 5 " + aFiles[1]
Else
   If File("listaemf.txt")
      Delete File listaemf.txt
   Endif

   For x=1 To Len(aFiles)
       cTexto:=cTexto + aFiles[x] + CRLF
   Next
   MemoWrit("listaemf.txt",cTexto )

   cString:="nConvert -multi -o " + cDestino + " -quiet -out pdf -c 5 -l listaemf.txt"
Endif

MsgRun("Wait","Exporting to PDF", {|| WAITRUN(cString,0 ) } )


MsgAlert("File "+ AllTrim(cDestino) +".PDF has been created.", " Export PDF ")

Return Nil



Also, I think it is time to incorporate Ribbon Bar to Preview. It looks like it was in FW 1.9.x


Thanks you for listening!!
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: To Antonio : Preview in FWH 10.12

Postby Bayron » Fri Jan 21, 2011 11:58 pm

ukservice, nConvert is a great tool, but it costs 100 Euros + VAT per application, or we have to buy the developer toolkit...

As it reads in their website:
One license per one company or one application
You may not sell or distribute as a developer toolkit, or use as a server application.

Something prohibited for most programmers and costumers;

Maybe Mr. Rao can enlighten us with the direction that him and Fivetech are planning on going...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests