Hi All...
Recently i Upgraded my Crystal Reports R2 from Service pack 1 to ServicePack 4 but so far i am regretting it all the way. I hope that you guys can please help me with some answers as to this question.
Previously the report worked 100% but since i upgraded it looks like the Record Selection Formula does not get send through to the reportDocument anymore. Can you please help me and tell me how i can fix this problem. When the report displays on the page i see all the info in the database since day 1.
My Settings looks as follow.
Development PC:
Operating System : Windows XP
Development Enviroment : Visual Studio 2005 (VB.Net)
Crystal Reports Version : CR XI R2
Application Type : Desktop Application
Code:
'Global Variable Declaration
Public rd As New ReportDocument
'Function that generates the Selection Formula and display the report
Public Sub BuildReport()
Try
Dim sSql As String = ""
Select Case Me.sFunction
Case "GoodsRecievedNote"
sSql = "{tblGoodsRecievedNotes.GoodsRecievedNoteNumber}='" & sDocNumber & "'"
Cursor = Cursors.WaitCursor
rd.Load(Path.GetFullPath(Application.StartupPath & "\rptGoodsRecievedNote.rpt"))
rd.RecordSelectionFormula = sSql
rd.Refresh()
Case "Quotation"
sSql = "{tblQuotations.QuoteNumber}='" & sDocNumber & "'"
Cursor = Cursors.WaitCursor
rd.Load(Path.GetFullPath(Application.StartupPath & " \rptQuotation.rpt"))
rd.RecordSelectionFormula = sSql
rd.Refresh()
End Select
Me.crView.ReportSource = rd
Me.crView.Zoom(85)
Cursor = Cursors.Arrow
Catch ex As Exception
ReportError(ex.ToString, Err.Description)
End Try
End Sub
See if the following will help resolve the issue:
Expand Form1.vb|cs to show Form1.Designer.vb|cs.
Double-click on Form1.Designer.vb|cs to show it's code.
In the InitializeComponent method, you will find code where the CrystalReportViewer1 properties are set.
Comment out or delete the following two lines:
this.crystalReportViewer.SelectionFormula = ""
this.crystalReportViewer.ViewTimeSelectionFormula = ""
Ludek
Hi Ludek
I rushed to my Code this morning when i saw a reply from you and looked for the two lines that you refered and took them out as quickly as possible and boom!!!
it worked 100% for me thank you.
Any explination as to why this happens only after the Service pack updates?
Thank you.
Edited by: Gremlin1708 on Sep 18, 2009 9:07 AM
Umm, well yes - I think. But then I'd be putting other people in an unfavorable light, if you know what I mean... :).
Ludek