User defined report title (CR v 4.6) 
Author Message
 User defined report title (CR v 4.6)

Using the CR version included with VB 6 (it's version 4.6 IIRC), is it
possible to allow the user to create their own report title in the VB
program, and if so, how?
I am *not* using a bound report so the BoundReportHeading property of
the CR OCX is not the answer.
The report I designed includes a text field in the TITLE section. Can
this be dynamically changed at run-time?
Thanks for any info.

Sherry



Mon, 16 Sep 2002 03:00:00 GMT  
 User defined report title (CR v 4.6)
I'm not sure if this is what you're looking for, but what I have done is
made the title a 'formula' field instead of a text field, then pass a
formula from VB to Crystal.

CrystalReport1.formula(0)="Title='" & strUserTitle & "'"

It's hard to see in the formula, but there is a single quote after the 2nd
equal sign and a single quote between the 2 double quotes on the end.
"Title" is the name of the formula field in Crystal.

Best Regards,
Dave



Thu, 19 Sep 2002 04:00:00 GMT  
 User defined report title (CR v 4.6)
Dave,
YES! This is *exactly* what I was looking for! I didn't even think
about using a formula field (obviously). Thank you so much.
What I did was add a formula field with no formula defined in it (is
that the "best" way to do it?).
At run-time I assign text using code similar to what you provided.
Thanks again so much Dave.

Sherry



Quote:
>I'm not sure if this is what you're looking for, but what I have done is
>made the title a 'formula' field instead of a text field, then pass a
>formula from VB to Crystal.

>CrystalReport1.formula(0)="Title='" & strUserTitle & "'"



Thu, 19 Sep 2002 04:00:00 GMT  
 User defined report title (CR v 4.6)
Sherry,
    when you do this kind of thing it is best to put something in the
formula that CR will recognize as a datatype  It your scenario I would use a
set of double quotes (i.e. an empty field "").  If you were looking to base
other formula on the value you passed and you wanted to pass a numeric then
put a zero in between the quotes and then convert the value in the dependent
formulae (depends on your cicumstances, but older techniques of passing
formula values to the PE would only pass those values as chars.)

Dan McGarry
HCI Systems, Inc.
http://www.hcisystems.com

Quote:

>Dave,
>YES! This is *exactly* what I was looking for! I didn't even think
>about using a formula field (obviously). Thank you so much.
>What I did was add a formula field with no formula defined in it (is
>that the "best" way to do it?).
>At run-time I assign text using code similar to what you provided.
>Thanks again so much Dave.

>Sherry



>>I'm not sure if this is what you're looking for, but what I have done is
>>made the title a 'formula' field instead of a text field, then pass a
>>formula from VB to Crystal.

>>CrystalReport1.formula(0)="Title='" & strUserTitle & "'"



Fri, 20 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to increase the Font Size of Graph Titles in Crystal Report 4.6

2. CR 4.6 shipped with VB5 question - How to tell when report is unloaded in Visual Basic

3. CR 4.6 - Report doesn't update parameters - HELP

4. CR 4.6 report selection formula

5. CR 4.6 - Same as Report disabled

6. Bound Report w/ CR 4.6 and VB 5.0

7. VB 6.0, Access 97, CR 4.6

8. VB 6.0, Access 97, CR 4.6

9. CR 4.6 and external variable

10. CR 4.6 shipped with VB5 question - referencing group subtotals

11. Using the CR 4.6 that comes with VB 5

12. Help ragrding CR 4.6 How to set the Margin of Detail

 

 
Powered by phpBB® Forum Software