PDA

View Full Version : Passing Values to Parameters



Garret Mott
11-Feb-2006, 10:57 AM
Hi All -

OK, being familiar with proving myself an idiot, I thought I'd try to do it
again, so here goes:

I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate. I
want to pass values from VDF to the report parameters (rather than use
Crystal's parameter selection screen). I searched help (not very helpful),
Wasp (thanks again, Sture) & learned enough from threads to get me
frustrated.

Here's the code I'm using. What am I missing?

Procedure OnInitializeReport
String sSelection
Integer iParams
Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate

Get nParams to iParams //<----shows as zero!!!

Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate //Shows
the date just fine (from the wizard after all)
Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate //this
too

Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
"Invalid Parameter Number"
Set NthParam 1 to dToInvoiceInvoiceDate //Ditto

TIA

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

Garret Mott
12-Feb-2006, 11:34 AM
Hi again -

I've tried a different approach & (surprisingly enough..) it gives different
results...

Being unable to set Parameters, I changed things to use Formulas. These
I've been able to set just fine (especially once I added the code to change
the dates to Crystal dates;-).

One thing I didn't mention before is that the report uses 2 subreports.

The outer report shows the formulas just fine. I've reset the subreport
links to the formulas (instead of the parameters) & now the subreports won't
display.

When I used parameters they showed just fine.
I've set the formulas to have default values & when in CR & previewing, if I
double-click on the subreport it shows data based on the formula default
values. This implies (to my little brain) that the link between the
subreport & the formulas is OK.

So - now the question is: why do the subreports now act kinda like "On
Demand" subreports? No, the OnDemand checkbox is not checked.

Any thoughts?

TIA

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
> Hi All -
>
> OK, being familiar with proving myself an idiot, I thought I'd try to do
> it again, so here goes:
>
> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate. I
> want to pass values from VDF to the report parameters (rather than use
> Crystal's parameter selection screen). I searched help (not very
> helpful), Wasp (thanks again, Sture) & learned enough from threads to get
> me frustrated.
>
> Here's the code I'm using. What am I missing?
>
> Procedure OnInitializeReport
> String sSelection
> Integer iParams
> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>
> Get nParams to iParams //<----shows as zero!!!
>
> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate //Shows
> the date just fine (from the wizard after all)
> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate //this
> too
>
> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
> "Invalid Parameter Number"
> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>
> TIA
>
> Garret Mott
>
> Auto-Mate Software www.automatesoftware.com
> Northeast DataFlex Consortium www.nedataflex.com
>
>

Garret Mott
15-Feb-2006, 03:21 PM
OK - so no one uses parameters? Is there a reason? Maybe it's just that
VDF can't? CR's parameter entry is so clunky & limited compared to what I
can do in VDF (Setting dates to (dToday-7), etc.)....

Or - maybe no one wants to come out & play? <g>

One thing I forgot to mention before is that this is CR10 with VDF11.0

Thanks,

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
> Hi All -
>
> OK, being familiar with proving myself an idiot, I thought I'd try to do
> it again, so here goes:
>
> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate. I
> want to pass values from VDF to the report parameters (rather than use
> Crystal's parameter selection screen). I searched help (not very
> helpful), Wasp (thanks again, Sture) & learned enough from threads to get
> me frustrated.
>
> Here's the code I'm using. What am I missing?
>
> Procedure OnInitializeReport
> String sSelection
> Integer iParams
> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>
> Get nParams to iParams //<----shows as zero!!!
>
> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate //Shows
> the date just fine (from the wizard after all)
> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate //this
> too
>
> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
> "Invalid Parameter Number"
> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>
> TIA
>
> Garret Mott
>
> Auto-Mate Software www.automatesoftware.com
> Northeast DataFlex Consortium www.nedataflex.com
>
>

Steven Wong
15-Feb-2006, 08:25 PM
Hi,

Theres a crystal pkg floating around that shows how to do it I think. I
think it's called SASCrystal. The RDC has it built in if you're already
using CR10.

Steve.

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
> OK - so no one uses parameters? Is there a reason? Maybe it's just that
> VDF can't? CR's parameter entry is so clunky & limited compared to what I
> can do in VDF (Setting dates to (dToday-7), etc.)....
>
> Or - maybe no one wants to come out & play? <g>
>
> One thing I forgot to mention before is that this is CR10 with VDF11.0
>
> Thanks,
>
> Garret Mott
>
> Auto-Mate Software www.automatesoftware.com
> Northeast DataFlex Consortium www.nedataflex.com
>
> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>> Hi All -
>>
>> OK, being familiar with proving myself an idiot, I thought I'd try to do
>> it again, so here goes:
>>
>> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate. I
>> want to pass values from VDF to the report parameters (rather than use
>> Crystal's parameter selection screen). I searched help (not very
>> helpful), Wasp (thanks again, Sture) & learned enough from threads to get
>> me frustrated.
>>
>> Here's the code I'm using. What am I missing?
>>
>> Procedure OnInitializeReport
>> String sSelection
>> Integer iParams
>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>
>> Get nParams to iParams //<----shows as zero!!!
>>
>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate //Shows
>> the date just fine (from the wizard after all)
>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate //this
>> too
>>
>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>> "Invalid Parameter Number"
>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>
>> TIA
>>
>> Garret Mott
>>
>> Auto-Mate Software www.automatesoftware.com
>> Northeast DataFlex Consortium www.nedataflex.com
>>
>>
>
>

Garret Mott
15-Feb-2006, 10:05 PM
Thanks Steve -

I searched CrystalSAS + some others - and the only place I can find it
mentioned is in DAW's CrystalReport.pkg.

The CR11 help (with VDF 11.1) has all kinds of new properties, etc. that
look as though they deal with it - but that doesn't help me with CR 10 :(

Thanks for the thought -

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

