` Printed Icetips Article

Icetips Article



Par2: Crystal report dates from Clarion dates
2001-08-14 -- James Harper
 
if you're talking about passing parameters via the crystal api then the
magic number you want is 2378857

the code I use to pass parameters adds this number to the long value of the
clarion date to put in the crystal date field like so:

    CASE PEParameterFieldInfo.ValueType
    OF PE_PF_NUMBER
        PEParameterFieldInfo.CurrentValue_NUMBER = pValue
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_CURRENCY
        PEParameterFieldInfo.CurrentValue_CURRENCY = pValue
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_BOOLEAN
        PEParameterFieldInfo.CurrentValue_BOOLEAN = pValue
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_DATE
        PEParameterFieldInfo.CurrentValue_DATE = pValue + 2378857
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_STRING
        PEParameterFieldInfo.CurrentValue_STRING = pValue
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_DATETIME
        DateTime = pValue
        PEParameterFieldInfo.CurrentValue_DATETIME.CurrentValue_DT_DATE =
DateTime.DT_Date + 2378857
        PEParameterFieldInfo.CurrentValue_DATETIME.CurrentValue_DT_TIME =
DateTime.DT_Time/100
        PEParameterFieldInfo.CurrentValueSet = TRUE
    OF PE_PF_TIME
        PEParameterFieldInfo.CurrentValue_TIME = pValue/100
        PEParameterFieldInfo.CurrentValueSet = TRUE
    END

in this case pValue is an 'any' type parameter value passed to the above
code



Printed November 21, 2024, 7:01 am
This article has been viewed/printed 35219 times.