472,958 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Crystal report with stored procedure in subreport

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
3 12874


It is working fine now?

Thanks

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

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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Craig Faulkner | last post by:
I have been fighting through my first crystal report in VS2003.NET and have made some headway. Here is what I've done: 1. Created a crystal report in VS2003 from a SQL stored procedure with...
0
by: mmccor | last post by:
Hi. I'm having a problem passing a value to a sql stored procedure parameter in a crystal report. When I run a trace on Sql Server the parameters are empty or null. The procedure contains one...
1
by: John | last post by:
Hi. Sir: Does anyboday know how to export subreport data using the export button in crystal report tool bar? We have a main report including a on-demand report. When we click the on-demand...
1
by: Tim Frawley | last post by:
I have created a Crystal Report with five subreports to represent datagrids on our dataentry application. The largest datagrid is the last item on the report. When empty this last subreport will...
0
by: Timmy Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
0
by: arock | last post by:
I've created a SQL Server stored procedure that uses a temporary table (#tempTable) to run some sub-queries within the main SELECT statement. This works perfectly fine within the Crystal Designer...
4
by: yin_n_yang74 | last post by:
I am new to SQL and SQL Server world. There must be a simple solution to this, but I'm not seeing it. I am trying to create a crystal report (v8.5) using a stored procedure from SQL Server...
0
by: Justin K | last post by:
I have an issue with a Crystal Report that I am using in my C# program. I created the report in Crystal Reports XI(R2). The report's datasource is an SQL stored procedure, and contains a...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.