PDA

Click to See Complete Forum and Search --> : Crystal Report Formula


suresh.cgmohan
Sep 22nd, 2006, 01:14 AM
Hi to all,

I am using VB6 and Crystal XI.

I want to know how to pass values of Crystal report formulas.
I hope , below example, let u clear what i am asking.

I insert a Formula Field , @CompanyName in Crystal report. I am need to pass the value for this formula in VB Runtime.

I don't know how to pass a value for crystal report formula.

Can anyone help me?

Advance Thanks.

Regards,
Suresh.

King_George
Sep 22nd, 2006, 08:56 AM
Hi to all,

I am using VB6 and Crystal XI.

I want to know how to pass values of Crystal report formulas.
I hope , below example, let u clear what i am asking.

I insert a Formula Field , @CompanyName in Crystal report. I am need to pass the value for this formula in VB Runtime.

I don't know how to pass a value for crystal report formula.

Can anyone help me?

Advance Thanks.

Regards,
Suresh.

Try adding a parameter field to the report, passing the parameter value from VB and then use that parameter value in the formula instead of passing the value straight to the formula. Depending on the parameter type and what the formula requires, you may have to cast values. Make the parameter field invisible.

HTH

suresh.cgmohan
Sep 23rd, 2006, 12:15 AM
Hi King_George,

Thans for ur info.

Passing value to Formula field from VB is accomplished.

Now, i am need to know, how to pass the Selection Formula.
Please send me one example in string and integer type.

When i pass the value, 20515 Error Code displays and stops program execution.

I used as below format:

SelecForm = "{ItemMaster.ItemType} = 0"

CrystalReport1.SelectionFormula = SelecForm

ItemMaster.ItemType is Number Type. Database MS Access 2003.

Can you help me?

Advance Thanks,

Regards,
Suresh.

King_George
Sep 23rd, 2006, 11:36 AM
Hi King_George,

Thans for ur info.

Passing value to Formula field from VB is accomplished.

Now, i am need to know, how to pass the Selection Formula.
Please send me one example in string and integer type.

When i pass the value, 20515 Error Code displays and stops program execution.

I used as below format:

SelecForm = "{ItemMaster.ItemType} = 0"

CrystalReport1.SelectionFormula = SelecForm

ItemMaster.ItemType is Number Type. Database MS Access 2003.

Can you help me?

Advance Thanks,

Regards,
Suresh.

www.businessobjects.com has dozens of examples.
or here
http://www.google.ca/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2005-17,GGLD:en&q=error+20515

Arwen@Aragon
Sep 23rd, 2006, 11:52 AM
The example:
With CrystalReport1

.ReportFileName = App.Path & "\RPTInvoice.rpt"
.WindowShowCloseBtn = True
.WindowShowRefreshBtn = True
.WindowState = crptMaximized
.WindowShowSearchBtn = True
.WindowTitle = "Invoice "

criteria = "{FaxOut.Bil}=" & Val(txtBil1) & ""
.SelectionFormula = criteria

.Action = 1
End With