ndevriendt
Programmer
Hello,
I have written a Visual basic 6.0 program that manage a lot of reports.
The captions of the reports/subreports should be translated in different language.
On a mainreport I have no problems but when I use a subreport. The text object never change.
Does someone has a solution?
My code looks like:
Public m_application As New CRAXDDRT.Application
Public m_Report As CRAXDDRT.Report
'hoofdreport
Set m_Report = m_application.OpenReport(mobjRSReports.Fields("locatie"
& "\" & mobjRSReports.Fields("naam"
)
Private Sub CRViewer1_DrillOnSubreport(GroupNameList As Variant, ByVal SubreportName As String, ByVal Title As String, ByVal PageNumber As Long, ByVal Index As Long, UseDefault As Boolean)
Set m_Report = m_application.OpenReport(mobjRSReports.Fields("Locatie"
& "/rpt_totalennogoptenemen.rpt"
Call FrmVertaalLabelsReport(StrTaal)
end sub
Public Sub FrmVertaalLabelsReport(mstrTaal As String)
Dim i As Integer
Dim j As Integer
Dim BlnGevonden As Boolean
If mstrTaal = "F" Then
For j = 1 To m_Report.Sections.Count
For i = 1 To m_Report.Sections(j).ReportObjects.Count
If Mid(m_Report.Sections(j).ReportObjects.Item(i).Name, 1, 4) = "Text" Then
BlnGevonden = False
MobjRSLabels.MoveFirst
Do
' Debug.Print Trim$(m_Report.Sections(j).ReportObjects(i).Text)
If Trim$(m_Report.Sections(j).ReportObjects(i).Text) = MobjRSLabels.Fields("CaptionNLD"
Then
m_Report.Sections(j).ReportObjects(i).SetText MobjRSLabels.Fields("CaptionFRA"
BlnGevonden = True
End If
MobjRSLabels.MoveNext
Loop Until MobjRSLabels.EOF Or BlnGevonden
End If
Next i
Next j
End Sub
I have written a Visual basic 6.0 program that manage a lot of reports.
The captions of the reports/subreports should be translated in different language.
On a mainreport I have no problems but when I use a subreport. The text object never change.
Does someone has a solution?
My code looks like:
Public m_application As New CRAXDDRT.Application
Public m_Report As CRAXDDRT.Report
'hoofdreport
Set m_Report = m_application.OpenReport(mobjRSReports.Fields("locatie"
Private Sub CRViewer1_DrillOnSubreport(GroupNameList As Variant, ByVal SubreportName As String, ByVal Title As String, ByVal PageNumber As Long, ByVal Index As Long, UseDefault As Boolean)
Set m_Report = m_application.OpenReport(mobjRSReports.Fields("Locatie"
Call FrmVertaalLabelsReport(StrTaal)
end sub
Public Sub FrmVertaalLabelsReport(mstrTaal As String)
Dim i As Integer
Dim j As Integer
Dim BlnGevonden As Boolean
If mstrTaal = "F" Then
For j = 1 To m_Report.Sections.Count
For i = 1 To m_Report.Sections(j).ReportObjects.Count
If Mid(m_Report.Sections(j).ReportObjects.Item(i).Name, 1, 4) = "Text" Then
BlnGevonden = False
MobjRSLabels.MoveFirst
Do
' Debug.Print Trim$(m_Report.Sections(j).ReportObjects(i).Text)
If Trim$(m_Report.Sections(j).ReportObjects(i).Text) = MobjRSLabels.Fields("CaptionNLD"
m_Report.Sections(j).ReportObjects(i).SetText MobjRSLabels.Fields("CaptionFRA"
BlnGevonden = True
End If
MobjRSLabels.MoveNext
Loop Until MobjRSLabels.EOF Or BlnGevonden
End If
Next i
Next j
End Sub