Results 1 to 6 of 6

Thread: Linked Sub report

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Linked Sub report

    Dears,

    I have created a report in Crystal Report 9 which the data of In Hand Cheques. I want that when i Double click on any cheque number in the main report, it will show the history of that cheque in sub report. How it is possible. Please help me

    Farooq

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Linked Sub report

    I think my question is not clear, lets change the scenario.
    a main report is based on Orders of clients. Sub report is based on Orders Detail.
    I want that when I click on Order Number, the sub report show the detail of that order. Is there any way ?

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Linked Sub report

    I can show a new report not a subreport
    You need to intercept the Clicked event in the CRViewer
    Use CRVEventInfo & CRVField objects
    Ask if the clicked field is Order Number then open a new viewer with the new report that is the detail of that Order Number

    Are you using CR9 Viewer?

    Try with a VB6 project that has CRviewer
    Execute to render a rpt
    Click over some fields and see what happen
    (report viwer name is : CrystalActiveXReportViewer1 --- change if you need to)
    Declarations
    Code:
    Dim CrViewerEventInfo   As CrystalActiveXReportViewerLib9Ctl.CRVEventInfo
    Dim CrFields            As New CrystalActiveXReportViewerLib9Ctl.CRVFields
    Dim CrField             As New CrystalActiveXReportViewerLib9Ctl.CRVField
    Dim Msg                 As String
    Clicked event
    Code:
    Private Sub CrystalActiveXReportViewer1_Clicked(ByVal x As Long, ByVal y As Long, EventInfo As Variant, UseDefault As Boolean)
    
        Set CrViewerEventInfo = EventInfo
    
        If Not CrViewerEventInfo.Text = "" Then
            Set CrFields = CrViewerEventInfo.GetFields
            Set CrField = CrFields.Item(CrFields.SelectedFieldIndex)
            Msg = vbCrLf & vbCrLf & _
                  "You Click over   : " & CrField.Name & "        " & _
                  vbCrLf & vbCrLf & _
                  "and the value is : " & CrField.Value & "        " & _
                vbCrLf & vbCrLf
            MsgBox Msg, vbInformation, "Click over ReportViewer "
            Set CrFields = Nothing
            Set CrField = Nothing
        End If
    
    End Sub
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Linked Sub report

    Thanks for reply,
    I am not using CrViewerControl, Is there any other way ?

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Linked Sub report

    Another way is SubReport on Demand but the user need to click on the subreport to show it and not on any field
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Linked Sub report

    how it will be developed ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width