Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML report using tables of the application
Message
De
05/08/2009 14:14:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
HTML report using tables of the application
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01416262
Message ID:
01416262
Vues:
121
Hi... this is the second thread that I open with same subject and problem. I still trying to make a report of mine work under this circunstance: "To open some table and set a environment... and so... run a report using this set of tables."

Maybe I already try all possibles possibilities.. And I decide to open this thread as a kind of last thing to do...

This one works inside VFP.... And not outside VFP, as a desktop application .EXE.. Maybe I'm facing a bug... But I don't know how to work around this...

Ps: I tried... Recreate the report... Work with/without the tables inside the report's dataenvironment... The behavior is always the same.... An open dialog appears asking for a DBF file and nothing happend at all...

Any Help will be appreciated
Lparameters pntipo, pcalias, pcchave
#Define DebugListener -2
#Define PrintListener 0
#Define PreviewListener 1
#Define XMLListener 4
#Define HTMLListener 5
lclocal		= Justpath(_Screen.cNome_arq_prosi)
_ReportOutput  = Forcepath("REPORTOUTPUT.APP", lclocal)
_ReportPreview = Forcepath("REPORTPREVIEW.APP", lclocal)
_ReportBuilder = Forcepath("REPORTBUILDER.APP", lclocal)
If  File(lcdest)
	Erase lcdest NORECYCLE
Endif
lcClasslibs                  = Set("Classlib")
options 					 = " NOEJECT"
If  Upper("reportlistener")$Upper(lcClasslibs)
Else
	If  Version(2)=2
		Set Classlib To Home()+"\ffc\_reportlistener.vcx" Additive
	Else
		Set Classlib To "_reportlistener.vcx" Additive
	Endif
Endif
Local oListener As Object
Local oXH As Object
Local loPreview As Object

pcalias			= Substr(pcalias+Space(20),1,20)
pcchave			= Substr(pcchave+Space(10),1,10)
forexpr			= Iif(Empty(This.cForExpression),""," for "+This.cForExpression)

If  pntipo=2
	lcrepo		= Forcepath(Alltrim(commlog.Nome)+".frx", _Screen.clocalreports)
	lcdest		= Forcepath(Forceext(Alltrim(commlog.Nome), "htm"),_Screen.clocalreports)
	lcemail		= commlog.dest_email
	lcdstnome	= commlog.dest_nome
	lccdusuario = commlog.cdusuario
Else
	lcrepo		= Forcepath(Alltrim(cur_destinos.Nome)+".frx", _Screen.clocalreports)
	lcdest		= Forcepath(Forceext(Alltrim(cur_destinos.Nome), "htm"),_Screen.clocalreports)
	lcemail		= cur_destinos.email
	lcdstnome	= cur_destinos.dest_nome
	lccdusuario = cur_destinos.cdusuario
Endif
lcassi		= Forcepath("assinatura.htm", lclocal)

lclib				 = "_reportlistener.vcx"
If  Version(2)=2
	lclib			 = Forcepath("_reportlistener.vcx",Home()+"\FFc\")
Endif
oHTMLReport = Newobject("HtmlListener", lclib)
oHTMLReport.ListenerType = HTMLListener
oHTMLReport.TargetFileName = lcdest

*Setup HTML Listener as a successor
DO (_REPORTOUTPUT) WITH oHTMLReport
With oHTMLReport
  .QuietMode    = .T.
  .TargetFileName = (lcdest)
  .TargetFileExt  = ("HTML")  &&"TXT", "LOG", "XML"
EndWith

If  pcalias="pedcompr"
	Select copedite
Endif
If  "XTC002"$Upper(lcrepo)
	Select copedite.linha_pfk, copedite.d4pednr, copedite.fornecs_id,;
		copedite.cdusuario, copedite.d4prodt, copedite.d4qtfat, copedite.unid,;
		copedite.unid2, copedite.d4qtpec, copedite.d4qtpec2, copedite.d4pruni,;
		copedite.d4pruni2, copedite.d4prtot, copedite.d4qtok,;
		Pedcompr.datacompra, Pedcompr.horacompra, Pedcompr.comprador,;
		Pedcompr.pagamt_id, Pedcompr.valorcompr, Pedcompr.valordesco,;
		Pedcompr.valortt, Produtos.referencia, Produtos.descricao,;
		Produtos.resumida, Produtos.vendavelpr, Produtos.referencpr,;
		Produtos.grupo, Fornecs.fornec_id, Fornecs.nmfantasia, Fornecs.razaosoc,;
		Fornecs.fisicjurid, Fornecs.contato, Fornecs.endereco, Fornecs.bairro,;
		Fornecs.cidade, Fornecs.estado, Fornecs.cep, Fornecs.ddd, Fornecs.telefone,;
		Fornecs.email;
		FROM ;
		copedite ;
		INNER Join Pedcompr ;
		ON  copedite.d4pednr = Pedcompr.compra_id ;
		INNER Join Produtos ;
		ON  copedite.d4prodt = Produtos.referencia ;
		INNER Join Fornecs ;
		ON  copedite.fornecs_id = Fornecs.fornec_id;
		ORDER By copedite.d4pednr, Produtos.descricao;
		INTO Cursor cur_pesquisa1
ENDIF
If  Upper(_Screen.cLocaltabelas)$ Set("Path")
Else
	Set Path To (_Screen.cLocaltabelas) Additive
ENDIF

Report Form (lcrepo) ENVIRONMENT &forexpr TO Printer Prompt NOCONSOLE Object oHTMLReport
*
* I already try to take out &forexpr and ENVIRONMENT... Using preview clause the report works...
* 
IF  USED("cur_pesquisa1")
	USE IN "cur_pesquisa1"
endif

_Cliptext=Message()
oHTMLReport = ""
If  File(lcdest)
	If  File(lcassi)
		lcstr			= Filetostr(lcdest)
		lnmaiorpos		= Thisform.ver_maior_htmlpos(lcstr)
		lcstrass		= Filetostr(lcassi)
		lnpos2			= At("top:4.75417in", lcstrass)
		If  lnpos2>0 And lnmaiorpos<> 0
			lcstrass	= Stuff(lcstrass, lnpos2, 13, "top:"+Chrtran(Alltrim(Transform(lnmaiorpos,"9999.99999")), Set("point"), ".")+"in")
			lcstrass	= Strconv(lcstrass,9)
		Endif
		lnpos			= At("</body></html>", lcstr)
		If  lnpos>0
			lcstr		= Stuff(lcstr, lnpos, 0, lcstrass)
			=Strtofile(lcstr, lcdest, 0)
		Endif
	Endif
	If  Thisform.doenvio_email(lcdest, Alltrim(lcemail), Alltrim(lcdstnome), Alltrim(lccdusuario))
		If  pntipo=2
			Select commlog
			Scatter Memvar Memo
			m.dtexec		= Datetime()
			Gather Memvar Memo
		Endif
	Endif
Endif
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform