none
reports not loading RRS feed

  • Question

  • I am having trouble with the following.  The combo box contains a list of dates from which the user can select.  There are 3 tabs in the form, each containing a report.  The date selected is the prompt for the stored procedures used to fill the reports.  When I run it, the first report loads fine when a date is selected, but the other two reports just show the green spinning thing with text indicating the report is loading.  When the user chooses another date from the drop down, all three reports then load successfully.  Also, if the user clicks on the second or third tab prior to choosing a date from the drop down, all three reports load successfully.  Any assistance would be greatly appreciated.

     

     

    namespace TRSReports

    {

    public partial class frmTRSReports : Form

    {

    public frmTRSReports()

    {

    InitializeComponent();

    }

    private void Form1_Load(object sender, EventArgs e)

    {

    this.getPayPeriodStartTableAdapter.Fill(this.timeReportingDataSet.GetPayPeriodStart);

    cmboPayPeriodStart.Text = "SELECT PAY PERIOD START";

    cmboPayPeriodStart.Focus();

    }

    private void cmboPayPeriodStart_SelectedIndexChanged(object sender, EventArgs e)

    {

    DateTime selpayper;

    selpayper = Convert.ToDateTime(cmboPayPeriodStart.SelectedValue);

    if (selpayper == DateTime.MinValue)

    {

    cmboPayPeriodStart.SelectedValue = DBNull.Value;

    }

    else

    {

    cmboPayPeriodStart.SelectedValue = selpayper;

    this.rptGetLeaveDetailTableAdapter.Fill(this.timeReportingDataSet.RPTGetLeaveDetail, selpayper);

    this.rptGetTotalHoursTableAdapter.Fill(this.timeReportingDataSet.RPTGetTotalHours, selpayper);

    this.rptGetTimesheetStatusTableAdapter.Fill(this.timeReportingDataSet.RPTGetTimesheetStatus, selpayper);

    }

    tabctrlTRSReports.Focus();

    rptLeaveDetail.RefreshReport();

    rptMinHours.RefreshReport();

    rptStatus.RefreshReport();

    }

    }

    }

     

    Tuesday, April 8, 2008 5:37 PM

Answers

  • For those who are interested, this is what I came up with.  I don't imagine it's the best solution, but it seems to work.  I repeated the 'RefreshReport' statements in the report loads.  *shrug*

     

    namespace TRSReports

    {

    public partial class frmTRSReports : Form

    {

    public frmTRSReports()

    {

    InitializeComponent();

    }

    private void Form1_Load(object sender, EventArgs e)

    {

    this.getPayPeriodStartTableAdapter.Fill(this.timeReportingDataSet.GetPayPeriodStart);

    cmboPayPeriodStart.Text = "SELECT PAY PERIOD START";

    cmboPayPeriodStart.Focus();

    }

    private void cmboPayPeriodStart_SelectedIndexChanged(object sender, EventArgs e)

    {

    DateTime selpayper;

    selpayper = Convert.ToDateTime(cmboPayPeriodStart.SelectedValue);

    if (selpayper == DateTime.MinValue)

    {

    cmboPayPeriodStart.SelectedValue = DBNull.Value;

    }

    else

    {

    cmboPayPeriodStart.SelectedValue = selpayper;

    this.rptGetLeaveDetailTableAdapter.Fill(this.timeReportingDataSet.RPTGetLeaveDetail, selpayper);

    this.rptGetTotalHoursTableAdapter.Fill(this.timeReportingDataSet.RPTGetTotalHours, selpayper);

    this.rptGetTimesheetStatusTableAdapter.Fill(this.timeReportingDataSet.RPTGetTimesheetStatus, selpayper);

    }

    tabctrlTRSReports.Focus();

    rptLeaveDetail.RefreshReport();

    rptMinHours.RefreshReport();

    rptStatus.RefreshReport();

    }

    private void rptLeaveDetail_Load(object sender, EventArgs e)

    {

    rptLeaveDetail.RefreshReport();

    }

    private void rptMinHours_Load(object sender, EventArgs e)

    {

    rptMinHours.RefreshReport();

    }

    private void rptStatus_Load(object sender, EventArgs e)

    {

    rptStatus.RefreshReport();

    }

    }

    }

    • Marked as answer by bukkybu Friday, March 27, 2009 8:44 PM
    Thursday, April 10, 2008 9:47 PM