"Steven Wong" <steve@triumph-accounting.com> wrote in message
news:n4YDidpMGHA.2932@dacmail.dataaccess.com...
> Hi,
>
> Theres a crystal pkg floating around that shows how to do it I think. I
> think it's called SASCrystal. The RDC has it built in if you're already
> using CR10.
>
> Steve.
>
> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
> news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
>> OK - so no one uses parameters? Is there a reason? Maybe it's just that
>> VDF can't? CR's parameter entry is so clunky & limited compared to what
>> I
>> can do in VDF (Setting dates to (dToday-7), etc.)....
>>
>> Or - maybe no one wants to come out & play? <g>
>>
>> One thing I forgot to mention before is that this is CR10 with VDF11.0
>>
>> Thanks,
>>
>> Garret Mott
>>
>> Auto-Mate Software www.automatesoftware.com
>> Northeast DataFlex Consortium www.nedataflex.com
>>
>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>>> Hi All -
>>>
>>> OK, being familiar with proving myself an idiot, I thought I'd try to do
>>> it again, so here goes:
>>>
>>> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate. I
>>> want to pass values from VDF to the report parameters (rather than use
>>> Crystal's parameter selection screen). I searched help (not very
>>> helpful), Wasp (thanks again, Sture) & learned enough from threads to
>>> get
>>> me frustrated.
>>>
>>> Here's the code I'm using. What am I missing?
>>>
>>> Procedure OnInitializeReport
>>> String sSelection
>>> Integer iParams
>>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>>
>>> Get nParams to iParams //<----shows as zero!!!
>>>
>>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate //Shows
>>> the date just fine (from the wizard after all)
>>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate
>>> //this
>>> too
>>>
>>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>>> "Invalid Parameter Number"
>>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>>
>>> TIA
>>>
>>> Garret Mott
>>>
>>> Auto-Mate Software www.automatesoftware.com
>>> Northeast DataFlex Consortium www.nedataflex.com
>>>
>>>
>>
>>
>
>

Steven Wong
16-Feb-2006, 08:25 PM
I don't know if you're using the RDC or not but that is well documented in
the VDF help. For the CRPE32.dll engine, this is what we use:

#REPLACE PE_PF_REPORT_NAME_LEN 128
#REPLACE PE_PF_NAME_LEN 256
#REPLACE PE_PF_PROMPT_LEN 256
#REPLACE PE_PF_VALUE_LEN 256
#REPLACE PE_PF_EDITMASK_LEN 256
#REPLACE PE_PF_NUMBER 0
#REPLACE PE_PF_CURRENCY 1
#REPLACE PE_PF_BOOLEAN 2
#REPLACE PE_PF_DATE 3
#REPLACE PE_PF_STRING 4

// Used by PESetNthParameterField
Type PEParameterFieldInfo
Field PEParameterFieldInfo.StructSize As Word
Field PEParameterFieldInfo.ValueType As Word
Field PEParameterFieldInfo.DefaultValueSet As Word
Field PEParameterFieldInfo.CurrentValueSet As Word
Field PEParameterFieldInfo.Name As Char PE_PF_NAME_LEN
Field PEParameterFieldInfo.Prompt As Char PE_PF_PROMPT_LEN
Field PEParameterFieldInfo.DefaultValue As Char PE_PF_VALUE_LEN
Field PEParameterFieldInfo.CurrentValue As Char PE_PF_VALUE_LEN
Field PEParameterFieldInfo.ReportName As Char
PE_PF_REPORT_NAME_LEN
Field PEParameterFieldInfo.NeedsCurrentValue As Word
Field PEParameterFieldInfo.isLimited As Word
Field PEParameterFieldInfo.MinSize As Char 8
Field PEParameterFieldInfo.MaxSize As Char 8
Field PEParameterFieldInfo.EditMask As Char PE_PF_EDITMASK_LEN
Field PEParameterFieldInfo.isHidden As Word
End_Type // PEParameterFieldInfo

External_Function32 PESetNthParameterField "PESetNthParameterField"
CRPE32.DLL ;
Integer printJob Integer parameterN Pointer parameterInfo Returns Integer

External_Function32 PEGetNthParameterField "PEGetNthParameterField"
CRPE32.DLL ;
Integer printJob Integer parameterN Pointer parameterInfo Returns Integer

Procedure Set NthParameterField Integer iParameterN Integer iType
String sValue //[01][02]>
String sPEParameterFieldInfo sBuffer sParameterN
Pointer pPEParameterFieldInfo
Integer iPrintJob iResult

