×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!

*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

Passing a Title to Crystal Reports

Passing a Title to Crystal Reports

Passing a Title to Crystal Reports

(OP)
Does anyone know how to dynamically pass a Title to Crystal Reports (ver. 6)? The Help in Crystal Reports is rather pathetic.

RE: Passing a Title to Crystal Reports


Amen...

It took me forever and several user groups to figure it out. Unfortunatly, I've yet to try it. What was suggested to me was:

CrystalReport1.Formulas(0) = "Headline=""your_data""

then in the Crystal Report, make a formula called "HeadLine" and you can place the formula field wherever you like.

Again, I've yet to try it.

RE: Passing a Title to Crystal Reports

(OP)
I tried that method with the Formulas. Maybe I was doing it wrong, but it didn't work. Experimenting some more, I found a way to do it. It assumes your CrystalReport1 designer was renamed "PeopleDetail" and that you had already created a SQL statement to select your records for the report stored in ReportSQL, and user supplied title for the report in ReportTitle$:

Dim Report As New PeopleDetail

Option Explicit
________________________________________________
Private Sub Form_Load()
Dim rs As New ADODB.Recordset

If Len(ReportSQL$) = 0 Then
MsgBox "Recordset not selected yet. Use the Query form first"
Unload Me
End If

'Use this SQL statement to select the records to use
rs.Open ReportSQL$, _
"DSN=" & DSN$ & ";", adOpenKeyset
Report.Database.SetDataSource rs

If Len(ReportTitle$) = 0 Then
Report.ReportTitle = "Detailed Personal Report"
Else
Report.ReportTitle = ReportTitle$
ReportTitle$ = ""
End If

'CRViewer1.Name = "Test Name"
CRViewer1.DisplayGroupTree = False
CRViewer1.ReportSource = Report
CRViewer1.ViewReport

End Sub

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