CaptainKirk
asked on
Is there any way to change the report title at runtime?
Like the title say...
Thanks in advance
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why use all the parameters..... in VB, the Crystal Report control has a property, Report Title. If you have placed the report title on your report and want to change it at runtime, just use the following syntax
MyCrystalReportControl.Rep ortTitle = "My Title"
MyCrystalReportControl.Rep
Dim crApp As CRAXDRT.Application
Dim crRpt As CRAXDRT.Report
Dim crSection As CRAXDRT.Section
Dim ImgObject As OLEObject
Dim strRptName As String
Dim strImgName As String
Dim Params As CRAXDRT.ParameterFields
Dim HeaderParam As CRAXDRT.ParamFieldDefiniti
Set crApp = New CRAXDRT.Application
strRptName = "C:\MyReport.rpt"
'Open Report
If IsObject(crRpt) Then
Set crRpt = Nothing
End If
Set crRpt = crApp.OpenReport(strRptNam
set Params = oRpt.Parameterfields
set HeaderParam = Params.Item(1)
'Parameter 12 in SetCurrentValue tags parameter as a String
Call HeaderParam.SetCurrentValu
crRpt.MorePrintEngineError
crRpt.EnableParameterPromp
crRpt.DiscardSavedData
' Set the viewer's report source to the Report object
CRViewer1.ReportSource = crRpt
CRViewer1.ViewReport
Hope this helps.