Current filter:
                                You should refresh the page.
                                  • I have a report supported by a dataSet which contains two queries (see the attached screen shot).  One of the queries called Query, which sometimes contains no data row at all.  I need to find this out in report_BeforePrint.  Otherwise, the report will fail unexpectedly.

                                    My question is how can I access this query called "Query".  If I can access this query, then I should be able to use its row count to know if it's empty or not.

                                    Please give me some help.  Thanks.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,
                                If the Query table is specified as a report's DataMember property, you can use the XtraReport.RowCount property to obtain the number of records in a data source. In other cases, you can handle the XtraReport.DataSourceDemanded event in the following manner:

                                [C#]
                                private void Report1_DataSourceDemanded(object sender, EventArgs e) { DataSet ds = DataSource as DataSet; int rows = ds.Tables["Query"].Rows.Count; }

                                Should you have further questions, let me know.