PDA

Click to See Complete Forum and Search --> : Help with formula


anil_295
Nov 1st, 2006, 03:28 AM
Im using CR 10 and VB 6.0
problem: cant get report of ticket no 3. I get by default 1st and hav to navigate from CRviewer.


My code

Private Sub Form_Load()
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport("d:\BusTkt.rpt")

CRViewer1.ReportSource = Report
CRViewer1.SearchByFormula "{Bus_Ticket.Ticket_Number} = '3'"
CRViewer1.ViewReport
End Sub

shakti5385
Nov 1st, 2006, 03:37 AM
Are you not getting the report of ticket number 3 or you are not getting the 2 or 1 also.
Read the crystal report tutorial at my signature post 1, 2 and 3 where I give some example related to the formulas in the CR.

shukla
Nov 1st, 2006, 04:16 AM
if Bus_Ticket.Ticket_Number is of number type then do not use '

shakti5385
Nov 1st, 2006, 04:27 AM
Check the option in the file menu if the save data with report is true then remove it.

anil_295
Nov 1st, 2006, 10:50 AM
are u guys sure that we can use selection formula with CRviewer.

I know we can use it in cr 8.8 but not sure if we can use in CR10.

I m getting all the records but i want the report of a selected record.

shakti5385
Nov 1st, 2006, 12:21 PM
Have you tried for the seletion formula , it will also work there, have you try for it!
Just add the crystal report tutorial at my signature and see how to use the selection forumula with different time.

anil_295
Nov 1st, 2006, 12:26 PM
but when i type . after CRviewer1 i dont get selection formula option.

shakti5385
Nov 1st, 2006, 12:42 PM
CRViewer1.SearchByFormula

Use this but it is better then if you use the crystal report control instead of the crviewer, so using this you get some more property and able to use the multiple report at a time

anil_295
Nov 2nd, 2006, 03:15 AM
i hav CR10 which doesnt hav CRYSTAL REPORT CONTROL ONLY HAS VIEWER.

shyam_s
Nov 2nd, 2006, 09:34 AM
anil_295 says....
but when i type . after CRviewer1 i dont get selection formula option......

I'm new to CR lateste versions, but just a thought.

Shouldn’t "SearchByFormula" be collection of Report object-in your case Report- rather than of CRViewer

try looking for Report.DataDefinition.RecordSelectionFormula

I'm not sure this will work, but just trying to throw an idea...