Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print2PDF Webservice error
Message
From
04/05/2005 18:28:34
 
General information
Forum:
Visual FoxPro
Category:
ActiveVFP
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01010076
Message ID:
01011089
Views:
20
Hi Arto and Claude

Thank you for your answers. Finally I solved my problem. As Claude said. I created a COM exe (FlexyPDF.exe), to execute the PRINT2PDF program. My virtual directory is ISAPI listener beacause is a webservice.

The problem that I have now is when I deploy the application in another computer, I receive an error that my class (FlexyPDF.PRINT2PDF)is not found, in my computer works fine. I suppose that I need to register my exe, but I tried and I can't. Do you have an idea.

Another question. I would like to compress my XML strings. Is there a dll to compress them in the server side?....and uncompress in the client side?.....

Regards,


P.S.: The code is:


Define Class FRX2PDF As Custom OlePublic

*********************/Reporte de Packing/*****************

Procedure grow_packing_report(lcPacking_uq As String) As String

Local m.lcReturn As String
Local loXMLAdapter As Xmladapter
Local lcXmlPackRepo As String

Try
Set Textmerge On
Set Console Off
TEXT TO lcsql_calls
execute sp_flower_ws_packing_report ?lcPacking_uq
ENDTEXT

m.lnNewHandle = SQLConnect('Melody','sa','gandalf',.T.)

If m.lnNewHandle > 0
m.lnRet = SQLEXEC(m.lnNewHandle, lcsql_calls, 'vr_Packing_repo')
If lnRet < 0
= Aerror(aErrorArray)
lcReturn = This.odbc_error(@aErrorArray)
Throw lcReturn
Endif
SQLDISCONNECT(m.lnNewHandle)

Select vr_Packing_repo
m.lcPDF = "c:\eisvisualsystems\web_services\grow_reports\"
m.lcFRX = "c:\eisvisualsystems\reportes\ventas\ws_packing_grower.frx"

lcXmlPackRepo = This.PDFConvert(m.lcPDF,m.lcFRX)

Else
Throw 'No hay conección con la base de datos.'
Endif

Catch To loError
lcXmlPackRepo = This.Exception_Error(loError)
Finally

Endtry
Return lcXmlPackRepo

Endfunc

*******************/Genera los labels del packing/*******************
Procedure grow_packing_labels (lcPacking_uq As String) As String

Local m.lcReturn As String
Local loXMLAdapter As Xmladapter
Local lcXmlPackLabel As String

Try
Set Textmerge On
Set Console Off
TEXT TO lcsql_calls
execute sp_flower_ws_packing_label ?lcPacking_uq
ENDTEXT

m.lnNewHandle = SQLConnect('Melody','sa','gandalf',.T.)

If m.lnNewHandle > 0
m.lnRet = SQLEXEC(m.lnNewHandle, lcsql_calls, 'vr_Packing_label')
If lnRet < 0
= Aerror(aErrorArray)
lcReturn = This.odbc_error(@aErrorArray)
Throw lcReturn
Endif
SQLDISCONNECT(m.lnNewHandle)

Select vr_Packing_label

Select vr_Packing_label
Afields(a_label, 'vr_Packing_label')

Create Cursor c_resultado From Array a_label

Select vr_Packing_label
Scan
Scatter Memvar
For i = 1 To vr_Packing_label.box_qty
Select c_resultado
Append Blank
Gather Memvar
Replace boxnum With i
compuesto = farm +Right('0000'+Alltrim(Str(lote)),5) + Right('00'+Alltrim(Str(boxnum)),3)
Endfor
Select vr_Packing_label
Endscan

Select c_resultado

m.lcPDF = "c:\eisvisualsystems\web_services\grow_reports\"
m.lcFRX = "c:\eisvisualsystems\reportes\ventas\ws_grower_label.lbx"

lcXmlPackLabel = This.PDFConvert(m.lcPDF,m.lcFRX)

Else
Throw 'No hay conección con la base de datos.'
Endif

Catch To loError
lcXmlPackLabel = This.Exception_Error(loError)
Finally

Endtry
Return lcXmlPackLabel

Endfunc

**************************/Genera los archivos PDF /**********************
Function PDFConvert (lcPDF,lcFRX) As String
Local lcPDFRepo As String
Try

lcPDFRepo = Substr(Sys(2015),3,10)+[.pdf]
m.lcPDF = m.lcPDF+lcPDFRepo
Set Procedure To c:\eisvisualsystems\General\print2pdf.prg Additive
Do print2pdf With lcPDF , lcFRX


Catch To loError
m.lcPDFRepo = This.Exception_Error(loError)
Finally

Endtry
Return m.lcPDFRepo
Endfunc

Function Exception_Error (loException) As String
Local lcMessage As String
Try

If loException.ErrorNo=5 Or loException.ErrorNo=52
loException.Details=Alias(Select())
Endif

If loException.ErrorNo=2071
lcMessage='Mensaje FlexyMax:'+' '+loException.UserValue
Else
lcMessage='System Error No: ('+Alltrim(Str(loException.ErrorNo))+')'
lcMessage=lcMessage+Chr(10)+'Mensaje: '+loException.Message
lcMessage=lcMessage+Chr(10)+'Detalles: '+loException.Details
lcMessage=lcMessage+Chr(10)+'Contenido: '+loException.LineContents
lcMessage=lcMessage+Chr(10)+'Procedimiento: '+loException.Procedure
lcMessage=lcMessage+Chr(10)+'Stack Level: '+Str(loException.StackLevel)
Endif

Catch To loError
m.lcMessage = This.Exception_Error(loError)
Finally

Endtry
Return m.lcMessage
Endfunc

Enddefine




>Carlos,
>
>Are you using it with ASP or ASP.NET? PDF reporting is still unsolved with ASP but it should work with ASP.NET.
>
>Problem with the ASP and multi threaded DLL is that printer is not changed from the default one to the Postscript before ghostscript. Maybe setting the defualt printer to the Postscript in config.fpw would help but haven't test it yet.
>
>AT
Carlos A. Miranda
E.I.S.lnc
President
Previous
Reply
Map
View

Click here to load this message in the networking platform