locked
Can see subreport in prview but nothing printed RRS feed

  • Question

  • User-2128752353 posted

     I created an AR statement using crystal report.  The main report gets customer info and use customer ID and from and to dates to link to three sub reports.  The three subreports are (1) opening balance, (2) list of transactions and (3) aging summary.  When I previewed it from VS2005 design mode, everything shown pecfectly however when I run it from VB, only the list of transactions shown and the other two subrreports only showed labels but no data.  In addition, I can send the report to printer and no PDF can be generated.

    Can someone tell me what are the tricks?  Thanks a lot.

    Friday, June 25, 2010 5:10 PM

Answers

  • User-2128752353 posted

    I got it fixed.  It was parameter issue.  The was a parameter I used "Edit parameter field" in "field explorer" of Crystal report to set up a default value.  However the default value wasn't picked up at runtime.  I don't know if this is a bug or my misunderstanding. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 25, 2010 7:27 PM

All replies

  • User1224194097 posted

    are you sure that you are passing correct parameter values to sub reports through your code.

    make sure that you did not supress the sections in the main report.

    If you supress the sections in the main report, sub reports will be displayed in their individual report preview but not in the main report previews.

    Correct me If I understood wrong.

    Thanks


    Friday, June 25, 2010 5:53 PM
  • User-2128752353 posted

    Thanks for prompt reply.  It's really hard to master....

    I am positive the right parameter was passed.  I was able to printed all parameters to be passed on the main report.

    I don't think the section was suppressed because it wasn't the whole section not shown.  It was just only the data portion, the lables are okay.

    Friday, June 25, 2010 7:01 PM
  • User-2128752353 posted

    It seems somehow the linkage wasn't build successfully during runtime, perhaps the data type???  And I also PDF will also not be able to generated under this situation. 

    Friday, June 25, 2010 7:09 PM
  • User1224194097 posted

    If you are using Linked parameters, make sure you pass the value to the sub report parameters as well.

    soemthing like this

     Dim crParameterFieldDefinitions As ParameterFieldDefinitions

                    crParameterFieldDefinitions = rpt.DataDefinition.ParameterFields

                    Dim en As SCRCollectionEnumerator = crParameterFieldDefinitions.GetEnumerator()

                    Dim crIDValue As New ParameterValues()

                    crIDValue.AddValue(ID)

                    While (en.MoveNext())

                        Dim param As ParameterFieldDefinition

                        param = en.Current

                        'ID

                        If (param.DefaultValues.Count() > 0) Then

                            Dim crType As New ParameterValues()

                            crType.AddValue(DirectCast(param.DefaultValues(0), ParameterDiscreteValue).Value.ToString())

                            param.ApplyCurrentValues(crType)

                        Else

                            param.ApplyCurrentValues(crIDValue)

                        End If

                    End While



     Dim crParameterFieldDefinitions As ParameterFieldDefinitions
                    crParameterFieldDefinitions = rpt.DataDefinition.ParameterFields
                    Dim en As SCRCollectionEnumerator = crParameterFieldDefinitions.GetEnumerator()
                    Dim crReferralIDValue As New ParameterValues()
                    crReferralIDValue.AddValue(ReferralID)
                    While (en.MoveNext())
                        Dim param As ParameterFieldDefinition
                        param = en.Current
                        'referralID
                        If (param.DefaultValues.Count() > 0) Then
                            Dim crType As New ParameterValues()
                            crType.AddValue(DirectCast(param.DefaultValues(0), ParameterDiscreteValue).Value.ToString())
                            param.ApplyCurrentValues(crType)
                        Else
                            param.ApplyCurrentValues(crReferralIDValue)
                        End If
                    End While



    Friday, June 25, 2010 7:15 PM
  • User-2128752353 posted

    I got it fixed.  It was parameter issue.  The was a parameter I used "Edit parameter field" in "field explorer" of Crystal report to set up a default value.  However the default value wasn't picked up at runtime.  I don't know if this is a bug or my misunderstanding. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 25, 2010 7:27 PM