|
-
Apr 10th, 2013, 04:46 AM
#1
Thread Starter
Fanatic Member
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
-
Apr 10th, 2013, 09:39 AM
#2
Thread Starter
Fanatic Member
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 ?
-
Apr 10th, 2013, 10:25 AM
#3
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 ...
-
Apr 10th, 2013, 11:30 AM
#4
Thread Starter
Fanatic Member
Re: Linked Sub report
Thanks for reply,
I am not using CrViewerControl, Is there any other way ?
-
Apr 10th, 2013, 05:00 PM
#5
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 ...
-
Apr 11th, 2013, 04:21 AM
#6
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|