PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Crystal Reports
Crystal Reports
Started by Pedroso, Oct., 20 2004 5:03 PM - 3 replies
Posted on October, 20 2004 - 5:03 PM
I´m a Programer from TopSide, Brasil.
I´m a beginer of Windev.
>From 2004/june we was work with windev. Now I need to make a
interface with Windev and Crystal Reports 9.
Very good interface. All works fine except dates and times fields.
Its not possible to pass parameter date type to Crystal Reports. Many, many
erros occours.
Does you helpme? How to pass a parameter date to Crystal Reports via Windev
and Crystal Reports Viewer.
Thanks with regards.
[] Pedroso
Posted on October, 21 2004 - 4:05 PM
In a Windev routine,
I have this code at the global window declarations,
===================================
PROCEDURE CrystalOptions(pPar1=Null)
source is string = Origem
//Recebe o relatório por parâmetro a partir do Menu
Origem = pPar1
MyApp is object Automation "CrystalRuntime.APPLICATION.9" // Declara o
objeto Ole Dinamico
MeuRelatorio is object Automation dynamic // Declara o
objeto relatório
MeuParametro is object Automation dynamic // Declara o objeto
Parametro
MyDefs is object Automation dynamic

In a field who´s receive de PPar1 (is a crystal report name .rpt), in the
initialzation of congtrol
I have this code:
=============================================
source = Origem
////hpromp is string
////hnome is string
////htipo is int
////crystalnome is string
//conta is int
Meuparametropassado is object Automation dynamic
MeuRelatorio = MyApp>>OpenReport(source)
MyDefs=MeuRelatorio>>ParameterFields
hcount= MyDefs>>Count
i is int = 0
LOOP
i++
IF i > hcount THEN BREAK
MyDefs>>item(i)
MeuParametro = MeuRelatorio>>ParameterFields>>item(i)
hnome = MeuParametro>>Prompt
hpromp= MeuParametro>>Value
htipo = MeuParametro>>ValueType
crystalnome = MeuParametro>>name
TableAdd(Tabelaparam,hnome+TAB+htipo+TAB+hpromp+TAB+crystalnome)
END
OleCrys>>ReportSource = MeuRelatorio // Acessa o relatório
//OleCrys is a activex control

In a button Print i have this code:
======================
Meuparametropass is object Automation dynamic
Meuparametro1 is object Automation dynamic
l_variavel is string
I is int
LOOP
I++
IF I > hcount THEN BREAK
TableSelectPlus(Tabelaparam,I)
hnome = {"Tabelaparam.Descrição"}
hpromp = {"Tabelaparam.Valor"}
htipo = {"Tabelaparam.Tipo"}
Meuparametro1 = MeuRelatorio>>ParameterFields
Meuparametro1>>item(I)
Meuparametropass=Meuparametro1>>item(I)
SWITCH htipo
CASE 7: // inteiro, longo, short, real
Info(hpromp)
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 8: // decimal, ponto flutuante
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 9: // booleano, lógico
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 10: // data - date
res is boolean
//this code is a test code

ahprompt is composed of
ano is int
mes is int
dia is int
hora is int
minuto is int
segudo is int

END
ahprompt.ano = 2001
ahprompt.mes = 1
ahprompt.dia = 1
ahprompt.hora=1
ahprompt.minuto=1
ahprompt.segudo=1

Meuparametropass>>Addcurrentvalue({ahprompt.ano+"/"+ahprompt.mes+"/"+ahpromp
t.dia})
CASE 12: // string, varchar, char
Info(hpromp)
Meuparametropass>>Addcurrentvalue(hpromp)
END
END
Tamanho..Visible = False
//GMove é um grupo que contém os botões de mover
Gmove..Visible = False
// Grupo que contém os controles de tela
Tela..Visible = False
CrystalOptions..MaxHeight = 593
CrystalOptions..MaxWidth = 800
CrystalOptions..Height = CrystalOptions..MaxHeight
CrystalOptions..Width = CrystalOptions..MaxWidth
Maximize(CrystalOptions)

//code to view report
==============
OleCrys..Height = 454
OleCrys..Y = 80
OleCrys..Visible = True
OleCrys>>DisplayToolbar(True) // Mostra a barra de Ferramentas
OleCrys>>EnableCloseButton(True) // Habilita o botão Fechar
OleCrys>>Zoom(100) // Zoom de 100 %
OleCrys>>DisplayBorder(True) // Opcional para mostrar bordas
OleCrys>>EnableExportButton(True) // Habilita a exportação dos
Relatórios
OleCrys>>EnableDrillDown(True) // Habilita DrillDown
OleCrys>>EnableSearchControl(True) // Habilita botão de pesquisa
OleCrys>>EnableSearchExpertButton(True) // Assistente de Busca
OleCrys>>EnableSelectExpertButton(True) // Seleção esperta
OleCrys>>ViewReport // Visualiza relatório


