PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Export to Excel (pass table by parameter)
Export to Excel (pass table by parameter)
Iniciado por guillermo, nov., 01 2005 11:43 PM - 1 resposta
Publicado em novembro, 01 2005 - 11:43 PM
Hi forum....
I generated in the global procedure the following procedure
PROCEDURE Exportar(Tabla,Destino)
sFile is string
SWITCH Destino
CASE "E"
sFile = fSelect("", "", "Escriba el nombre del archivo","Excel files (*.xls) *.xls", "xls", fselCreate + fselExist )
CASE "W"
sFile = fSelect("", "", "Escriba el nombre del archivo","Word files (*.rtf) *.rtf", "rtf", fselCreate + fselExist )
CASE "X"
sFile = fSelect("", "", "Escriba el nombre del archivo","XML files (*.xml) *.xml", "xml", fselCreate + fselExist )
END
IF sFile = "" THEN RETURN
SWITCH Destino
CASE "E"
TableToExcel (Tabla, sFile)
CASE "W"
TableToWord (Tabla, sFile)
CASE "X"
TableToXML (Tabla, sFile)
END
IF YesNo(0,"¿Desea abrir el archivo generado ?") = Yes THEN
ShellExecute(sFile)
END
I call the procedure .... Exportar(TA_Marcas_Moviles,"E").... then this error occurs
Error in Global Procedure Exportar process, line 24.
TableToExcel function called.
Error caused by 1 parameter.
TA_Marcas_Moviles control unknown.

What can I do?
Thanks .... Guillermo
Publicado em novembro, 02 2005 - 3:08 PM
Hi Guillermo,
I assume, that your "Exportar" isn't a local procedure, right? Pass then the full qualified (wndMyWindow.tbMyTable) table name to your procedure. That should do it.
Regards
Raimund

Hi forum....
I generated in the global procedure the following procedure
PROCEDURE Exportar(Tabla,Destino)
sFile is string
SWITCH Destino
CASE "E"
sFile = fSelect("", "", "Escriba el nombre del archivo","Excel files (*.xls) *.xls", "xls", fselCreate + fselExist )
CASE "W"
sFile = fSelect("", "", "Escriba el nombre del archivo","Word files (*.rtf) *.rtf", "rtf", fselCreate + fselExist )
CASE "X"
sFile = fSelect("", "", "Escriba el nombre del archivo","XML files (*.xml) *.xml", "xml", fselCreate + fselExist )
END
IF sFile = "" THEN RETURN
SWITCH Destino
CASE "E"
TableToExcel (Tabla, sFile)
CASE "W"
TableToWord (Tabla, sFile)
CASE "X"
TableToXML (Tabla, sFile)
END
IF YesNo(0,"¿Desea abrir el archivo generado ?") = Yes THEN
ShellExecute(sFile)
END
I call the procedure .... Exportar(TA_Marcas_Moviles,"E").... then this error occurs
Error in Global Procedure Exportar process, line 24.
TableToExcel function called.
Error caused by 1 parameter.
TA_Marcas_Moviles control unknown.

What can I do?
Thanks .... Guillermo



http://www.invitec.com