From: WernerA on
Geoff

I'm using Phil's Lib.

I have something like
....
SELF:oCRApplication := IApplication{}

IF lMoremessages
.....
ENDIF
oReport := SELF:oCRApplication:OpenReport(cReportFile, iOpenMethod)
cAusw := [{_DruPersonen.Kennung} = 2 and
{SteuerRechn.Steuerjahr} = 2006]
oReport:recordSelectionFormula := cAusw
....
and then display the report in the viewer

--> First, the error message is displayed
after ignoring, the report is displayed, but with the
RecordSelectionformula in the RPT


The assign:

ASSIGN RecordSelectionFormula(;
uParam001; // AS STRING
) CLASS IReport
// Gets or sets record selection formula.

LOCAL a AS ARRAY
LOCAL pFirstParamDesc AS VOOLEARGDESC
LOCAL pParamDesc AS VOOLEARGDESC
LOCAL uRetValue AS USUAL

a := {String2Symbol("RecordSelectionFormula"), 308,
INVOKE_PROPERTYPUT, 1, 0, FALSE, NULL, NULL}

pParamDesc := pFirstParamDesc := SELF:__AllocArgDescs(1)
a[OFD_PARAMDESC] := pParamDesc
pParamDesc.dwIDLFlag := 1
pParamDesc.dwVarType := VT_BSTR
pParamDesc += 1

uRetValue := SELF:__InvokeMethod(a, DWORD(_bp+16),PCount())

MemFree(pFirstParamDesc)

return(uRetValue)

Werner

From: WernerA on

Michael,

Good point. The string works, but not with sqare brackets as delimiters
Werner

From: Michael Haensch on
Hallo Werner,

ich hab's gerade mal ausprobiert:

o:oReport:RecordSelectionFormula :=
"{vTK_Ascom2.DATUM} = DATE (2006, 0, 1)"

Es klappt und es ist es egal, ob der String durch ', " oder [ begrenzt
ist; alles andere w�re auch seltsam.

Ich verwende Crystal XI (11.0.0.1994 in deutsch), VO 2773), aber direkt
als ActiveX ohne die Lib von Phil.
1. Hast du die aktuelle Version von Crystal XI?
2. Klappt es vielleicht, wenn du NICHT die Lib von Phil verwendest?

-----------
So, nochmal im Internet beim Support gesucht und folgendes gefunden:

KBase Article ID:c2011206

Article refers to:Crystal Reports 8.5
Symptom

A Visual Basic application uses the Report Designer Component (RDC) as
the reporting development tool. The application passes a record
selection formula to the report at runtime.

When the application is run, the following error appears:

"Basic syntax is not supported in group/record selection formula"

Why does this error message appear considering the record selection
formula does not contain any Basic syntax?

Resolution

This error message occurs because the following line of code appears
before the record selection formula is set:

report.formulasyntax = crBasicSyntaxFormula

This line of code sets a flag to force all subsequent report formulas,
including the record selection formula, to be evaluated using Basic
syntax. Since record selection formulas can only use Crystal syntax and
not Basic syntax, the error message appears.

To resolve this error message, set the record selection formula before
the Basic syntax flag is set.

---------------------

KBase Article ID:c2018734

Article refers to:Crystal Reports XI
Symptom

When a Report Designer Component (RDC) XI web or Windows application
passes a record selection formula to a report at run time, the following
error message appears:

"Basic syntax is not supported in group/record selection formula"

Why does this error message appear and how do you resolve it?
Resolution

The error message appears after an RDC application has been upgraded
from a previous version. As a result, the record selection formula is
being interpreted as Basic syntax, even if it is not Basic syntax.

To resolve the error message, add these lines of code to your
application so that they are executed before the record selection
formula is passed to the report:

' report is the name of the 'Report' object

' sets the record selection formula to be interpreted as Crystal syntax

report.FormulaSyntax = 0 ' Use crCrystalSyntaxFormula value

---------------------------


Wird vielleicht in Phils Lib die Syntax auf Basic gesetzt?


Michael



WernerA schrieb:
> Michael,
>
> Good point. The string works, but not with sqare brackets as delimiters
> Werner
>
[GER
From: WernerA on
Hallo Michael,

report.FormulaSyntax = 0 ' Use crCrystalSyntaxFormula value
solved the problem. Allthough I spent more than two hours searching the
Crystal knowledge base, this point escaped me.

Thank You so much
Werner

PS: Michael: Sie haben mir einen sehr grossen Dienst erwiesen, ich
steckte tatsächlich fest. Wenn Sie mal in der Schweiz (Bern oder
Zürich) sind, melden Sie sich bitte.

From: Michael Haensch on
Hallo Werner,

gern geschehen!

Michael

WernerA schrieb:
> Hallo Michael,
>
> report.FormulaSyntax = 0 ' Use crCrystalSyntaxFormula value
> solved the problem. Allthough I spent more than two hours searching the
> Crystal knowledge base, this point escaped me.
>
> Thank You so much
> Werner
>
> PS: Michael: Sie haben mir einen sehr grossen Dienst erwiesen, ich
> steckte tats�chlich fest. Wenn Sie mal in der Schweiz (Bern oder
> Z�rich) sind, melden Sie sich bitte.
>
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: MS Access Permissions Problem
Next: SQL examples