so....
CrystalOptions is the name of my window to display crystal report file
OleCrys is my object crystal report viewer
Int this code I receive the error
======================
Error in Click on Button3 process, line 42.
'Addcurrentvalue' Automation method called.
Attempt to invoke <Addcurrentvalue> method or to read <Addcurrentvalue>
property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to invoke <Addcurrentvalue> method. Error returned by
Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to read <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'
Attempt to write <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'


**********************************************

Technical Information

Project : MainMenu

Dump error of module <WD80VM.DLL> <8.00Jvc>.

- WL Call:
Processing <CrystalOptions.Button3>, line <42>, thread <0>

- Level: fatal error (EL_FATAL)

- Error Code: 2205

- WD55 Error Code: 0

- No system error code

- No system error message

- What happened?
'Addcurrentvalue' Automation method called.
Attempt to invoke <Addcurrentvalue> method or to read <Addcurrentvalue>
property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to invoke <Addcurrentvalue> method. Error returned by
Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to read <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'
Attempt to write <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'

- No debug information

- Attached Information:
EIT_DATEHEURE : 21/10/2004 14:04:14
EIT_PILEWL :
Click on Button3 (CrystalOptions.Button3), ligne 42

- Identifier in .err: 130001


I hope you helpme and part of my code help another developers.

Thanks wit regards.

"Raimund Schuldhaus" <rschuldhaus@invitec.com> escreveu na mensagem
news:VA.00000020.01b2e496@invitec.com...

Hello Pedroso,

what kind of errors? How do you pass date/time variables?

regards

Raimund

In article <41769fcd@news.pcsoft.fr>, Pedroso wrote:
I´m a Programer from TopSide, Brasil.
I´m a beginer of Windev.
From 2004/june we was work with windev. Now I need to make a
interface with Windev and Crystal Reports 9.

Very good interface. All works fine except dates and times fields.
Its not possible to pass parameter date type to Crystal Reports. Many,

many
erros occours.
Does you helpme? How to pass a parameter date to Crystal Reports via

Windev
and Crystal Reports Viewer.
Thanks with regards.
[] Pedroso


Posted on October, 21 2004 - 6:16 PM
Hello Pedroso,

what kind of errors? How do you pass date/time variables?

regards

Raimund

In article <41769fcd@news.pcsoft.fr>, Pedroso wrote:
I´m a Programer from TopSide, Brasil.
I´m a beginer of Windev.
From 2004/june we was work with windev. Now I need to make a
interface with Windev and Crystal Reports 9.

Very good interface. All works fine except dates and times fields.
Its not possible to pass parameter date type to Crystal Reports. Many, many
erros occours.
Does you helpme? How to pass a parameter date to Crystal Reports via Windev
and Crystal Reports Viewer.
Thanks with regards.
[] Pedroso
Posted on October, 22 2004 - 9:43 AM
Thanks...
I solved this.
Its a very single solution and the interface now works very fine.
[] Pedroso
"Pedroso" <topside@topside.com.br> escreveu na mensagem
news:4177e39c@news.pcsoft.fr...

In a Windev routine,
I have this code at the global window declarations,
===================================
PROCEDURE CrystalOptions(pPar1=Null)
source is string = Origem
//Recebe o relatório por parâmetro a partir do Menu
Origem = pPar1
MyApp is object Automation "CrystalRuntime.APPLICATION.9" // Declara
o
objeto Ole Dinamico
MeuRelatorio is object Automation dynamic // Declara o
objeto relatório
MeuParametro is object Automation dynamic // Declara o
objeto
Parametro
MyDefs is object Automation dynamic

In a field who´s receive de PPar1 (is a crystal report name .rpt), in the
initialzation of congtrol
I have this code:
=============================================
source = Origem
////hpromp is string
////hnome is string
////htipo is int
////crystalnome is string
//conta is int
Meuparametropassado is object Automation dynamic
MeuRelatorio = MyApp>>OpenReport(source)
MyDefs=MeuRelatorio>>ParameterFields
hcount= MyDefs>>Count
i is int = 0
LOOP
i++
IF i > hcount THEN BREAK
MyDefs>>item(i)
MeuParametro = MeuRelatorio>>ParameterFields>>item(i)
hnome = MeuParametro>>Prompt
hpromp= MeuParametro>>Value
htipo = MeuParametro>>ValueType
crystalnome = MeuParametro>>name
TableAdd(Tabelaparam,hnome+TAB+htipo+TAB+hpromp+TAB+crystalnome)
END
OleCrys>>ReportSource = MeuRelatorio // Acessa o relatório
//OleCrys is a activex control

