11.7
I am not familiar with oo and wounder if anyone could share som light regarding this:
We used COM before, and now we want to use DLL's from Crysta.
Setting the parameters was done by:
chReport:ParameterFields:ITEM(1):ClearCurrentValueAndRange().
chReport:ParameterFields:ITEM(1):SetCurrentValue(h-jobbnr).
chExportOptions = chReport:ExportOptions.
chExportOptions:DiskFileName = vExportFilnavn.
chExportOptions:DestinationType = {&crEDTDiskFile}.
chExportOptions:FormatType = {&crEFTPortableDocFormat}.
chExportOptions:PDFExportAllPages = TRUE.
chReport:EXPORT(FALSE).
************************************************************************
I have understood that I need to something like this:
method void setParameter (input ipField as char , input ipValue as char):
DEFINE VARIABLE oPFDs AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions NO-UNDO.
DEFINE VARIABLE oPFD AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition NO-UNDO.
DEFINE VARIABLE oPVs AS CLASS CrystalDecisions.Shared.ParameterValues NO-UNDO.
DEFINE VARIABLE oPV AS CLASS CrystalDecisions.Shared.ParameterValue NO-UNDO.
DEFINE VARIABLE oDV AS CLASS CrystalDecisions.Shared.ParameterDiscreteValue NO-UNDO.
DEFINE VARIABLE oPFs AS CLASS CrystalDecisions.Shared.ParameterFields NO-UNDO.
DEFINE VARIABLE oPF AS CLASS CrystalDecisions.Shared.ParameterField NO-UNDO.
def var i as int no-undo.
oPFDs = crwReport:DataDefinition:ParameterFields.
oPF = new CrystalDecisions.Shared.ParameterField().
oPF:Name = oPFDs:Item[0]:Name.
oDV = new CrystalDecisions.Shared.ParameterDiscreteValue().
oDV:Value = 220016.
oPF:CurrentValues:Add(oDV).
crystalReportViewer1:ParameterFieldInfo:Add(oPF).
I am able to find the parametername, but I don't understand how to set the value and how to appy it.
//Geir Otto
Ok, after some hours I finally got it to work.....
DEFINE VARIABLE oPFDs AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions NO-UNDO.
DEFINE VARIABLE oPFD AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition NO-UNDO.
DEFINE VARIABLE oPVs AS CLASS CrystalDecisions.Shared.ParameterValues NO-UNDO.
DEFINE VARIABLE oPV AS CLASS CrystalDecisions.Shared.ParameterValue NO-UNDO.
DEFINE VARIABLE oDV AS CLASS CrystalDecisions.Shared.ParameterDiscreteValue NO-UNDO.
DEFINE VARIABLE oPFs AS CLASS CrystalDecisions.Shared.ParameterFields NO-UNDO.
DEFINE VARIABLE oPF AS CLASS CrystalDecisions.Shared.ParameterField NO-UNDO.
def var i as int no-undo.
oPVs = new CrystalDecisions.Shared.ParameterValues().
oDV = new CrystalDecisions.Shared.ParameterDiscreteValue().
oPFDs = crwReport:DataDefinition:ParameterFields.
oPFD = oPFDs[crwReport:DataDefinition:ParameterFields:Item[0]:Name].
oPVs = oPFD:CurrentValues.
oDV:Value = 167682.
oPVs:Clear().
oPVs:Add(oDV).
oPFD:ApplyCurrentValues(oPVs).
I found it.... :-) damn, starting to like this
Ok, after some hours I finally got it to work.....
DEFINE VARIABLE oPFDs AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions NO-UNDO.
DEFINE VARIABLE oPFD AS CLASS CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition NO-UNDO.
DEFINE VARIABLE oPVs AS CLASS CrystalDecisions.Shared.ParameterValues NO-UNDO.
DEFINE VARIABLE oPV AS CLASS CrystalDecisions.Shared.ParameterValue NO-UNDO.
DEFINE VARIABLE oDV AS CLASS CrystalDecisions.Shared.ParameterDiscreteValue NO-UNDO.
DEFINE VARIABLE oPFs AS CLASS CrystalDecisions.Shared.ParameterFields NO-UNDO.
DEFINE VARIABLE oPF AS CLASS CrystalDecisions.Shared.ParameterField NO-UNDO.
def var i as int no-undo.
oPVs = new CrystalDecisions.Shared.ParameterValues().
oDV = new CrystalDecisions.Shared.ParameterDiscreteValue().
oPFDs = crwReport:DataDefinition:ParameterFields.
oPFD = oPFDs[crwReport:DataDefinition:ParameterFields:Item[0]:Name].
oPVs = oPFD:CurrentValues.
oDV:Value = 167682.
oPVs:Clear().
oPVs:Add(oDV).
oPFD:ApplyCurrentValues(oPVs).
I found it.... :-) damn, starting to like this