Thanks for your reply...
I am preety new to Crystal reports so pardon my questions or comments...
I am using Crystal Reports for .Net
I use XML schema as the DataSet....
This is how i sort my main Report :
FieldDefinition FieldDef = null;
try{FieldDef = tr3.Database.Tables[1].Fields[this.cmbSort.Text];}
catch{}
if(FieldDef != null)
{
if(tr3.DataDefinition.SortFields.Count > 0)
{
tr3.DataDefinition.SortFields[0].Field = FieldDef;
if(this.rdBtnAsc.Checked == true)
{
tr3.DataDefinition.SortFields[0].SortDirection = SortDirection.AscendingOrder ;
}
else
{
tr3.DataDefinition.SortFields[0].SortDirection = SortDirection.DescendingOrder ;
}
}
}
and it works absolutely fine...
I have a sub report in this main report :
I use the same above function to sort it ...but it doesn't work.
the only difference is instead of {FieldDef = tr3.Database.Tables[1].Fields[this.cmbSort.Text];}
i use
{FieldDef = tr3.Database.Tables[0].Fields[this.cmbSort.Text];}
I make it sort on the Column Name which the user can choose from a drop down list..
If you need any other information pls let me know...
If there is any other way i can make it sort i would appreciate your help.....
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.