Help with CR 9 for C#.NET
-
I am currently developing an asp.net application that develops crystal reports using the push method. What I am wondering is if I can allow the user to specify sort options during runtime while they are viewing the report information in the .asxp page? For instance I have a report that displays three bits of information about a part(PartNumber,RevisionNumber,CallNumber). I am wondering if I can allow the user to switch between sorting the records by these given fields and just have the page reload with the same data in the newly selected sorted order. Thanks in advance for any help ;P Frank Lepkowski PS Sorry if this is not posted where it should be I was not sure were to stick the post! Live today like it's the last day of your life..........
-
I am currently developing an asp.net application that develops crystal reports using the push method. What I am wondering is if I can allow the user to specify sort options during runtime while they are viewing the report information in the .asxp page? For instance I have a report that displays three bits of information about a part(PartNumber,RevisionNumber,CallNumber). I am wondering if I can allow the user to switch between sorting the records by these given fields and just have the page reload with the same data in the newly selected sorted order. Thanks in advance for any help ;P Frank Lepkowski PS Sorry if this is not posted where it should be I was not sure were to stick the post! Live today like it's the last day of your life..........
Yes you can specify which fields to sort, and there is, IIRC, even an example in the CR for .NET (not C# .NET - any .NET language unless the CR assemblies aren't CLS-compliant, but that only rules out crappy languages like JScript.NET). There are several ways you could do this. You could specify a grouping in your report that accepts parameters. There are several ways to pass those, which are documented in the CR documentation. For example, you could set parameters using the
ReportDocument.DataDefinition
property. You could also design the report to use an ADO.NETDataSet
, which would give you maximum flexibility since you could sort and filter theDataSet
and then set that as the report data source usingReportDefinition.SetDataSource
.Microsoft MVP, Visual C# My Articles
-
Yes you can specify which fields to sort, and there is, IIRC, even an example in the CR for .NET (not C# .NET - any .NET language unless the CR assemblies aren't CLS-compliant, but that only rules out crappy languages like JScript.NET). There are several ways you could do this. You could specify a grouping in your report that accepts parameters. There are several ways to pass those, which are documented in the CR documentation. For example, you could set parameters using the
ReportDocument.DataDefinition
property. You could also design the report to use an ADO.NETDataSet
, which would give you maximum flexibility since you could sort and filter theDataSet
and then set that as the report data source usingReportDefinition.SetDataSource
.Microsoft MVP, Visual C# My Articles