Page 1 of 1

Refresh Button

Posted: Mon Dec 03, 2007 11:16 pm
by mmurdock
Is it possible to have a "Refresh" button on the preview screen just like there is on preview screen in design mode?

Thanks,

Mat

Refresh Button

Posted: Tue Dec 04, 2007 10:45 am
by Ralph
Hi Mat,

I do this, and it works for me:

Code: Select all

private void buttonAktualisieren_Click(object sender, EventArgs e)
        {
            boBestellMengen.FillByBestellmenge();
            if (boBestellMengen.Count > 0)
            {
                stiPreviewControl.Enabled = true;
                boAbsender.FillTop1();
                boBestellArtikel.FillByParent();

                bestellDataSet.Clear();
                bestellDataSet.Tables[boBestellMengen.TableName].Load(boBestellMengen.CurrentView.Table.CreateDataReader(), LoadOption.OverwriteChanges);
                bestellDataSet.Tables[boBestellArtikel.TableName].Load(boBestellArtikel.CurrentView.Table.CreateDataReader(), LoadOption.OverwriteChanges);

                stiReport.Render();
            }
            else
            {
                stiPreviewControl.Enabled = false;
                this.ShowMessage("mboxNoOrderEntries");
            }
        }
I think the main thing is to reload the data (in case they are changed, but otherwise a refresh wouldn't make much sense in preview) and then do a 'stiReport.Render()'

HTH, Ralph


Refresh Button

Posted: Tue Dec 04, 2007 5:52 pm
by mmurdock
I want the refresh so that It pops up my form again that allows the user to set report filters and then rerun the data.

Mat

Refresh Button

Posted: Tue Dec 04, 2007 6:04 pm
by Brendan
There's a setting you can apply to your form so that it sort of becomes docked on the top of the preview window
You need to set the "Start Mode" property of your form to "On Preview"

You also need to make sure your form is ordered before your Report Page. Press Ctrl+F4 to bring up the Pages Manager and move your form above the page.

Refresh Button

Posted: Wed Dec 05, 2007 9:40 am
by mmurdock
Well I like that. One improvement would be to put it on the left side of the screen instead of the top.

Mat

Refresh Button

Posted: Wed Dec 05, 2007 9:56 am
by mmurdock
So this is weird. If I set it up as you have described and I type in the values for my filters and press my ok button the "Preparing Report" dialog box flashes real quick on the screen and nothing is displayed in the report. If I press my ok button again then the report runs as desired. If I change the start mode back to "On Start" everything works as expected.

Mat