Solved

Printing a variable heading on a Crystal Report

Posted on 1998-09-21
3
130 Views
Last Modified: 2010-04-30
I want to be able to pass the start and end date for the report from my vb application so that it is displayed as part of the crystal report heading. How do I do this. I tried passing it via the formula property of the crystal control from vb, but it doesn't work.
0
Comment
Question by:pcorreya
3 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 100 total points
Comment Utility
You can replace the report title like this:

CrystalReport1.ReportTitle = "Lab Sample Batches From:" & _
  format(Frdate,"Short Date") & " To:" & _
  format(Todate,"Short Date")

I always just fill the report title with x's to make it long enough to hold my longest title (& then some).
0
 
LVL 1

Author Comment

by:pcorreya
Comment Utility
The crystal control doesn't support a reporttile property. I am using version 4.6 of the control that came along with vb5.

I really want to put the heading in the Title section of the report. Can this be achieved using a formula.
0
 
LVL 2

Expert Comment

by:cero
Comment Utility
Ok
In the CR designer, you have to put any formula you want, put a name to the formula and then in the edit-formula put "" (double quote)
Next, put the box generated where you want.
In the Visual basic, put
MyForm.MyCRObjet.Formulas(0) = "Title=' My Title '"

MyForm.MyCRObject.Formulas(1) = "Subtitle=' My subtitle '"

Or

Dim VarMyTitle as String
VarMyTitle = "My title"

MyForm.MyCRObjet.Formulas(0) = "Title='" & VarMyTitle & "'"

cero.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now