Crystal Reports .NET
-
I have a situation where I have a Crystal Report pulling data from a database and I want to be able to check a couple of things in the report to determine that it should be printed. Is there a way to pull data out of some fields in the report for verification before printing, or do I have to do a seperate database query in C# to validate such info? If anybody could help me, it'd be appreciated. I've checked MSDN, BusinessObjects, and all the programming sites I can think of to no avail. --In a world without fences, who needs Gates?
-
I have a situation where I have a Crystal Report pulling data from a database and I want to be able to check a couple of things in the report to determine that it should be printed. Is there a way to pull data out of some fields in the report for verification before printing, or do I have to do a seperate database query in C# to validate such info? If anybody could help me, it'd be appreciated. I've checked MSDN, BusinessObjects, and all the programming sites I can think of to no avail. --In a world without fences, who needs Gates?
SignMan359, An alternative would be to get a
DataSet
yourself using aDataAdapter
derivative (like aSqlDataAdapter
) and use that to populate the report by callingReportDocument.SetDataSource
. When designing your report, you can bind against an strongly typed ADO.NETDataSet
. Read Reporting off ADO.NET Datasets[^] for details. This would allow you, then, to get theDataSet
, check any rows in tables you want, then decide whether or not to instantiate yourReportDocument
-derivative that you've designed, set the data source, and display it. This way you can also control whether the report and report viewer are even instantiated in the first place. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]