Get PrintJob To iPrintJob
FillType PEParameterFieldInfo With 0 To sPEParameterFieldInfo
GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
Put PEParameterFieldInfo_Size To sPEParameterFieldInfo At
PEParameterFieldInfo.StructSize
Move
(PEGetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
iResult //[05]

Put iType To sPEParameterFieldInfo At
PEParameterFieldInfo.ValueType
Put 1 To sPEParameterFieldInfo At
PEParameterFieldInfo.DefaultValueSet
Put 1 To sPEParameterFieldInfo At
PEParameterFieldInfo.CurrentValueSet

Case Begin
Case (iType = PE_PF_NUMBER)
Put_String (ConvertStringToDouble(sValue)) To
sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
Case Break
Case (iType = PE_PF_CURRENCY)
Put_String (ConvertStringToDouble(sValue)) To
sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
Case Break
Case (iType = PE_PF_BOOLEAN)
Put (Integer(sValue)) To sPEParameterFieldInfo At
PEParameterFieldInfo.CurrentValue
Case Break
Case (iType = PE_PF_DATE)
// you have to do something special for dates
Case Break
Case (iType = PE_PF_STRING)
Put_String (sValue+Character(0)) To
sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
Case Break
Case End

GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
Move
(PESetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
iResult
Send HandlePossibleError
End_Procedure // Set NthParameterField

The ParameterFieldInfo structure can change between versions and can cause
problems if it is incorrect so you might have to check that.

Steve.

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:YP%23KVXqMGHA.3548@dacmail.dataaccess.com...
> Thanks Steve -
>
> I searched CrystalSAS + some others - and the only place I can find it
> mentioned is in DAW's CrystalReport.pkg.
>
> The CR11 help (with VDF 11.1) has all kinds of new properties, etc. that
> look as though they deal with it - but that doesn't help me with CR 10 :(
>
> Thanks for the thought -
>
> Garret Mott
>
> Auto-Mate Software www.automatesoftware.com
> Northeast DataFlex Consortium www.nedataflex.com
>
> "Steven Wong" <steve@triumph-accounting.com> wrote in message
> news:n4YDidpMGHA.2932@dacmail.dataaccess.com...
>> Hi,
>>
>> Theres a crystal pkg floating around that shows how to do it I think. I
>> think it's called SASCrystal. The RDC has it built in if you're already
>> using CR10.
>>
>> Steve.
>>
>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>> news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
>>> OK - so no one uses parameters? Is there a reason? Maybe it's just
>>> that
>>> VDF can't? CR's parameter entry is so clunky & limited compared to what
>>> I
>>> can do in VDF (Setting dates to (dToday-7), etc.)....
>>>
>>> Or - maybe no one wants to come out & play? <g>
>>>
>>> One thing I forgot to mention before is that this is CR10 with VDF11.0
>>>
>>> Thanks,
>>>
>>> Garret Mott
>>>
>>> Auto-Mate Software www.automatesoftware.com
>>> Northeast DataFlex Consortium www.nedataflex.com
>>>
>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>>> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>>>> Hi All -
>>>>
>>>> OK, being familiar with proving myself an idiot, I thought I'd try to
>>>> do
>>>> it again, so here goes:
>>>>
>>>> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate.
>>>> I
>>>> want to pass values from VDF to the report parameters (rather than use
>>>> Crystal's parameter selection screen). I searched help (not very
>>>> helpful), Wasp (thanks again, Sture) & learned enough from threads to
>>>> get
>>>> me frustrated.
>>>>
>>>> Here's the code I'm using. What am I missing?
>>>>
>>>> Procedure OnInitializeReport
>>>> String sSelection
>>>> Integer iParams
>>>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>>>
>>>> Get nParams to iParams //<----shows as zero!!!
>>>>
>>>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate
>>>> //Shows
>>>> the date just fine (from the wizard after all)
>>>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate
>>>> //this
>>>> too
>>>>
>>>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>>>> "Invalid Parameter Number"
>>>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>>>
>>>> TIA
>>>>
>>>> Garret Mott
>>>>
>>>> Auto-Mate Software www.automatesoftware.com
>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Garret Mott
16-Feb-2006, 09:28 PM
Hi Steve -

Thanks for this.

However...

re: Case (iType = PE_PF_DATE)
// you have to do something special for dates

Of course, being the difficult soul I am, I need to set dates. Any ideas as
to what has to be done?

Regards,

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

"Steven Wong" <steve@triumph-accounting.com> wrote in message
news:MK7tMC2MGHA.5976@dacmail.dataaccess.com...
>I don't know if you're using the RDC or not but that is well documented in
> the VDF help. For the CRPE32.dll engine, this is what we use:
>
> #REPLACE PE_PF_REPORT_NAME_LEN 128
> #REPLACE PE_PF_NAME_LEN 256
> #REPLACE PE_PF_PROMPT_LEN 256
> #REPLACE PE_PF_VALUE_LEN 256
> #REPLACE PE_PF_EDITMASK_LEN 256
> #REPLACE PE_PF_NUMBER 0
> #REPLACE PE_PF_CURRENCY 1
> #REPLACE PE_PF_BOOLEAN 2
> #REPLACE PE_PF_DATE 3
> #REPLACE PE_PF_STRING 4
>
> // Used by PESetNthParameterField
> Type PEParameterFieldInfo
> Field PEParameterFieldInfo.StructSize As Word
> Field PEParameterFieldInfo.ValueType As Word
> Field PEParameterFieldInfo.DefaultValueSet As Word
> Field PEParameterFieldInfo.CurrentValueSet As Word
> Field PEParameterFieldInfo.Name As Char PE_PF_NAME_LEN
> Field PEParameterFieldInfo.Prompt As Char PE_PF_PROMPT_LEN
> Field PEParameterFieldInfo.DefaultValue As Char PE_PF_VALUE_LEN
> Field PEParameterFieldInfo.CurrentValue As Char PE_PF_VALUE_LEN
> Field PEParameterFieldInfo.ReportName As Char
> PE_PF_REPORT_NAME_LEN
> Field PEParameterFieldInfo.NeedsCurrentValue As Word
> Field PEParameterFieldInfo.isLimited As Word
> Field PEParameterFieldInfo.MinSize As Char 8
> Field PEParameterFieldInfo.MaxSize As Char 8
> Field PEParameterFieldInfo.EditMask As Char PE_PF_EDITMASK_LEN
> Field PEParameterFieldInfo.isHidden As Word
> End_Type // PEParameterFieldInfo
>
> External_Function32 PESetNthParameterField "PESetNthParameterField"
> CRPE32.DLL ;
> Integer printJob Integer parameterN Pointer parameterInfo Returns Integer
>
> External_Function32 PEGetNthParameterField "PEGetNthParameterField"
> CRPE32.DLL ;
> Integer printJob Integer parameterN Pointer parameterInfo Returns Integer
>
> Procedure Set NthParameterField Integer iParameterN Integer iType
> String sValue //[01][02]>
> String sPEParameterFieldInfo sBuffer sParameterN
> Pointer pPEParameterFieldInfo
> Integer iPrintJob iResult
>
> Get PrintJob To iPrintJob
> FillType PEParameterFieldInfo With 0 To sPEParameterFieldInfo
> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
> Put PEParameterFieldInfo_Size To sPEParameterFieldInfo At
> PEParameterFieldInfo.StructSize
> Move
> (PEGetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
> iResult //[05]
>
> Put iType To sPEParameterFieldInfo At
> PEParameterFieldInfo.ValueType
> Put 1 To sPEParameterFieldInfo At
> PEParameterFieldInfo.DefaultValueSet
> Put 1 To sPEParameterFieldInfo At
> PEParameterFieldInfo.CurrentValueSet
>
> Case Begin
> Case (iType = PE_PF_NUMBER)
> Put_String (ConvertStringToDouble(sValue)) To
> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
> Case Break
> Case (iType = PE_PF_CURRENCY)
> Put_String (ConvertStringToDouble(sValue)) To
> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
> Case Break
> Case (iType = PE_PF_BOOLEAN)
> Put (Integer(sValue)) To sPEParameterFieldInfo At
> PEParameterFieldInfo.CurrentValue
> Case Break
> Case (iType = PE_PF_DATE)
> // you have to do something special for dates
> Case Break
> Case (iType = PE_PF_STRING)
> Put_String (sValue+Character(0)) To
> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
> Case Break
> Case End
>
> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
> Move
> (PESetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
> iResult
> Send HandlePossibleError
> End_Procedure // Set NthParameterField
>
> The ParameterFieldInfo structure can change between versions and can cause
> problems if it is incorrect so you might have to check that.
>
> Steve.
>
> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
> news:YP%23KVXqMGHA.3548@dacmail.dataaccess.com...
>> Thanks Steve -
>>
>> I searched CrystalSAS + some others - and the only place I can find it
>> mentioned is in DAW's CrystalReport.pkg.
>>
>> The CR11 help (with VDF 11.1) has all kinds of new properties, etc. that
>> look as though they deal with it - but that doesn't help me with CR 10 :(
>>
>> Thanks for the thought -
>>
>> Garret Mott
>>
>> Auto-Mate Software www.automatesoftware.com
>> Northeast DataFlex Consortium www.nedataflex.com
>>
>> "Steven Wong" <steve@triumph-accounting.com> wrote in message
>> news:n4YDidpMGHA.2932@dacmail.dataaccess.com...
>>> Hi,
>>>
>>> Theres a crystal pkg floating around that shows how to do it I think. I
>>> think it's called SASCrystal. The RDC has it built in if you're already
>>> using CR10.
>>>
>>> Steve.
>>>
>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>>> news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
>>>> OK - so no one uses parameters? Is there a reason? Maybe it's just
>>>> that
>>>> VDF can't? CR's parameter entry is so clunky & limited compared to
>>>> what
>>>> I
>>>> can do in VDF (Setting dates to (dToday-7), etc.)....
>>>>
>>>> Or - maybe no one wants to come out & play? <g>
>>>>
>>>> One thing I forgot to mention before is that this is CR10 with VDF11.0
>>>>
>>>> Thanks,
>>>>
>>>> Garret Mott
>>>>
>>>> Auto-Mate Software www.automatesoftware.com
>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>
>>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>>>> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>>>>> Hi All -
>>>>>
>>>>> OK, being familiar with proving myself an idiot, I thought I'd try to
>>>>> do
>>>>> it again, so here goes:
>>>>>
>>>>> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate.
>>>>> I
>>>>> want to pass values from VDF to the report parameters (rather than use
>>>>> Crystal's parameter selection screen). I searched help (not very
>>>>> helpful), Wasp (thanks again, Sture) & learned enough from threads to
>>>>> get
>>>>> me frustrated.
>>>>>
>>>>> Here's the code I'm using. What am I missing?
>>>>>
>>>>> Procedure OnInitializeReport
>>>>> String sSelection
>>>>> Integer iParams
>>>>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>>>>
>>>>> Get nParams to iParams //<----shows as zero!!!
>>>>>
>>>>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate
>>>>> //Shows
>>>>> the date just fine (from the wizard after all)
>>>>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate
>>>>> //this
>>>>> too
>>>>>
>>>>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>>>>> "Invalid Parameter Number"
>>>>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>>>>
>>>>> TIA
>>>>>
>>>>> Garret Mott
>>>>>
>>>>> Auto-Mate Software www.automatesoftware.com
>>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Steven Wong
17-Feb-2006, 12:01 AM
OK, I confess, I do have a soln for this. However it's kludgely and I wasn't
keen on sharing.

// VDFToCrystalDate
// Convert VDF Date string to a string representing the same date in
crystal
// The return value is meant to be used in Set NthParameterField
Function VDFToCrystalDate String sValue Returns String
//[11]>
Integer iInteger iValue iLoop iOffset iYear iMonth iResult
Date dValue dMinLimit dMaxLimit
String sBuffer

// Define valid date boundary
Move 693975 To dMinLimit // 1/1/1900
Move 767024 To dMaxLimit // 31/12/2099

// Dates outside dMinLimit & dMaxLimit seem to be unstable, so
we enforce a bound
Move sValue To dValue
If (dValue<dMinLimit) Move dMinLimit To dValue
If (dValue>dMaxLimit) Move dMaxLimit To dValue

//Convert VDF date string to an integer value
Move dValue To iValue

// Calculate an offset to adjust for leap-year differences
between a VDF date and a Crystal date
// This calculation is only valid between 1/1/1601 and
31/12/2399
Move (DateGetYear(dValue)) To iYear
Move (DateGetMonth(dValue)) To iMonth

Move (iYear-2000) To iYear

If (iYear>0) Begin
Move (iYear/100) To iOffset
Move (iOffset-(iYear/400)) To iOffset
End
Else Begin
Move (iYear/100) To iOffset
If (iMonth>2 AND iOffset) Increment iOffset
End

// 1721044 is the integer difference between a VDF date and a
Crystal date representing the same day
// VDF uses a smaller value to represent the same day
// We adjust the VDF date by that number to create a Crystal
Date and adjust for leap-years

Move (iValue+1721044-iOffset) To iValue

// Build the 3-byte string that is used by Set NthParameterField
Move (iValue IAND $00FF0000) To iResult
Move (iResult/65536) To iResult
Move (Character(iResult)+sBuffer) To sBuffer
Move (iValue IAND $0000FF00) To iResult
Move (iResult/256) To iResult
Move (Character(iResult)+sBuffer) To sBuffer
Move (iValue IAND $000000FF) To iResult
Move (Character(iResult)+sBuffer) To sBuffer

Function_Return sBuffer
End_Function //VDFToCrystalDate

Case (iType = PE_PF_DATE)
// The structure expects a date in 3 byte format similar
to a vdf date
// Put_String (Date(sValue)) fails because it puts
"dd/mm/yyyy" into the structure
// Put (Integer(sValue)) also doesn't work because it
only puts the first byte into the structure
// VDFToCrystal string will convert a VDF date into a 3
byte un-terminated string which will work
Get VDFToCrystalDate sValue To sBuffer
Put_String sBuffer To sPEParameterFieldInfo At
PEParameterFieldInfo.CurrentValue
Case Break

If you find a better way...

Steve.

"Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
news:98SBhn2MGHA.4760@dacmail.dataaccess.com...
> Hi Steve -
>
> Thanks for this.
>
> However...
>
> re: Case (iType = PE_PF_DATE)
> // you have to do something special for dates
>
> Of course, being the difficult soul I am, I need to set dates. Any ideas
> as
> to what has to be done?
>
> Regards,
>
> Garret Mott
>
> Auto-Mate Software www.automatesoftware.com
> Northeast DataFlex Consortium www.nedataflex.com
>
> "Steven Wong" <steve@triumph-accounting.com> wrote in message
> news:MK7tMC2MGHA.5976@dacmail.dataaccess.com...
>>I don't know if you're using the RDC or not but that is well documented in
>> the VDF help. For the CRPE32.dll engine, this is what we use:
>>
>> #REPLACE PE_PF_REPORT_NAME_LEN 128
>> #REPLACE PE_PF_NAME_LEN 256
>> #REPLACE PE_PF_PROMPT_LEN 256
>> #REPLACE PE_PF_VALUE_LEN 256
>> #REPLACE PE_PF_EDITMASK_LEN 256
>> #REPLACE PE_PF_NUMBER 0
>> #REPLACE PE_PF_CURRENCY 1
>> #REPLACE PE_PF_BOOLEAN 2
>> #REPLACE PE_PF_DATE 3
>> #REPLACE PE_PF_STRING 4
>>
>> // Used by PESetNthParameterField
>> Type PEParameterFieldInfo
>> Field PEParameterFieldInfo.StructSize As Word
>> Field PEParameterFieldInfo.ValueType As Word
>> Field PEParameterFieldInfo.DefaultValueSet As Word
>> Field PEParameterFieldInfo.CurrentValueSet As Word
>> Field PEParameterFieldInfo.Name As Char PE_PF_NAME_LEN
>> Field PEParameterFieldInfo.Prompt As Char PE_PF_PROMPT_LEN
>> Field PEParameterFieldInfo.DefaultValue As Char PE_PF_VALUE_LEN
>> Field PEParameterFieldInfo.CurrentValue As Char PE_PF_VALUE_LEN
>> Field PEParameterFieldInfo.ReportName As Char
>> PE_PF_REPORT_NAME_LEN
>> Field PEParameterFieldInfo.NeedsCurrentValue As Word
>> Field PEParameterFieldInfo.isLimited As Word
>> Field PEParameterFieldInfo.MinSize As Char 8
>> Field PEParameterFieldInfo.MaxSize As Char 8
>> Field PEParameterFieldInfo.EditMask As Char PE_PF_EDITMASK_LEN
>> Field PEParameterFieldInfo.isHidden As Word
>> End_Type // PEParameterFieldInfo
>>
>> External_Function32 PESetNthParameterField "PESetNthParameterField"
>> CRPE32.DLL ;
>> Integer printJob Integer parameterN Pointer parameterInfo Returns
>> Integer
>>
>> External_Function32 PEGetNthParameterField "PEGetNthParameterField"
>> CRPE32.DLL ;
>> Integer printJob Integer parameterN Pointer parameterInfo Returns
>> Integer
>>
>> Procedure Set NthParameterField Integer iParameterN Integer iType
>> String sValue //[01][02]>
>> String sPEParameterFieldInfo sBuffer sParameterN
>> Pointer pPEParameterFieldInfo
>> Integer iPrintJob iResult
>>
>> Get PrintJob To iPrintJob
>> FillType PEParameterFieldInfo With 0 To sPEParameterFieldInfo
>> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
>> Put PEParameterFieldInfo_Size To sPEParameterFieldInfo At
>> PEParameterFieldInfo.StructSize
>> Move
>> (PEGetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
>> iResult //[05]
>>
>> Put iType To sPEParameterFieldInfo At
>> PEParameterFieldInfo.ValueType
>> Put 1 To sPEParameterFieldInfo At
>> PEParameterFieldInfo.DefaultValueSet
>> Put 1 To sPEParameterFieldInfo At
>> PEParameterFieldInfo.CurrentValueSet
>>
>> Case Begin
>> Case (iType = PE_PF_NUMBER)
>> Put_String (ConvertStringToDouble(sValue)) To
>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>> Case Break
>> Case (iType = PE_PF_CURRENCY)
>> Put_String (ConvertStringToDouble(sValue)) To
>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>> Case Break
>> Case (iType = PE_PF_BOOLEAN)
>> Put (Integer(sValue)) To sPEParameterFieldInfo At
>> PEParameterFieldInfo.CurrentValue
>> Case Break
>> Case (iType = PE_PF_DATE)
>> // you have to do something special for dates
>> Case Break
>> Case (iType = PE_PF_STRING)
>> Put_String (sValue+Character(0)) To
>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>> Case Break
>> Case End
>>
>> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
>> Move
>> (PESetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
>> iResult
>> Send HandlePossibleError
>> End_Procedure // Set NthParameterField
>>
>> The ParameterFieldInfo structure can change between versions and can
>> cause
>> problems if it is incorrect so you might have to check that.
>>
>> Steve.
>>
>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>> news:YP%23KVXqMGHA.3548@dacmail.dataaccess.com...
>>> Thanks Steve -
>>>
>>> I searched CrystalSAS + some others - and the only place I can find it
>>> mentioned is in DAW's CrystalReport.pkg.
>>>
>>> The CR11 help (with VDF 11.1) has all kinds of new properties, etc. that
>>> look as though they deal with it - but that doesn't help me with CR 10
>>> :(
>>>
>>> Thanks for the thought -
>>>
>>> Garret Mott
>>>
>>> Auto-Mate Software www.automatesoftware.com
>>> Northeast DataFlex Consortium www.nedataflex.com
>>>
>>> "Steven Wong" <steve@triumph-accounting.com> wrote in message
>>> news:n4YDidpMGHA.2932@dacmail.dataaccess.com...
>>>> Hi,
>>>>
>>>> Theres a crystal pkg floating around that shows how to do it I think. I
>>>> think it's called SASCrystal. The RDC has it built in if you're already
>>>> using CR10.
>>>>
>>>> Steve.
>>>>
>>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>>>> news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
>>>>> OK - so no one uses parameters? Is there a reason? Maybe it's just
>>>>> that
>>>>> VDF can't? CR's parameter entry is so clunky & limited compared to
>>>>> what
>>>>> I
>>>>> can do in VDF (Setting dates to (dToday-7), etc.)....
>>>>>
>>>>> Or - maybe no one wants to come out & play? <g>
>>>>>
>>>>> One thing I forgot to mention before is that this is CR10 with VDF11.0
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Garret Mott
>>>>>
>>>>> Auto-Mate Software www.automatesoftware.com
>>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>>
>>>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in
>>>>> message
>>>>> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>>>>>> Hi All -
>>>>>>
>>>>>> OK, being familiar with proving myself an idiot, I thought I'd try to
>>>>>> do
>>>>>> it again, so here goes:
>>>>>>
>>>>>> I have a Crystal report that has 2 parameters: ?StartDate & ?EndDate.
>>>>>> I
>>>>>> want to pass values from VDF to the report parameters (rather than
>>>>>> use
>>>>>> Crystal's parameter selection screen). I searched help (not very
>>>>>> helpful), Wasp (thanks again, Sture) & learned enough from threads to
>>>>>> get
>>>>>> me frustrated.
>>>>>>
>>>>>> Here's the code I'm using. What am I missing?
>>>>>>
>>>>>> Procedure OnInitializeReport
>>>>>> String sSelection
>>>>>> Integer iParams
>>>>>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>>>>>
>>>>>> Get nParams to iParams //<----shows as zero!!!
>>>>>>
>>>>>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate
>>>>>> //Shows
>>>>>> the date just fine (from the wizard after all)
>>>>>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate
>>>>>> //this
>>>>>> too
>>>>>>
>>>>>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>>>>>> "Invalid Parameter Number"
>>>>>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>>>>>
>>>>>> TIA
>>>>>>
>>>>>> Garret Mott
>>>>>>
>>>>>> Auto-Mate Software www.automatesoftware.com
>>>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Garret Mott
17-Feb-2006, 12:32 PM
Hi Steve -

I appreciate your sharing & _fully_ understand having code you'd just as
soon not have others see. Hey - I'm embarrassed to show myself some of my
code... Luckily, I've gotten skilled @ programming with my eyes closed <g>.

Obviously a great deal of trial & error (i.e. hard work) went into this.
I'll play with it & see what I come up with.

Thanks again!

Garret Mott

Auto-Mate Software www.automatesoftware.com
Northeast DataFlex Consortium www.nedataflex.com

"Steven Wong" <steve@triumph-accounting.com> wrote in message
news:%2320m663MGHA.540@dacmail.dataaccess.com...
> OK, I confess, I do have a soln for this. However it's kludgely and I
> wasn't
> keen on sharing.
>
> // VDFToCrystalDate
> // Convert VDF Date string to a string representing the same date
> in
> crystal
> // The return value is meant to be used in Set NthParameterField
> Function VDFToCrystalDate String sValue Returns String
> //[11]>
> Integer iInteger iValue iLoop iOffset iYear iMonth iResult
> Date dValue dMinLimit dMaxLimit
> String sBuffer
>
> // Define valid date boundary
> Move 693975 To dMinLimit // 1/1/1900
> Move 767024 To dMaxLimit // 31/12/2099
>
> // Dates outside dMinLimit & dMaxLimit seem to be unstable, so
> we enforce a bound
> Move sValue To dValue
> If (dValue<dMinLimit) Move dMinLimit To dValue
> If (dValue>dMaxLimit) Move dMaxLimit To dValue
>
> //Convert VDF date string to an integer value
> Move dValue To iValue
>
> // Calculate an offset to adjust for leap-year differences
> between a VDF date and a Crystal date
> // This calculation is only valid between 1/1/1601 and
> 31/12/2399
> Move (DateGetYear(dValue)) To iYear
> Move (DateGetMonth(dValue)) To iMonth
>
> Move (iYear-2000) To iYear
>
> If (iYear>0) Begin
> Move (iYear/100) To iOffset
> Move (iOffset-(iYear/400)) To iOffset
> End
> Else Begin
> Move (iYear/100) To iOffset
> If (iMonth>2 AND iOffset) Increment iOffset
> End
>
> // 1721044 is the integer difference between a VDF date and a
> Crystal date representing the same day
> // VDF uses a smaller value to represent the same day
> // We adjust the VDF date by that number to create a Crystal
> Date and adjust for leap-years
>
> Move (iValue+1721044-iOffset) To iValue
>
> // Build the 3-byte string that is used by Set
> NthParameterField
> Move (iValue IAND $00FF0000) To iResult
> Move (iResult/65536) To iResult
> Move (Character(iResult)+sBuffer) To sBuffer
> Move (iValue IAND $0000FF00) To iResult
> Move (iResult/256) To iResult
> Move (Character(iResult)+sBuffer) To sBuffer
> Move (iValue IAND $000000FF) To iResult
> Move (Character(iResult)+sBuffer) To sBuffer
>
> Function_Return sBuffer
> End_Function //VDFToCrystalDate
>
> Case (iType = PE_PF_DATE)
> // The structure expects a date in 3 byte format
> similar
> to a vdf date
> // Put_String (Date(sValue)) fails because it puts
> "dd/mm/yyyy" into the structure
> // Put (Integer(sValue)) also doesn't work because it
> only puts the first byte into the structure
> // VDFToCrystal string will convert a VDF date into a 3
> byte un-terminated string which will work
> Get VDFToCrystalDate sValue To sBuffer
> Put_String sBuffer To sPEParameterFieldInfo At
> PEParameterFieldInfo.CurrentValue
> Case Break
>
> If you find a better way...
>
> Steve.
>
> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
> news:98SBhn2MGHA.4760@dacmail.dataaccess.com...
>> Hi Steve -
>>
>> Thanks for this.
>>
>> However...
>>
>> re: Case (iType = PE_PF_DATE)
>> // you have to do something special for dates
>>
>> Of course, being the difficult soul I am, I need to set dates. Any ideas
>> as
>> to what has to be done?
>>
>> Regards,
>>
>> Garret Mott
>>
>> Auto-Mate Software www.automatesoftware.com
>> Northeast DataFlex Consortium www.nedataflex.com
>>
>> "Steven Wong" <steve@triumph-accounting.com> wrote in message
>> news:MK7tMC2MGHA.5976@dacmail.dataaccess.com...
>>>I don't know if you're using the RDC or not but that is well documented
>>>in
>>> the VDF help. For the CRPE32.dll engine, this is what we use:
>>>
>>> #REPLACE PE_PF_REPORT_NAME_LEN 128
>>> #REPLACE PE_PF_NAME_LEN 256
>>> #REPLACE PE_PF_PROMPT_LEN 256
>>> #REPLACE PE_PF_VALUE_LEN 256
>>> #REPLACE PE_PF_EDITMASK_LEN 256
>>> #REPLACE PE_PF_NUMBER 0
>>> #REPLACE PE_PF_CURRENCY 1
>>> #REPLACE PE_PF_BOOLEAN 2
>>> #REPLACE PE_PF_DATE 3
>>> #REPLACE PE_PF_STRING 4
>>>
>>> // Used by PESetNthParameterField
>>> Type PEParameterFieldInfo
>>> Field PEParameterFieldInfo.StructSize As Word
>>> Field PEParameterFieldInfo.ValueType As Word
>>> Field PEParameterFieldInfo.DefaultValueSet As Word
>>> Field PEParameterFieldInfo.CurrentValueSet As Word
>>> Field PEParameterFieldInfo.Name As Char PE_PF_NAME_LEN
>>> Field PEParameterFieldInfo.Prompt As Char PE_PF_PROMPT_LEN
>>> Field PEParameterFieldInfo.DefaultValue As Char PE_PF_VALUE_LEN
>>> Field PEParameterFieldInfo.CurrentValue As Char PE_PF_VALUE_LEN
>>> Field PEParameterFieldInfo.ReportName As Char
>>> PE_PF_REPORT_NAME_LEN
>>> Field PEParameterFieldInfo.NeedsCurrentValue As Word
>>> Field PEParameterFieldInfo.isLimited As Word
>>> Field PEParameterFieldInfo.MinSize As Char 8
>>> Field PEParameterFieldInfo.MaxSize As Char 8
>>> Field PEParameterFieldInfo.EditMask As Char
>>> PE_PF_EDITMASK_LEN
>>> Field PEParameterFieldInfo.isHidden As Word
>>> End_Type // PEParameterFieldInfo
>>>
>>> External_Function32 PESetNthParameterField "PESetNthParameterField"
>>> CRPE32.DLL ;
>>> Integer printJob Integer parameterN Pointer parameterInfo Returns
>>> Integer
>>>
>>> External_Function32 PEGetNthParameterField "PEGetNthParameterField"
>>> CRPE32.DLL ;
>>> Integer printJob Integer parameterN Pointer parameterInfo Returns
>>> Integer
>>>
>>> Procedure Set NthParameterField Integer iParameterN Integer iType
>>> String sValue //[01][02]>
>>> String sPEParameterFieldInfo sBuffer sParameterN
>>> Pointer pPEParameterFieldInfo
>>> Integer iPrintJob iResult
>>>
>>> Get PrintJob To iPrintJob
>>> FillType PEParameterFieldInfo With 0 To sPEParameterFieldInfo
>>> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
>>> Put PEParameterFieldInfo_Size To sPEParameterFieldInfo At
>>> PEParameterFieldInfo.StructSize
>>> Move
>>> (PEGetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
>>> iResult //[05]
>>>
>>> Put iType To sPEParameterFieldInfo At
>>> PEParameterFieldInfo.ValueType
>>> Put 1 To sPEParameterFieldInfo At
>>> PEParameterFieldInfo.DefaultValueSet
>>> Put 1 To sPEParameterFieldInfo At
>>> PEParameterFieldInfo.CurrentValueSet
>>>
>>> Case Begin
>>> Case (iType = PE_PF_NUMBER)
>>> Put_String (ConvertStringToDouble(sValue)) To
>>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>>> Case Break
>>> Case (iType = PE_PF_CURRENCY)
>>> Put_String (ConvertStringToDouble(sValue)) To
>>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>>> Case Break
>>> Case (iType = PE_PF_BOOLEAN)
>>> Put (Integer(sValue)) To sPEParameterFieldInfo At
>>> PEParameterFieldInfo.CurrentValue
>>> Case Break
>>> Case (iType = PE_PF_DATE)
>>> // you have to do something special for dates
>>> Case Break
>>> Case (iType = PE_PF_STRING)
>>> Put_String (sValue+Character(0)) To
>>> sPEParameterFieldInfo At PEParameterFieldInfo.CurrentValue
>>> Case Break
>>> Case End
>>>
>>> GetAddress Of sPEParameterFieldInfo To pPEParameterFieldInfo
>>> Move
>>> (PESetNthParameterField(iPrintJob,iParameterN,pPEP arameterFieldInfo)) To
>>> iResult
>>> Send HandlePossibleError
>>> End_Procedure // Set NthParameterField
>>>
>>> The ParameterFieldInfo structure can change between versions and can
>>> cause
>>> problems if it is incorrect so you might have to check that.
>>>
>>> Steve.
>>>
>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in message
>>> news:YP%23KVXqMGHA.3548@dacmail.dataaccess.com...
>>>> Thanks Steve -
>>>>
>>>> I searched CrystalSAS + some others - and the only place I can find it
>>>> mentioned is in DAW's CrystalReport.pkg.
>>>>
>>>> The CR11 help (with VDF 11.1) has all kinds of new properties, etc.
>>>> that
>>>> look as though they deal with it - but that doesn't help me with CR 10
>>>> :(
>>>>
>>>> Thanks for the thought -
>>>>
>>>> Garret Mott
>>>>
>>>> Auto-Mate Software www.automatesoftware.com
>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>
>>>> "Steven Wong" <steve@triumph-accounting.com> wrote in message
>>>> news:n4YDidpMGHA.2932@dacmail.dataaccess.com...
>>>>> Hi,
>>>>>
>>>>> Theres a crystal pkg floating around that shows how to do it I think.
>>>>> I
>>>>> think it's called SASCrystal. The RDC has it built in if you're
>>>>> already
>>>>> using CR10.
>>>>>
>>>>> Steve.
>>>>>
>>>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in
>>>>> message
>>>>> news:2m80Z1mMGHA.1280@dacmail.dataaccess.com...
>>>>>> OK - so no one uses parameters? Is there a reason? Maybe it's just
>>>>>> that
>>>>>> VDF can't? CR's parameter entry is so clunky & limited compared to
>>>>>> what
>>>>>> I
>>>>>> can do in VDF (Setting dates to (dToday-7), etc.)....
>>>>>>
>>>>>> Or - maybe no one wants to come out & play? <g>
>>>>>>
>>>>>> One thing I forgot to mention before is that this is CR10 with
>>>>>> VDF11.0
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Garret Mott
>>>>>>
>>>>>> Auto-Mate Software www.automatesoftware.com
>>>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>>>
>>>>>> "Garret Mott" <garret_atsign_automatesoftware_dot_com> wrote in
>>>>>> message
>>>>>> news:lCtuMPyLGHA.1276@dacmail.dataaccess.com...
>>>>>>> Hi All -
>>>>>>>
>>>>>>> OK, being familiar with proving myself an idiot, I thought I'd try
>>>>>>> to
>>>>>>> do
>>>>>>> it again, so here goes:
>>>>>>>
>>>>>>> I have a Crystal report that has 2 parameters: ?StartDate &
>>>>>>> ?EndDate.
>>>>>>> I
>>>>>>> want to pass values from VDF to the report parameters (rather than
>>>>>>> use
>>>>>>> Crystal's parameter selection screen). I searched help (not very
>>>>>>> helpful), Wasp (thanks again, Sture) & learned enough from threads
>>>>>>> to
>>>>>>> get
>>>>>>> me frustrated.
>>>>>>>
>>>>>>> Here's the code I'm using. What am I missing?
>>>>>>>
>>>>>>> Procedure OnInitializeReport
>>>>>>> String sSelection
>>>>>>> Integer iParams
>>>>>>> Date dFromInvoiceInvoiceDate dToInvoiceInvoiceDate
>>>>>>>
>>>>>>> Get nParams to iParams //<----shows as zero!!!
>>>>>>>
>>>>>>> Get FromInvoiceInvoiceDateValue To dFromInvoiceInvoiceDate
>>>>>>> //Shows
>>>>>>> the date just fine (from the wizard after all)
>>>>>>> Get ToInvoiceInvoiceDateValue To dToInvoiceInvoiceDate
>>>>>>> //this
>>>>>>> too
>>>>>>>
>>>>>>> Set NthParam 0 to dFromInvoiceInvoiceDate //Gives Error:
>>>>>>> "Invalid Parameter Number"
>>>>>>> Set NthParam 1 to dToInvoiceInvoiceDate //Ditto
>>>>>>>
>>>>>>> TIA
>>>>>>>
>>>>>>> Garret Mott
>>>>>>>
>>>>>>> Auto-Mate Software www.automatesoftware.com
>>>>>>> Northeast DataFlex Consortium www.nedataflex.com
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>