Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Set Report Title in CRViewer

Set Report Title in CRViewer

Set Report Title in CRViewer

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:
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.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?


RE: Set Report Title in CRViewer

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close