How to Use Variables In Report Title With CRP9.02

Kaveh_1972
10-19-2004, 08:04 AM
Hi,

I’m using CRP 9.02 to create reports in my program. I want to use a variable in my program such as "strCustomer_name" and send it to each report for using in report title. I declare a Parameters in report and named it cuname1 and then in the program I use this code:


1: Dim rpt2 As New crpReminderReport
2: rpt2.cuname1.Value = strCustomer_name
3: rpt2.Database.SetDataSource rstReport
4: rpt2.PrintOut True


When I run the program I get this error message on line 2: “Error 424: Object required”

How can I use this method to put my customer name on title of my reports?

Thank you

MKoslof
10-19-2004, 06:34 PM
What is "cuname1" defined as? What is strCustomer_name defined as? Is this a string you are passing. If cuname1 is a parameter, you should loop all parameters in the parameters collection and do a select case on the parameter field name. Then, give each unique parameter a new value via the .SetCurrentValue method.

Kaveh_1972
10-20-2004, 12:11 AM
I've changed line 2 into this:
rpt2.ParameterFields(1).AddCurrentValue strCustomer_name
and it works!
Thank you very much, you do a great job!

MKoslof
10-20-2004, 06:26 PM
Your welcome, and thanks for the compliment. Good luck with your application.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum