|
| Re: Passing variables to Crystal Report Viewer Control 9 from dBASE PLUS 2.6.1.3 |
 |
Tue, 17 Jul 2007 14:25:04 -070 |
You can make parameters in Crystal that will work without any dBASE code if
you like?
The dialog box will come up when the report runs and when you try to
refresh.
OR
You can use the approach I use which does not involve parameter fields, it
is a one of two options and or both together:
building a string that is passed to Crystal's selectionformula and or
creating a flat file and telling Crystal to utilize the temp table in place
of the original.
You can get allot of help from a class in the Binaries group called
rep32.cc, it has samples in the header of how to do these things.
Greg Hill
"Peter Vabulis" <vabbe@bredband.net> wrote in message
news:YS71BaKyHHA.1756@news-server...
> Hi!
> Im updating an application from dB2K 0.4 to dBASE PLUS 2.6 and Crystal
> Reports 7 to Crystal Reports 9 and have ran in som difficulties in passing
> variables to a report.
>
> I modified CPRINT.WFM found on www.maplesoft.net to use Crystal Report
> Viewer Control 9 (p2.wfm as attched file) and have no problems in opening
> a report in it.
>
> Now I just can´t find out how to change the code in the
> form_onOpen-section to change the value on the peremeter field
"Projekt".
>
> I hope some one can help me with it!
>
> regards,
> Peter Vabulis
>
>
>
>
|
| Post Reply
|
| Passing variables to Crystal Report Viewer Control 9 from dBASE PLUS 2.6.1.3 |
 |
Tue, 17 Jul 2007 15:13:07 -040 |
Hi!
Im updating an application from dB2K 0.4 to dBASE PLUS 2.6 and Crystal Reports 7
to Crystal Reports 9 and have ran in som difficulties in passing variables to a
report.
I modified CPRINT.WFM found on www.maplesoft.net to use Crystal Report Viewer
Control 9 (p2.wfm as attched file) and have no problems in opening a report in
it.
Now I just can´t find out how to change the code in the form_onOpen-section to
change the value on the peremeter field "Projekt".
I hope some one can help me with it!
regards,
Peter Vabulis
|
| Post Reply
|
| dBASE - Reports - Passing variables to Crystal Report 9-11 from dBASE PLUS - Re: |
 |
Mon, 23 Jul 2007 17:42:49 +010 |
Solution:
name dBase var./par. = name Crw par.
********************************************************************************
* ...
* transferencia de valores de variaveis para parametros do crw
* disables parameter prompting so the user won't be prompted for a value
_app.hReport.EnableParameterPrompting = False
* ciclo de transferencia de valores de variaveis com os mesmos nomes para
parametros do crw
wsetonerror_crw=SET("ON ERROR")
ON ERROR ??
*
wvariavelant_crw="zzz"
wvariavel_crw=""
wnitem_crw=1 && nº de itens
wnerro_crw=0 && nº de erros (parâmetros não definidos no dBase,
parâmetros não existentes no report,...)
DO WHILE wnitem_crw<300.AND.; && wnitem_crw<300 é um limite para o
número de parâmetros
wnerro_crw<6 && wnerro_crw<6 é um limite para o
número de erros ...
*
wvariavel_crw=_app.hReport.ParameterFields.Item(wnitem_crw).ParameterFieldName()
&& - > wmregiarre
*
IF TYPE(wvariavel_crw)<>"U" && parâmetro/variável está
definida no dBase
*
IF .NOT.EMPTY(wvariavel_crw).AND.wvariavel_crw<>wvariavelant_crw
&& nome do parâmetro/variável não em branco
*
wvalor_crw=&wvariavel_crw
* no caso de tipo data, é necessario converter para ch senão não
passa...(não se sabe porquê (2006-05-23))
IF TYPE(wvariavel_crw)="D"
wvalor_crw=DTOC(wvalor_crw)
ENDIF
*
_app.hReport.ParameterFields.Item(wnitem_crw).AddCurrentValue(wvalor_crw)
&& ex:_app.hReport.ParameterFields.Item(1).AddCurrentValue(3)
*
ELSE
*
wnerro_crw=wnerro_crw+1
*
ENDIF
*
ELSE
*
wnerro_crw=wnerro_crw+1
*
ENDIF
*
wvariavelant_crw=wvariavel_crw
*
wnitem_crw=wnitem_crw+1
*
ENDDO
*
ON ERROR &wsetonerror_crw
* ...
********************************************************************************
"Peter Vabulis" <vabbe@bredband.net> escreveu na mensagem
news:YS71BaKyHHA.1756@news-server...
> Hi!
> Im updating an application from dB2K 0.4 to dBASE PLUS 2.6 and Crystal
Reports 7 to Crystal Reports 9 and have ran in som difficulties in passing
variables to a report.
>
> I modified CPRINT.WFM found on www.maplesoft.net to use Crystal Report
Viewer Control 9 (p2.wfm as attched file) and have no problems in opening a
report in it.
>
> Now I just can´t find out how to change the code in the form_onOpen-section
to change the value on the peremeter field "Projekt".
>
> I hope some one can help me with it!
>
> regards,
> Peter Vabulis
>
>
>
> |
| Post Reply
|
|
|
|
|
|
|
|
|
|