Refresh Button

Stimulsoft Reports.NET discussion
Post Reply
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Refresh Button

Post 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
Ralph
Posts: 7
Joined: Wed Sep 19, 2007 7:19 am
Location: Germany

Refresh Button

Post 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

mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Refresh Button

Post 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
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Refresh Button

Post 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.
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Refresh Button

Post 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
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Refresh Button

Post 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
Post Reply