-
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
-
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 ?
-
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
-
Re: Linked Sub report
Thanks for reply,
I am not using CrViewerControl, Is there any other way ?
-
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
-
Re: Linked Sub report
how it will be developed ?