I am now trying to hide hole table dynamicaly but I am having an odd issue
This will not work, none of the table show
var performSubReportTable = performSubReport.Items.Find("table1", true)[0] as Table;var performSubReportTable2 = performSubReport.Items.Find("table2", true)[0] as Table;if (show1 == 1){ performSubReportTable2.DataSource = performanceDataSet; performSubReportTable.Visible = false;}else{ performSubReportTable.DataSource = performanceDataSet; performSubReportTable2.Visible = false;}
This works for the true but the false the none of the table show
var performSubReportTable = new Table();if (show1 == 1){ performSubReportTable = performSubReport.Items.Find("table1", true)[0] as Table;}else{ performSubReportTable = performSubReport.Items.Find("table2", true)[0] as Table;}performSubReportTable.DataSource = performanceDataSet;performSubReportTable.Visible = true;
but this does work
var performSubReportTable = performSubReport.Items.Find("table1", true)[0] as Table;var performSubReportTable2 = performSubReport.Items.Find("table2", true)[0] as Table;performSubReportTable.DataSource = performanceDataSet;performSubReportTable2.DataSource = performanceDataSet;if (show1 == 1) performSubReportTable.Visible = false;else performSubReportTable2.Visible = false;I would prefer if the second method since it is cleaner, but I am not sure why the first two ways wont work.
Then big difference is the first and the third I set the tables to be visible on the report. The second method I set the table visibility to false on the report.