Solved

Printing a variable heading on a Crystal Report

Posted on 1998-09-21
3
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 100 total points
ID: 1435999
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
ID: 1436000
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
ID: 2632337
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

733 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