Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual basic and Crystal reports problem

Status
Not open for further replies.

ndevriendt

Programmer
Jan 8, 2002
74
BE
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

 
This is a VBA forum NOT a VB forum. Please post in one of the VB fora

Rgds, Geoff
[blue]Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?[/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top