Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Empty report (no data) how to detect in CR 9, VB6 and Oracle
In article <3E8DB31D.A116B5B3_at_exxesolutions.com>,
damorgan_at_exxesolutions.com says...
> Wim de Lange wrote:
>
> > At this moment I'm trying to create a Crystal Report 9.0 on a Oracle
> > 8.1.7 stored procedure. It works good, no problem there.
> >
> > There is this main program (not the crviewer) in Visual Basic 6 that
> > fills in the parameters in the report and then runs the report (using
> > the viewer and sending it to a pdf file).
> >
> > This program must run without user intervention. It is for generating
> > reports to several destinations.
> >
> > What I found impossible to do is to detect if there is no data in the
> > report. Is there a way to do this?
> >
> > A solution I was considering is using another connection to the oracle
> > database and run the query again (twice) by using some information from
> > the report.
> > crReport.SQLQuerySting has the following value:
> > BEGIN "LIMS"."CR_SAMCOLPAGE"(:P_CURSOR, 41, 'NL'); END ;
> > Can someone design a pl/sql and vb program so that I can rerun this
> > query and that it gives back the number of records?
> Go to http://www.crystaldecisions.com ... click on support and search the
> knowledge base.
Tried that, but there is no information about this subject. But I found it myself (with a little help) in the ADO documentation and now part of my code looks like this:
Dim adoCommand As ADODB.Command
Dim adoReturn As ADODB.Recordset
Set adoCommand = New ADODB.Command
With adoCommand
Set .ActiveConnection = adoConnection
.CommandText = "{call LIMS.CR_SAMCOLPAGE( {resultset 0, p_cursor}),
41,'NL')}"
.CommandText = strCommand
.CommandType = adCmdText
'.Parameters.Append .CreateParameter(, adVariant, adParamInputOutput)
Set adoReturn = .Execute
End With
-- Groetjes, Wim de LangeReceived on Tue Apr 08 2003 - 06:24:52 CDT