• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

Equivalent function to DrillOnDetail() event in RDC.

Hi All,

We have a existing Crystal Report Application using Automation Server.
On our Crystal Application we create a function than can drillown to another report using the return value of the in the DrillOnDetail event. The code is similar to this:

Public oCRApp As New CRPEAuto.Application
Public WithEvents oCRReport As CRPEAuto.Report
Public oCRView As View
Public oCREventInfo As CRPEAuto.EventInfo
Public WithEvents oCRWinEvents As Window

Private Sub oCRWinEvents_DrillOnDetail(ByVal FieldValues As Variant, ByVal SelectedFieldIndex As Long, useDefault As Boolean, ByVal ReportName As Variant)

Dim t           As CRPEAuto.FieldValue
Dim i           As Long
Dim lnCtr       As Long
Dim lcDocNo     As String
Dim lcLineItem  As String
Dim lcDescript  As String
Dim lcModule    As String
Dim lcTrsType   As String
Dim lcObjNo     As String
Dim lcAcctID    As String
Dim lcBatcNo    As String
Dim lcPeriod    As String
Dim lcPrdTitle  As String
Dim lvDrillValue    As Variant
Dim lcDrillName     As String
Dim lbGLDrill       As Boolean
Dim lnAnswer    As Long

i = SelectedFieldIndex
If i >= 0 Then
    lcDocNo = ""
    lcLineItem = ""
    lcDescript = ""
    lcModule = gcModule
    lvDrillValue = FieldValues(i).Value
    lcDrillName = VBA.LCase(FieldValues(i).Name)

    If gcModule = "AR" Or gcModule = "SO" Or gcModule = "GL" Or gcModule = "AP" Or gcModule = "PO" Then
        If gcModule = "GL" Then
            If VBA.InStrRev(lcDrillName, "cacctid") > 0 Then
                lbGLDrill = False
            ElseIf VBA.InStrRev(lcDrillName, "cobjno") > 0 Then
                lbGLDrill = False
            ElseIf InStrRev(lcDrillName, "fml_ctrsdesc") > 0 Then
                'Drill from non-gl journal entries to transaction report
                lcDescript = "TRS_RPT"
                lbGLDrill = True
            ElseIf InStrRev(lcDrillName, "fml_ndrill") > 0 Then
                'Only allow drill amount fields like Fml_nDrill...
                lbGLDrill = True
                Exit Sub
            End If
        End If

        For lnCtr = 0 To UBound(FieldValues, 1)
            Set t = FieldValues(lnCtr)
            Select Case gcModule
                Case "AR"
                    If InStrRev(t.Name, "cinvno") > 0 Then
                        lcDocNo = t.Value
                    ElseIf InStrRev(t.Name, "clineitem") > 0 Then
                        lcLineItem = t.Value
                    ElseIf InStrRev(t.Name, "cdescript") > 0 Then
                        lcDescript = t.Value
                    End If
                Case "GL"
                    If lbGLDrill Then
                        If VBA.InStrRev(t.Name, "ctrstype") > 0 Then
                            lcTrsType = VBA.Trim(t.Value)
                            If lcTrsType = "" Then
                                lcTrsType = "BATC"
                            End If
                        ElseIf VBA.InStrRev(t.Name, "ctrsno") > 0 Then
                            lcDocNo = t.Value
                        ElseIf VBA.InStrRev(t.Name, "cobjno") > 0 Then
                            lcObjNo = VBA.Trim(t.Value)
                        ElseIf VBA.InStrRev(t.Name, "csource") > 0 Then
                            lcModule = VBA.Trim(t.Value)
                        ElseIf VBA.InStrRev(t.Name, "cacctid") > 0 Then
                            lcAcctID = VBA.Trim(t.Value)
                        ElseIf VBA.InStrRev(t.Name, "cperiod") > 0 Then
                            lcPeriod = VBA.Trim(t.Value)
                        ElseIf VBA.InStrRev(t.Name, "cbatcno") > 0 Then
                            lcBatcNo = t.Value
                        End If
                    End If
            End Select
        Next lnCtr
    End If
    Call oVFP.Drill(lcDrillName, lvDrillValue, lcModule, lcDocNo, lcLineItem, gcAppName, lcDescript, _
        lcObjNo, lcTrsType, lcPeriod)   ' This function will call another report using the value of the variables to filter the record
End If
End Sub

In RDC we have code this in the "DblClicked" event but we cannot get the value of some of the fields that does not dispaly in the report. What I mean is that we some fields in the report that does not show but we have use it for reference.
My question is: How I can convert the following code in RDC since the DrillOnDetail event in RDC is not yet activated:
For lnCtr = 0 To UBound(FieldValues, 1)
Next lnCtr


  • 3
  • 3
1 Solution
Is there any particular reason you migrated to the RDC?  As far as I know, the Print Engine method is available in CR9 and 10.

renelovinoAuthor Commented:
The main reason why we migrated to RDC because we want to upgrade our report from crystal 8.5 to Crystal 10.
The Automation Server is not supported by Crystal 10 that's why we need to migrate to RDC.

I haven't paid much attention to CR10 yet since we still use 8 so was unaware it was dropped.  The last I had heard from Crystal was that it would be around for some time.

Let me look through my code at work.  I don't have a database here or the RDC.
If my memory is correct there is either a drilldown event or property you can use.

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

renelovinoAuthor Commented:
Hi mlmcc,

Thank you very much for your time of answering my question. And I appreciate it, but unfortunately until now I have no solution of my problem. We have directly as this to business objects technical support.

Do you still need help?

If not what do you wish to do with this question?

renelovinoAuthor Commented:
Hi All,

I have already get a work around for this issue. To work around this you need to put the the fields in the report but set the font size to white so that it will not dispaly in the report. May be other's have the same problem with this and i think they can use this technique.

By the way, since mlmcc is always there to help i will give the point to mlmcc.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now