By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,664 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,664 IT Pros & Developers. It's quick & easy.

Crystal report with stored procedure in subreport

P: n/a
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(paramet erRangeValue);

------------------------------------------------
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
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


It is working fine now?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2

P: n/a

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

--
crdev
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #3

P: n/a

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

--
crdev
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.