~Bean~ Level: VB Guru

 Registered: 07-04-2003 Posts: 488
|
Changing Crystal Header
Chock sent me this question and I am unable to help him...so if anyone can help plz do...
quote: all reports are showing correct except 1 report the data is coming correct but the date in the Group header which i pass from vB is not showing correctly the previous date is showing I also tried by giving Discard Save Data, and also i tried by ticking the check box in the File menu --> Option --> Reporting Tab --> [Discard Saved Date while loading Report] and also I tried by uncheck the box [Save Date With Repot]. Then also its not working.
pfdt = txtpfrom.Text
ptdt = txtpto.Text
If Len(cmbPprod.Text) <= 0 Or cmbPprod.Text = "All" Then
CrystalReport1.ReportFileName = App.Path & "sumcstwisewgt.rpt"
strsf = "{Sales.SoldDate} in Date(" & _
Format(pfdt, "YYYY,M,D") & ") to Date(" & _
Format(ptdt, "YYYY,M,D") & ")"
CrystalReport1.ReplaceSelectionFormula (strsf)
CrystalReport1.Formulas(0) = "fdt='" & pfdt & "'"
CrystalReport1.Formulas(3) = "tdt='" & ptdt & "'"
CrystalReport1.DiscardSavedData = True
CrystalReport1.Action = 1
Else
CrystalReport1.ReportFileName = App.Path & "sumcstwise.rpt"
strsf = "{ST030100.ST03015} in Date(" & _
Format(pfdt, "YYYY,M,D") & ") to Date(" & _
Format(ptdt, "YYYY,M,D") & ")"
CrystalReport1.ReplaceSelectionFormula (strsf)
CrystalReport1.Formulas(0) = "fdt='" & pfdt & "'"
CrystalReport1.Formulas(3) = "tdt='" & ptdt & "'"
CrystalReport1.GroupSelectionFormula = "{ST030100.ST03018}='" & cmbPprod.Text & "'"
CrystalReport1.DiscardSavedData = True
CrystalReport1.Action = 1
End If
CrystalReport1.GroupSelectionFormula = " "
End Sub
____________________________
Eggheads unite! You have nothing to lose but your yolks.
|