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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Report Title in CRViewer

Status
Not open for further replies.

jtrapat1

Programmer
Jan 14, 2001
137
US
I'm using CR8.5, VB6, and SQL Server 7.
I'm calling my Form1 (which includes the CRViewer) from my main form. I'm passing the path of the report but I'd like to know how to set the caption of the form that the crviewer is on, so that it matches the title of the report.
It's usually done with report.windowtitle in crystal reports but since I have a crviewer on a form, I need to set the caption property on the form.
Here's my main form:
frmMain()
path = "Z:\btreports\Secretary\All Bills By Analyst.rpt"
Set Report = crxapplication.OpenReport(path)
Load Form1
Form1.Show vbModal
----------------------------------------
And here's the code in my Form1 with the CRViewer included:
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Form1.Height = Screen.Height
Form1.Width = Screen.Width
CRViewer1.ReportSource = frmBTMain.Report
CRViewer1.EnableExportButton = True
CRViewer1.ViewReport
CRViewer1.EnableRefreshButton = True
CRViewer1.EnableStopButton = True
CRViewer1.EnableCloseButton = True
CRViewer1.EnableAnimationCtrl = True
CRViewer1.EnableProgressControl = True
CRViewer1.EnableZoomControl = True
Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Resize()

CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub

How can I set the property of the caption of this viewer form so that it matches the title of the report?

Thanks
John
 
I run a Delphi application that makes use of the CRViewer component. What I do with mine is to set the caption of the form on which the CRViewer sits (my CRViewer component is aligned so that it fills the form) - this then gives the impression that the CRViewer is showing the appropriate caption.
Hope that this solution is sufficient.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top