In a button Print i have this code:
======================
Meuparametropass is object Automation dynamic
Meuparametro1 is object Automation dynamic
l_variavel is string
I is int
LOOP
I++
IF I > hcount THEN BREAK
TableSelectPlus(Tabelaparam,I)
hnome = {"Tabelaparam.Descrição"}
hpromp = {"Tabelaparam.Valor"}
htipo = {"Tabelaparam.Tipo"}
Meuparametro1 = MeuRelatorio>>ParameterFields
Meuparametro1>>item(I)
Meuparametropass=Meuparametro1>>item(I)
SWITCH htipo
CASE 7: // inteiro, longo, short, real
Info(hpromp)
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 8: // decimal, ponto flutuante
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 9: // booleano, lógico
Meuparametropass>>Addcurrentvalue(Val(hpromp))
CASE 10: // data - date
res is boolean
//this code is a test code

ahprompt is composed of
ano is int
mes is int
dia is int
hora is int
minuto is int
segudo is int

END
ahprompt.ano = 2001
ahprompt.mes = 1
ahprompt.dia = 1
ahprompt.hora=1
ahprompt.minuto=1
ahprompt.segudo=1

Meuparametropass>>Addcurrentvalue({ahprompt.ano+"/"+ahprompt.mes+"/"+ahpromp
t.dia})
CASE 12: // string, varchar, char
Info(hpromp)
Meuparametropass>>Addcurrentvalue(hpromp)
END
END
Tamanho..Visible = False
//GMove é um grupo que contém os botões de mover
Gmove..Visible = False
// Grupo que contém os controles de tela
Tela..Visible = False
CrystalOptions..MaxHeight = 593
CrystalOptions..MaxWidth = 800
CrystalOptions..Height = CrystalOptions..MaxHeight
CrystalOptions..Width = CrystalOptions..MaxWidth
Maximize(CrystalOptions)

//code to view report
==============
OleCrys..Height = 454
OleCrys..Y = 80
OleCrys..Visible = True
OleCrys>>DisplayToolbar(True) // Mostra a barra de
Ferramentas
OleCrys>>EnableCloseButton(True) // Habilita o botão Fechar
OleCrys>>Zoom(100) // Zoom de 100 %
OleCrys>>DisplayBorder(True) // Opcional para mostrar bordas
OleCrys>>EnableExportButton(True) // Habilita a exportação dos
Relatórios
OleCrys>>EnableDrillDown(True) // Habilita DrillDown
OleCrys>>EnableSearchControl(True) // Habilita botão de pesquisa
OleCrys>>EnableSearchExpertButton(True) // Assistente de Busca
OleCrys>>EnableSelectExpertButton(True) // Seleção esperta
OleCrys>>ViewReport // Visualiza relatório


so....
CrystalOptions is the name of my window to display crystal report file
OleCrys is my object crystal report viewer
Int this code I receive the error
======================
Error in Click on Button3 process, line 42.
'Addcurrentvalue' Automation method called.
Attempt to invoke <Addcurrentvalue> method or to read <Addcurrentvalue>
property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to invoke <Addcurrentvalue> method. Error returned by
Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to read <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'
Attempt to write <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'


**********************************************

Technical Information

Project : MainMenu

Dump error of module <WD80VM.DLL> <8.00Jvc>.

- WL Call:
Processing <CrystalOptions.Button3>, line <42>, thread <0>

- Level: fatal error (EL_FATAL)

- Error Code: 2205

- WD55 Error Code: 0

- No system error code

- No system error message

- What happened?
'Addcurrentvalue' Automation method called.
Attempt to invoke <Addcurrentvalue> method or to read <Addcurrentvalue>
property. Error returned by Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to invoke <Addcurrentvalue> method. Error returned by
Automation/ActiveX object:
'Erreur 80020005, Type incorrect pour le paramètre -1238535 : '
Attempt to read <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'
Attempt to write <Addcurrentvalue> property. Error returned by
Automation/ActiveX object:
'Erreur 80020003, Le membre demandé n'existe pas'

- No debug information

- Attached Information:
EIT_DATEHEURE : 21/10/2004 14:04:14
EIT_PILEWL :
Click on Button3 (CrystalOptions.Button3), ligne 42

- Identifier in .err: 130001


I hope you helpme and part of my code help another developers.

Thanks wit regards.

"Raimund Schuldhaus" <rschuldhaus@invitec.com> escreveu na mensagem
news:VA.00000020.01b2e496@invitec.com...

Hello Pedroso,

what kind of errors? How do you pass date/time variables?

regards

Raimund

In article <41769fcd@news.pcsoft.fr>, Pedroso wrote:
I´m a Programer from TopSide, Brasil.
I´m a beginer of Windev.
From 2004/june we was work with windev. Now I need to make a
interface with Windev and Crystal Reports 9.

Very good interface. All works fine except dates and times fields.
Its not possible to pass parameter date type to Crystal Reports. Many,
many

erros occours.
Does you helpme? How to pass a parameter date to Crystal Reports via
Windev

and Crystal Reports Viewer.
Thanks with regards.
[] Pedroso