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


ykhizar
June 25th, 2008, 05:05 AM
I want to show some specific result in my report while selecting it on run time. I created a report in Crystal report 8.5. Also add a formula filed in my report. But as explain in many treads use it as
cr.formulas(0)="Cotton"
if want to display result only containing cotton. But in VB the when i write cr.for...... i didn't see this property.. If i write myself then it gives error at run time. I add the Crystal report component in the project.

Can some one explain me the complete procedur how to add report in the project may be i'm doing some thing wrong???
Thanks

jggtz
June 26th, 2008, 01:16 AM
For what you say, I imagine that you are using OCX, then the steps to follow are :

1.- Add the Crystal Reports OCX component to the form
2.- The default name of the control is CrystalReport1, you can change it by using properties window
3.- To view a report changing the selection formula use :
(let's say that it's a string type field)


CrystalReport1.ReportFileName = "C:\xxxx\rptName.rpt"
CrystalReport1.SelectionFormula = "{Table1.Field1}='SomeValue' "
CrystalReport1.Action = 1


JG

ykhizar
June 26th, 2008, 02:44 AM
Thanks for the Help. It works.

What to do if want to see a report between two Dates.? Means user gives a starting date & ending Date????

jggtz
June 27th, 2008, 12:34 AM
Something like this :

CrystalReport1.SelectionFormula = "{Table1.Field1}='SomeValue' and {Table1.Date1}>=Date(" & MyStartDate & ") and {Table1.Date1}<=Date(" & MyEndDate & ")"