• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 946
  • Last Modified:

Error in formula <Record_Selection>. AND GROUP IN NEW PAGE

dear all
i have table students ( student_no , student _ name _student_location_Register_date, Student_country, Student_nationality )

i uam using vb6 and crystal report 7


i make the report with 4 groups
group 1= nationality
group 2= country
group 3=Locatioin
group 4=Student Number

and i call the report from the vb6 every thing is ok
no problems there

now if i make selection formula for  any field it give me error

?err.Description
Error in formula  <Record_Selection>.
'
'
The remaining text does not appear to be part of the formula.

this error drive me crazy always in grouping report

if i remove the selection formula
the  report run without any problems



AND HOW I CAN MAKE EACH GROUP IN NEW PAGE ????


any idea
thanx



0
abdulhameeds
Asked:
abdulhameeds
  • 7
  • 3
2 Solutions
 
FER_GCommented:
could you put the selection formula to see if this has any error...
For the groups, you must enter to the section expert of each group and set "New page before" checkbox

Regards...
FerG
--
Saludos.
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
0
 
abdulhameedsAuthor Commented:

    rpt.WindowShowCloseBtn = True
    rpt.WindowShowPrintSetupBtn = True
    rpt.WindowShowSearchBtn = True
    rpt.ReportFileName = App.Path & "\SalesAnalisys.rpt"
   
   
    'nothing
   If MaskEdBox1.Text = "__/__/____" And Text1.Text = "" Then
   
   End If
   
   
      'date
   If MaskEdBox1.Text <> "__/__/____" And Text1.Text = "" Then
   rpt.SelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"
   End If
         
   
   
    rpt.Connect = "dsn = erp"
    rpt.DiscardSavedData = True
    rpt.WindowState = crptMaximized
    rpt.Action = 1
    rpt.Destination = crptToWindow

SalesAnalisys.txt
0
 
FER_GCommented:
Can you prove the next line?...
rpt.SelectionFormula = "{table.field} >= DATE(2007,01,12) AND  {table.field} <= DATE(2007,12,12)"

(prove this 2 fixed dates, so you can know if the code works)
I don't know if your table name is "rpt_salesAnqalysis" and the fieldName is "Date", so you must know that you must put {TableName.FieldName} to filter the records...

And I always use...

rpt.Connect = "dsn = erp"
rpt.ReportFileName = App.Path & "\SalesAnalisys.rpt"
rpt.SelectionFormula = ...
rpt.DiscardSavedData = True
rpt.WindowState = crptMaximized
rpt.WindowState = crptMaximized
rpt.Destination = crptToWindow
rpt.Action = 1

IN this order...


FerG
--
Saludos.
Ing. Fernando D. Giletta
San Fco. Cba. Arg.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
abdulhameedsAuthor Commented:
FER_G: thank you i will try and i will inform u
0
 
FER_GCommented:
YOU'RE WELCOME, I HOPE THAT IT COULD HELP YOU
0
 
mlmccCommented:
You might also try

 rpt.ReplaceSelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"

mlmcc
0
 
abdulhameedsAuthor Commented:
FER_G
and i use the order you give it to me up also the same problem
when i  make fixed firmula it give me error so its not runnig  


0
 
abdulhameedsAuthor Commented:
mlmcc

when i use this
rpt.ReplaceSelectionFormula = "{rpt_salesAnqalysis.Date} in DateTime (2007, 01, 12,00, 00, 00) to DateTime (" & Format(mask2.Text, "yyyy ,mm ,dd") & ")"

it give me error argument  not  optional
0
 
abdulhameedsAuthor Commented:
see this
untitled.bmp
0
 
abdulhameedsAuthor Commented:
the ereport pic
untitled.bmp
0
 
abdulhameedsAuthor Commented:
thanks all for your help
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now