Crystal report with stored procedure in subreport

K

kenneth xg

Hi,

I have problem on passing parameters to subreports' stored procedures
which require parameters, from an asp.net web form.


I ve tried to use the stored procedures on the main report it works
fine, however once the stored procedures were put into a subreport, it
cause an exception:
"Missing parameter field current value"


I am pretty sured that I reference to the subreport's parameter, below
are the code used to populate the parameters

------------------------------------------------
ParameterFieldDefinitions parameterFieldDefinitions =
reportDocument.DataDefinition.ParameterFields;
ParameterFieldDefinition parameterFieldDefinition =
parameterFieldDefinitions[SUBREPORT_PARAMETER_FIELD_NAME,
SUBREPORT_NAME];
parameterFieldDefinition.CurrentValues.Clear();
parameterFieldDefinition.CurrentValues.Add(parameterRangeValue);

------------------------------------------------
in the code behine file.

Dose anybody know why it dose not for subreports' stored procedures with
parameters and how to fix it?

Many thanks
 
C

crdev

Please help with Crystal Subreport Links

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

Using I Crystal Report 9 environment I created a report with a
subreport, a parameter param_main_1 in the main report and a parameter
param_sub_1 in the subreport. Then I linked param_main_1 to
param_sub_1. I placed the field param_sub_1 on the subreport section to
make it active.

From my VB6 application I tried to analyse subreport links.
I created a crystal application object and open a report.

Dim repApp As CRAXDRT.Application
Set repApp = New CRAXDRT.Application

Dim rep As CRAXDRT.Report
Set rep = repApp.OpenReport(txtReport.Text)

Then I found a subreport and opened it

Dim oObject As Object
Dim oSection As Object
Dim oSubReport As Object

For Each oSection In rep.Sections
For Each oObject In oSection.ReportObjects
If oObject.Kind = crSubreportObject Then

Set oSubReport = oObject.OpenSubreport

I retrieved a collection of Subreport links and got my link

Dim oSubreportObject As CRAXDRT.SubreportObject
Dim oSubreportLinks As CRAXDRT.SubreportLinks
Dim oSubreportLink As CRAXDRT.SubreportLink

Set oSubreportObject = oObject
Set oSubreportLinks = oSubreportObject.Links
For i = 1 To oSubreportLinks.Count

Set oSubreportLink = oSubreportLinks(i)

I got a main report field of the link and see its properties (at least
a name)

Dim oMainreportField As Object
Dim mainreportFieldName As String

Set oMainreportField = oSubreportLink.MainReportField
mainreportFieldName = oMainreportField.Name

But I CANNOT retrieve a reference on SubreportField !!!

Dim oSubreportField As Object

Set oSubreportField = oSubreportLink.SubreportField

An error 5 "Invalid procedure call or argument" is raised.

========================================================

Could anybody tell me where I am wrong? And how to get a valid
reference on a subreport field of a subreport link?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top