Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting SubReports

Status
Not open for further replies.

Lyckosam

Programmer
Feb 9, 2004
2
US
Is there a way to sort subreport at run time ? I can sort the main report but having a difficult time to sort a subreport at run time.
 
Do you mean altering the sortation at runtime? Runtime being from within Crystal or external code?

You might create a parameter to alter sortation, but you might consider posting technical information, such as Crystal version, etc.

This sort of post simply leads to additional requests for information.

-k
 
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top