Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using frx2word or other class to generate html reports
Message
 
 
À
08/03/2002 14:10:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00625839
Message ID:
00630350
Vues:
52
Hi Andrus,

Can you give your users some other visual interface instead or you want to use REPORT ? I haven't proceeded with the idea of DOS report, for some reason it didn't work for me. You may try to create very simple DOS report and see, if VFP can work with it...

I'm afraid, what Report capabilities of VFP are very limited and for your particular situation you would need to use something else. It could be Doug Henning's SFReports. I believe, it's public domain, so you can play with it and see, if you can use it instead. I don't know, what else to suggest, may be somebody else would jump into this discussion with better ideas...

BTW, you should not delete all info in EXPR field. Here is the program, I use:
********************************************************************
*  Description.......: RemovePrinterSpecificInfo - Removes printer specific settings in report form
*  Calling Samples...: RemovePrinterSpecificInfo('All')
*  Parameter List....: pRepoForm
*  Created by........: Yuri Rubinov July 2000
*  Modified by.......: Nadya Nosonovsky 01/11/2002 01:51:06 PM
********************************************************************
parameter pRepoForm
local ia
if vartype(pRepoForm)#"C"
	pRepoForm=getfile("frx")
endif

do case
case upper(m.pRepoForm)#"ALL"
	pRepoForm=forceext(m.pRepoForm,"frx")

	if not file(m.pRepoForm)
		=messagebox("Report Form "+ m.pRepoForm +" not found?!",48,'Not found')
		return .f.
	endif
	do iClean
otherwise
	local array aa[1]
	local lcPath, lcFilter, DTitle, lcReportDir, lnFiles
	lcReportDir = '\redp\dbc\jobs\Reports'
	lcPath =''
	DTitle = "Select Report Files to Remove Printer Specific Info..."
* Text (*.txt)|*.txt|Pictures (*.bmp;*.ico)|*.bmp;*.ico
	lcFilter = "Report Files (*.frx)|*.frx|All Files (*.*)|*.*"
	lnFiles = File_Chooser(@aa, @lcPath, m.DTitle, m.lcReportDir, m.lcFilter)
	if m.lnFiles = 0 && User chooses Cancel
		return .f.
	endif
*!*
*!*		if adir(aa,"*.frx")<=0
*!*			=messagebox("No *.frx Report Forms found?!")
*!*			return
*!*		endif
	=asort(aa)
	for ia =1 to m.lnFiles
		pRepoForm=addbs(m.lcPath)+aa[m.ia]
		do iClean
	endfor
endcase

*----------------------------------
procedure iClean
local lcExpr, lnLines, lnI, CR
close table all
use (m.pRepoForm)
wait wind time 0.5 "Report form "+dbf()
=afields(afld)
CR=chr(13)
* the very first record only
if ascan(afld,"TAG")#0 and ascan(afld,"TAG2")#0 and ascan(afld,"EXPR")#0
	go top
*keep orientation and other stuff
    lnLines = alines(laLines,expr,.t.)
    lcExpr = ""
    for lnI = 1 to m.lnLines
        if "DEVICE" $ upper(laLines[m.lnI]) or "DRIVER" $ upper(laLines[m.lnI]) or "OUTPUT" $ upper(laLines[m.lnI])
            && this record should be removed
        else
           if "DEFAULTSOURCE" $ upper(laLines[m.lnI])
               laLines[m.lnI] = "DEFAULTSOURCE=7"   
           endif
           lcExpr = m.lcExpr + laLines[m.lnI]+ m.CR
        endif        
    next
*!*		if "orientation"$lower(expr)
*!*			lcOrient=substr(expr,at("orientation=",lower(expr))) && Remove the begining of the Expr field
*!*		endif	     
	replace tag with "", tag2 with "", expr with m.lcExpr
else
	=messagebox("File "+m.pRepoForm+". Not VFP6 format?!")
endif
use
*-----------------
>I need that my end users can modify this report: change formulas etc.
>
>If I use your suggestion to create a prg from this report or
>create a report in fp dos, I my users lose this ability.
>
>So I cannot use your suggestions.
>Are your sore that DOS report works OK ?
>If so, then it may be
>possible to convert a vfp frx file back to fp dos report at run time.
>Or is there a simler solution so that end users can
>modify text report using some visual designer ?
>
>My sample report works without data loss in 80% of users.
>Howewer, if 20% of users data is corrupted and I have no
>idea does this depend on the printer driver or data or some
>other think.
>
>I use always the command
>
>blank field tag, tag2, expr
>
>to clear first record in frx file.
>
>Also, pressing page up /page down keys in this report print
>preview many times causes
>a famous reproducible C5 error in VFP 7 SP 1
>
>Also, C5 occurs on REPORT .. .ASCII command sometimes in this report.
>
>Users try several times to produce text file.
>May times they got a C5 error but suddenly, at one time this
>works (Win 2000, HPLJ 1100 printer).
>
>
>>BTW, the alternative suggestion from another thread was to try to create report in FPD2.6 and have VFP to run it. I don't have much luck with it, though, but I didn't really try it hard.
>>
>>>>>How about generating plain .txt files using frx2word ?
>>>>>REPORT ... ASCII corrupts data so I'm looking for a solution
>>>>>to generate txt files from frx reports.
>>>>>
>>>>>
>>>>>>Andrus
>>>>
>>>>Andrus,
>>>>
>>>>How many reports you want to produce simple txt file and what do you call a data corruption? Reports could not change your data, but ASCII clause doesn't work correctly, if you have more than one detail lines in your report. For cases like this I produce reports programmatically, e.g. I write a program, which either uses textmerge or strtofile approach to produce a text file. I think, there are some other tools avialble to produce text file based on the input...
>>>
>>>I have a single complicated report (www.eetasoft.ee/m2002001.zip) from which I need to generate txt file.
>>>This report does NOT have detail lines at all!
>>>
>>>In some computers, in every fourth record, if #181 record does not exist, a line after #18 field is moved to the same line as in #18 field and first three characters of it are replaced by #18.
>>>
>>>I set report font to a tiny and added a lot of space before and after
>>>lines, but corruption still occurs.
>>>How to get correct txt file from this report ?
>>>Re-designing it programmatically takes a lot of time and makes modifications very difficult.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform