I want to pass a sorted dataset table to Crystal Report becuase I think it
might give better performance. I don't think that dataview can be passed as
a datasource to crystal and the sorted result isn't saved to the dataset
table either, right?
I know there used to be a bug with SetDataSource() and you had to sort the
data in a DataView then copy it back into a clone of the original DataTable.
I think this has long been fixed though. The workaround went something like
this:
System.Data.DataTable origTbl; // Your original table
DataView dv;
System.Data.DataTable sortedTbl;
dv = origTbl.DefaultView;
dv.Sort = "col1 asc, col2 asc";
// Copy the sorted view into a new table..
sortedTbl = dv.Table.Clone();
for (int i = 0; i < dv.Count; i++)
{
sortedTbl.ImportRow(dv.Row);
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.