Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fixing frx2word bug in report variable initial value
Message
From
19/11/2001 16:35:19
 
 
To
08/11/2001 15:28:38
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00574226
Message ID:
00583676
Views:
47
Hi Andrus,

Sorry for the delay in reply, I was experimenting with the code changes you suggested. Fabio Vieira, who was instrumental in the 1.3x release in speeding up the class, just sent me an update where he has pulled some tricks that make the class about 40% faster(!).

I will be incorporating your suggestions and Fabio's and a few others have sent me in a new release (1.5 probably) in the next few days. Of course, I will add your name to the contirbutor credits!


>> Also try switching to Inches from Centimeters in Report Designer.
>
>How to try this? File/Page setup/Dimension: Centimeters is read only !?
>
>One more change to test:
>
>I embedded a frx2wrd into genrepox. Genrepox runs a report copy in windows
>temporary directory.
>
>I have a .bmp file field in form. frx2wrd uses fullpath() from report file directory to send full file
>name to word. In this case fullpath() returs reference to a non-existing bmp
>file and this causes OLE error from Word.
>
>To fix this, a made a .reporthome property to public and before calling
>frx2word, added a line
>
>oF2W.reporthome = CURDIR()
>
>also, in .reportform() method, I wrapped an assignment to IF statement
>
>
>* if .reporthome not specified, use default
>IF EMPTY( .reporthome )
> .reporthome=creportpath
>  ENDIF
>
>
>
>or even better
>
>in .reportform() method change
>
>creportpath=addbs(justpath(creportname))
>
>to
>
>creportpath = curdir()
>
>What do you think about those changes ?
>
>>>I have also a big problem of wrong placement of fields in doc file.
>>
>>2 things to try: Try explicitely formating the fields using a format string in the Report Designer. Also try switching to Inches from Centimeters in Report Designer.
>>
>>>Many of numbers in generated doc file are shown only partially. If a increase the height of field in word, numbers are fully displayed. It seems that numbers are not placed to center of fields but in the bottom of field. How to fix this ?
>>>
>>>Also I'm using Markus Egger Genrepox utility. Is it possible that frx2word
>>>will accept genrrepox *:IF command from field comment snippet ?
>>
>>I haven't thought of that but it's something that could be tried.
>>
>>
>>>
>>>>Andrus, you can do anything you like to the class, that's why I upload the source code. Use and abuse at will.
>>>>
>>>>In fact, if anyone comes up with a bugfix or enhancement, they can email it to me and I'll include the credit in the docs and on the description page here on the UT after I have tested and uploaded the addition.
>>>>
>>>>
>>>>>.InitVars() works OK without saving/restoring view.
>>>>>
>>>>>I discovered next bug in frx2word: during outputting a last page footer, report main alias is at end of file positon. However, in VFP report writer, report main alias in at last record.
>>>>>To fix this, I added a two bold lines to the .reportform() method.
>>>>>Is it OK to add them ?
>>>>>
>>>>> if eof()
>>>>>SKIP -1 IN (m.calias) && Added
>>>>> .placecolftr()
>>>>>
>>>>> .placepgftr()
>>>>> if (.voffsetpts+.sumbandheightpts > .maxvpospts) or ;
>>>>> (.columns > 1)
>>>>> f2w_owdoc.sections.add
>>>>> .pageno=.pageno+1
>>>>> .voffsetpts=0
>>>>>
>>>>> endif
>>>>> .placesummary()
>>>>>exit && added
>>>>> endif
>>>>>
>>>>>>Here's a thought: Try the old CREATE VIEW and SET VIEW commands to create .vue files as blocks to InitVar()...this way, everything gets restored. Yes, it's a cheezy idea, but it would work.
>>>>>>
>>>>>>
>>>>>>>Yes and No. Some of my simpler reports are running after this fix.
>>>>>>>
>>>>>>>However, complex reports are still causing errors. I'm using a udf-s in
>>>>>>>report expressions.
>>>>>>>I have found that some of my tables related to report main alias are at eof() position if using frx2word.
>>>>>>>
>>>>>>>If VFP report writer, they are at correct position. It seems that frx2word
>>>>>>>will not restore current alias and record after evaluating my expression
>>>>>>>
>>>>>>>
>>>>>>>>Does it work now?
>>>>>>>>
>>>>>>>>>I have found the following bug in frx2word utility:
>>>>>>>>>
>>>>>>>>>if report variable initial value uses a previous report variable initial value,
>>>>>>>>>an error occurs in .initvars() method.
>>>>>>>>>
>>>>>>>>>I fixed it by adding two lines to initvars method.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>		this.vardata[m.i,4]		= rpt.totaltype
>>>>>>>>>		this.vardata[m.i,5]		= 0
>>>>>>>>>		this.vardata[m.i,6]		= 0
>>>>>>>>>
>>>>>>>>>* The next line produses error if initial value use other var initial value
>>>>>>>>>		this.vardata[m.i,7]		= eval(allt(rpt.tag))
>>>>>>>>>
>>>>>>>>>		this.vardata[m.i,8]		= vartype(eval(allt(rpt.tag)))
>>>>>>>>>		this.vardata[m.i,9]		= this.vardata[m.i,7]
>>>>>>>>>
>>>>>>>>>* Those linses are added to fix this error
>>>>>>>>>PRIVATE (ALLTRIM(rpt.name))
>>>>>>>>>STORE eval(allt(rpt.tag)) TO (alltrim(rpt.name))
>>>>>>>>>
>>>>>>>>>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform