This should answer your question:
// Get the Record selection formula with comments included can only be retrieve via RAS
CrystalDecisions.ReportAppServer.DataDefModel.ISCRFilter myRecordSelectionWithComments; // = new CrystalDecisions.ReportAppServer.DataDefModel.;
myRecordSelectionWithComments = rptClientDoc.DataDefController.DataDefinition.RecordFilter;
if (myRecordSelectionWithComments.FreeEditingText != null)
{
//myRecordSelectionWithComments.FreeEditingText = rptClientDoc.DataDefController.RecordFilterController.GetFormulaText();
btnRecordSelectionForm.Text = myRecordSelectionWithComments.FreeEditingText.ToString();
//myRecordSelectionWithComments.FreeEditingText = @"{Orders.Order ID} = {?My Parameter}";
//IsRpt = false;
}
else
btnRecordSelectionForm.Text = "No Record Selection formula";
// Set the record selection formula
//rpt.RecordSelectionFormula = @"{Orders.Customer ID} IN [2]";
//btnRecordSelectionForm.Text = rpt.RecordSelectionFormula.ToString();
If it doesn't check the text, only reason it would fail.
Try it in CR Designer also and get the selection formula and see what the format is.
Don