Page 3 of 3
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 5:33 am
by nageswaragunupudi
Another thing is that it seems like the new rpreview will NOT take into consideration when the app is themed to add the new buttons...?
It is so with both new and old rpreviews. There is no change in this present version.
If the application has a main window and the main window has buttonbar and the buttonbar has l2007 style OR IsAppThemed() is false, RPreview uses FWH's own TBar as the buttonbar. Otherwise it uses Rebar. Since providing interface for Rebar for the additional buttons was a bit complex, it was not provided in this case even originally.
In other words this interface of providing additional buttons was made available where IsAppThemed() is .f. OR the application has main window with a buttonbar with l2007 style, whether or not the app is themed.
Notice the text "factor" overlaps the exit button. Can someone help?
This is noticed. Soon a fix will be made available.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 6:14 am
by nageswaragunupudi
Mr. Michel and Mr. Horizon
The problem is the compatibility of the new olefuncs.prg with xHb.
Can you further help me?
Please copy all the functions in the olefuncs.prg to the end of the sample program I have posted before and then rename all functions as static functions. Then please compile and link without the original olefuncs.prg and test this new program.
Can you please test this and let us know the result?
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 8:59 am
by driessen
Mr. Nao,
I tested as you ask me to.
I copied all the function of olefuncs.prg into my test.prg and I made them all static.
I build my application and ran it. But the result is just the same. The first msginfo appears, the second one doesn't.
Thanks.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 9:29 am
by nageswaragunupudi
We need to test line by line.
Meanwhile I thought I would test it myself with xHb. I downloaded demo version (September 2010) from xharbour.com and tried to build a very simple program with just one statement
I got linking errors:
Code: Select all | Expand
xLINK: error: Unresolved external symbol '??2@YAPAXI@Z referenced from Fivehcm.lib(ACTX.obj)'.
xLINK: error: Unresolved external symbol '??3@YAXPAX@Z referenced from Fivehcm.lib(ACTX.obj)'.
Can you guide me how are you able to link xhb with fwh?
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 9:46 am
by Horizon
Hi Mr. Rao,
download
http://www.objekt.com.tr/fwh_test/xhb.rar, open it. add the xhb.obj to the xHarbour Builder.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 10:28 am
by driessen
Mr. Rao,
Indeed, as told, you need to add xhb.obj.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 11:51 am
by nageswaragunupudi
Mr. Horizon and Mr. Michel
Thanks for the help. I have linked xhb.obj and now I am able to compile and link. Where do we get this xhb.obj and what is it?
Coming to our issue:
Please see the code of function GetOleObject( cApp ) in the OLEFUNCS.PRG.
Code: Select all | Expand
static function GetOleObject( cApp )
local oObj
TRY
oObj := GetActiveObject( cApp )
CATCH
TRY
oObj := CreateObject( cApp )
CATCH
END
END
return oObj
This is the normal way we create Excel or Word objects. When I tried this today with xhb, the execution fails at GetActiveObject()
What is your experience? XBrowse.prg uses the same construct to create excel object till last version.
When I substituted the above with TOleAuto():New(cApp) it worked for me.
I now advise you to replace the function with this function in OLEFUNCS.PRG and link with your application and let me know the result.
Code: Select all | Expand
static function GetOleObject( cApp )
local oObj
TRY
oObj := TOleAuto():New( cApp )
CATCH
END
return oObj
Also please remove the module OLEFUNCS from the 'fivehm.lib' with whatever LIB utility you use.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 1:13 pm
by nageswaragunupudi
With the above change in olefuncs.prg export to word and save as pdf are working for me.
Please test and confirm.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 1:15 pm
by driessen
Mr. Rao,
I tested your suggestion and it indeed works fine now.
I also added your GetOleObject() to the latest RPREVIEW class in my application and it worked fine also.
To my opinion, we have got a solution.
Thank you very much for your help.
Re: To Antonio : Preview in FWH 10.12
Posted: Thu Jan 27, 2011 1:27 pm
by nageswaragunupudi
driessen wrote:Mr. Rao,
I tested your suggestion and it indeed works fine now.
I also added your GetOleObject() to the latest RPREVIEW class in my application and it worked fine also.
To my opinion, we have got a solution.
Thank you very much for your help.
This may not be enough. You may get problem with XBrowse ToExcel() method, because that method now uses ExcelObj() from the olefuncs.prg.
Better solution is, please modify the GetOleObj function in the olefuncs.prg as we suggested above. Remove the olefuncs.obj from fivehmx.lib and add the new obj.
This is a better way.
Next:
1) Can you help me to find out why GetActiveObj() is failing? Can you test this?
2) For conditional compiling, we check #ifdef __XHARBOUR__ to ascertain that we are compiling with xHarbour. Is there any such constant to check if we are compiling with commerical xHarbour?
Re: To Antonio : Preview in FWH 10.12
Posted: Sun Feb 13, 2011 10:35 pm
by nageswaragunupudi
nageswaragunupudi wrote: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.
In continuation to my above post, let me correct myself. It is possible to remove the two or all buttons and substitute with our own buttons.
Sample code:
Code: Select all | Expand
function ReportExtend( oPreview, oBar )
// remove last two buttons
oBar:Del( Len( oBar:aControls ) )
oBar:Del( Len( oBar:aControls ) )
// now add our own buttons
DEFINE BUTTON OF oBar ;
RESOURCE 'SAVE' ; // from our resource or bitmap file
TOOLTIP 'Save To PDF' ;
ACTION Preview2PDF( oPreview )
< continue with our code >