Crystal report with stored procedure in subreport

Discussion in 'ASP .Net' started by kenneth xg, Apr 20, 2005.

  1. kenneth xg

    kenneth xg Guest

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    kenneth xg, Apr 20, 2005
    #1
    1. Advertising

  2. kenneth xg

    Kenneth Guest

    Kenneth, Apr 20, 2005
    #2
    1. Advertising

  3. kenneth xg

    crdev Guest

    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
    ------------------------------------------------------------------------
    crdev, Apr 23, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWJpc2hy?=

    printing on demand Subreport crystal

    =?Utf-8?B?TWJpc2hy?=, Jul 26, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,642
    =?Utf-8?B?TWJpc2hy?=
    Jul 26, 2005
  2. David Dvali

    Exporting Crystal Reports subreport data

    David Dvali, Nov 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    605
    David Dvali
    Nov 25, 2005
  3. brett
    Replies:
    0
    Views:
    721
    brett
    Sep 1, 2007
  4. Comfort
    Replies:
    0
    Views:
    537
    Comfort
    Oct 18, 2004
  5. arock
    Replies:
    0
    Views:
    216
    arock
    Jul 12, 2006
Loading...

Share This Page