all groups > sql server reporting services > october 2007 >
You're in the sql server reporting services group:
loading a report in a windows application using reportviewer
sql server reporting services:
I have a windows application which displays a remote report using the reportviewer. It works fine except on the form load it runs the report. I rather the report just display instead of running. This is a problem for two reasons: 1. My report has parameters. Since no parameters have been chosen, the report runs with an error "The 'parametername' is missing a value". I'd rather let the user choose the parameters and then run the report. 2. Since the report runs on the form load event, it takes a long time for my form to load. Is there a way to just display the report without running it? If I exclude Me.ReportViewer1.RefreshReport() on the load event, the reportviewer is blank. Is there another method I could use? This seems like it would really easy, but I can't find anything. Thanks for your help. Billy
You could simply add a local report that shows some static information (so it loads quickly) to your project and has it loaded when the form is loading. Then on the form, you provide ways for user to input report parameters and only then load remote reports from reporting services server. [quoted text, click to view] <billyburditt@gmail.com> wrote in message news:1193853373.827654.34710@57g2000hsv.googlegroups.com... >I have a windows application which displays a remote report using the > reportviewer. It works fine except on the form load it runs the > report. I rather the report just display instead of running. This is > a problem for two reasons: > > 1. My report has parameters. Since no parameters have been chosen, > the report runs with an error "The 'parametername' is missing a > value". I'd rather let the user choose the parameters and then run > the report. > > 2. Since the report runs on the form load event, it takes a long time > for my form to load. > > Is there a way to just display the report without running it? If I > exclude Me.ReportViewer1.RefreshReport() on the load event, the > reportviewer is blank. Is there another method I could use? > > This seems like it would really easy, but I can't find anything. > Thanks for your help. > > Billy >
[quoted text, click to view] On Oct 31, 3:08 pm, "Norman Yuan" <NoAddr...@NoEmail.fake> wrote: > You could simply add a local report that shows some static information (so > it loads quickly) to your project and has it loaded when the form is > loading. Then on the form, you provide ways for user to input report > parameters and only then load remote reports from reporting services server. > > <billyburd...@gmail.com> wrote in message > > news:1193853373.827654.34710@57g2000hsv.googlegroups.com... > > > > >I have a windows application which displays a remote report using the > > reportviewer. It works fine except on the form load it runs the > > report. I rather the report just display instead of running. This is > > a problem for two reasons: > > > 1. My report has parameters. Since no parameters have been chosen, > > the report runs with an error "The 'parametername' is missing a > > value". I'd rather let the user choose the parameters and then run > > the report. > > > 2. Since the report runs on the form load event, it takes a long time > > for my form to load. > > > Is there a way to just display the report without running it? If I > > exclude Me.ReportViewer1.RefreshReport() on the load event, the > > reportviewer is blank. Is there another method I could use? > > > This seems like it would really easy, but I can't find anything. > > Thanks for your help. > > > Billy- Hide quoted text - > > - Show quoted text -
So there's no way to just load a remote report instead of running it? That seems strange.
I am using the control and using it with remote controls. The report does not run automatically unless the report on the server either has no parameters or if the parameters all have defaults (i.e. the same behavior if you were running the report from Report Manager). I am not getting an error. Are you showing the parameters area? I have a single form with the reportviewer control. f is the form with the reportviewer control. f.ReportViewer1.ServerReport.ReportPath = ReportName The user enters parameters just like if they were using Report Manager. Are you hiding the parameter section and then calling SetParameters? You are doing something out of sequence. You can definitely use the control where you do not get an attempt at rendering before you want it to (with the caveat that one of your parameters on the report must not have a default assigned to it). -- Bruce Loehle-Conger MVP SQL Server Reporting Services [quoted text, click to view] <billyburditt@gmail.com> wrote in message news:1193929999.057051.296350@z9g2000hsf.googlegroups.com... > On Oct 31, 3:08 pm, "Norman Yuan" <NoAddr...@NoEmail.fake> wrote: >> You could simply add a local report that shows some static information >> (so >> it loads quickly) to your project and has it loaded when the form is >> loading. Then on the form, you provide ways for user to input report >> parameters and only then load remote reports from reporting services >> server. >> >> <billyburd...@gmail.com> wrote in message >> >> news:1193853373.827654.34710@57g2000hsv.googlegroups.com... >> >> >> >> >I have a windows application which displays a remote report using the >> > reportviewer. It works fine except on the form load it runs the >> > report. I rather the report just display instead of running. This is >> > a problem for two reasons: >> >> > 1. My report has parameters. Since no parameters have been chosen, >> > the report runs with an error "The 'parametername' is missing a >> > value". I'd rather let the user choose the parameters and then run >> > the report. >> >> > 2. Since the report runs on the form load event, it takes a long time >> > for my form to load. >> >> > Is there a way to just display the report without running it? If I >> > exclude Me.ReportViewer1.RefreshReport() on the load event, the >> > reportviewer is blank. Is there another method I could use? >> >> > This seems like it would really easy, but I can't find anything. >> > Thanks for your help. >> >> > Billy- Hide quoted text - >> >> - Show quoted text - > > So there's no way to just load a remote report instead of running it? > That seems strange. >
On Nov 1, 10:29 am, "Bruce L-C [MVP]" <bruce_lcNOS...@hotmail.com> [quoted text, click to view] wrote: > I am using the control and using it with remote controls. The report does > not run automatically unless the report on the server either has no > parameters or if the parameters all have defaults (i.e. the same behavior if > you were running the report from Report Manager). I am not getting an error. > Are you showing the parameters area? I have a single form with the > reportviewer control. f is the form with the reportviewer control. > f.ReportViewer1.ServerReport.ReportPath = ReportName > > The user enters parameters just like if they were using Report Manager. Are > you hiding the parameter section and then calling SetParameters? > > You are doing something out of sequence. You can definitely use the control > where you do not get an attempt at rendering before you want it to (with the > caveat that one of your parameters on the report must not have a default > assigned to it). > > -- > Bruce Loehle-Conger > MVP SQL Server Reporting Services > > <billyburd...@gmail.com> wrote in message > > news:1193929999.057051.296350@z9g2000hsf.googlegroups.com... > > > > > On Oct 31, 3:08 pm, "Norman Yuan" <NoAddr...@NoEmail.fake> wrote: > >> You could simply add a local report that shows some static information > >> (so > >> it loads quickly) to your project and has it loaded when the form is > >> loading. Then on the form, you provide ways for user to input report > >> parameters and only then load remote reports from reporting services > >> server. > > >> <billyburd...@gmail.com> wrote in message > > >>news:1193853373.827654.34710@57g2000hsv.googlegroups.com... > > >> >I have a windows application which displays a remote report using the > >> > reportviewer. It works fine except on the form load it runs the > >> > report. I rather the report just display instead of running. This is > >> > a problem for two reasons: > > >> > 1. My report has parameters. Since no parameters have been chosen, > >> > the report runs with an error "The 'parametername' is missing a > >> > value". I'd rather let the user choose the parameters and then run > >> > the report. > > >> > 2. Since the report runs on the form load event, it takes a long time > >> > for my form to load. > > >> > Is there a way to just display the report without running it? If I > >> > exclude Me.ReportViewer1.RefreshReport() on the load event, the > >> > reportviewer is blank. Is there another method I could use? > > >> > This seems like it would really easy, but I can't find anything. > >> > Thanks for your help. > > >> > Billy- Hide quoted text - > > >> - Show quoted text - > > > So there's no way to just load a remote report instead of running it? > > That seems strange.- Hide quoted text - > > - Show quoted text -
I still can't get this to work. I removed all parameter default values in my report, and it's still tries to run the report on the load event. (Previously, only some parameters had defaults, but I removed all to see if that would make a difference.) When I created my reports I didn't write any code. I just dragged the reportviewer on the form, and set all the properties in design mode. You can set the Processing Mode, ReportPath, ReportServerUrl through the properties window in designer. Once you place a reportview on a form, it automatically inserts Me.ReportViewer1.RefreshReport() on the load event. Should I set the properties in runtime instead of design mode? If so, what order should I set those properties?
On Nov 2, 4:11 pm, "Bruce L-C [MVP]" <bruce_lcNOS...@hotmail.com> [quoted text, click to view] wrote: > Try commenting out this line: > Me.ReportViewer1.RefreshReport() > > I am pretty sure that it isn't needed. That it causes the report to run. > Then when they select the parameters and run the report it should work for > you. > > -- > Bruce Loehle-Conger > MVP SQL Server Reporting Services > > <billyburd...@gmail.com> wrote in message > > news:1194013543.304010.304400@d55g2000hsg.googlegroups.com... > > > > > On Nov 1, 10:29 am, "Bruce L-C [MVP]" <bruce_lcNOS...@hotmail.com> > > wrote: > >> I am using the control and using it with remote controls. The report > >> does > >> not run automatically unless the report on the server either has no > >> parameters or if the parameters all have defaults (i.e. the same behavior > >> if > >> you were running the report from Report Manager). I am not getting an > >> error. > >> Are you showing the parameters area? I have a single form with the > >> reportviewer control. f is the form with the reportviewer control. > >> f.ReportViewer1.ServerReport.ReportPath = ReportName > > >> The user enters parameters just like if they were using Report Manager. > >> Are > >> you hiding the parameter section and then calling SetParameters? > > >> You are doing something out of sequence. You can definitely use the > >> control > >> where you do not get an attempt at rendering before you want it to (with > >> the > >> caveat that one of your parameters on the report must not have a default > >> assigned to it). > > >> -- > >> Bruce Loehle-Conger > >> MVP SQL Server Reporting Services > > >> <billyburd...@gmail.com> wrote in message > > >>news:1193929999.057051.296350@z9g2000hsf.googlegroups.com... > > >> > On Oct 31, 3:08 pm, "Norman Yuan" <NoAddr...@NoEmail.fake> wrote: > >> >> You could simply add a local report that shows some static information > >> >> (so > >> >> it loads quickly) to your project and has it loaded when the form is > >> >> loading. Then on the form, you provide ways for user to input report > >> >> parameters and only then load remote reports from reporting services > >> >> server. > > >> >> <billyburd...@gmail.com> wrote in message > > >> >>news:1193853373.827654.34710@57g2000hsv.googlegroups.com... > > >> >> >I have a windows application which displays a remote report using the > >> >> > reportviewer. It works fine except on the form load it runs the > >> >> > report. I rather the report just display instead of running. This > >> >> > is > >> >> > a problem for two reasons: > > >> >> > 1. My report has parameters. Since no parameters have been chosen, > >> >> > the report runs with an error "The 'parametername' is missing a > >> >> > value". I'd rather let the user choose the parameters and then run > >> >> > the report. > > >> >> > 2. Since the report runs on the form load event, it takes a long > >> >> > time > >> >> > for my form to load. > > >> >> > Is there a way to just display the report without running it? If I > >> >> > exclude Me.ReportViewer1.RefreshReport() on the load event, the > >> >> > reportviewer is blank. Is there another method I could use? > > >> >> > This seems like it would really easy, but I can't find anything. > >> >> > Thanks for your help. > > >> >> > Billy- Hide quoted text - > > >> >> - Show quoted text - > > >> > So there's no way to just load a remote report instead of running it? > >> > That seems strange.- Hide quoted text - > > >> - Show quoted text - > > > I still can't get this to work. I removed all parameter default > > values in my report, and it's still tries to run the report on the > > load event. (Previously, only some parameters had defaults, but I > > removed all to see if that would make a difference.) > > > When I created my reports I didn't write any code. I just dragged the > > reportviewer on the form, and set all the properties in design mode. > > You can set the Processing Mode, ReportPath, ReportServerUrl through > > the properties window in designer. Once you place a reportview on a > > form, it automatically inserts Me.ReportViewer1.RefreshReport() on the > > load event. > > > Should I set the properties in runtime instead of design mode? If so, > > what order should I set those properties?- Hide quoted text - > > - Show quoted text -
When I remove that line, my report doesn't show at all. I just get a disabled reportview toolbar (navigation, print, export, etc). Is there another line of code that needs to be added to load the report?
Try commenting out this line: Me.ReportViewer1.RefreshReport() I am pretty sure that it isn't needed. That it causes the report to run. Then when they select the parameters and run the report it should work for you. -- Bruce Loehle-Conger MVP SQL Server Reporting Services [quoted text, click to view] <billyburditt@gmail.com> wrote in message news:1194013543.304010.304400@d55g2000hsg.googlegroups.com... > On Nov 1, 10:29 am, "Bruce L-C [MVP]" <bruce_lcNOS...@hotmail.com> > wrote: >> I am using the control and using it with remote controls. The report >> does >> not run automatically unless the report on the server either has no >> parameters or if the parameters all have defaults (i.e. the same behavior >> if >> you were running the report from Report Manager). I am not getting an >> error. >> Are you showing the parameters area? I have a single form with the >> reportviewer control. f is the form with the reportviewer control. >> f.ReportViewer1.ServerReport.ReportPath = ReportName >> >> The user enters parameters just like if they were using Report Manager. >> Are >> you hiding the parameter section and then calling SetParameters? >> >> You are doing something out of sequence. You can definitely use the >> control >> where you do not get an attempt at rendering before you want it to (with >> the >> caveat that one of your parameters on the report must not have a default >> assigned to it). >> >> -- >> Bruce Loehle-Conger >> MVP SQL Server Reporting Services >> >> <billyburd...@gmail.com> wrote in message >> >> news:1193929999.057051.296350@z9g2000hsf.googlegroups.com... >> >> >> >> > On Oct 31, 3:08 pm, "Norman Yuan" <NoAddr...@NoEmail.fake> wrote: >> >> You could simply add a local report that shows some static information >> >> (so >> >> it loads quickly) to your project and has it loaded when the form is >> >> loading. Then on the form, you provide ways for user to input report >> >> parameters and only then load remote reports from reporting services >> >> server. >> >> >> <billyburd...@gmail.com> wrote in message >> >> >>news:1193853373.827654.34710@57g2000hsv.googlegroups.com... >> >> >> >I have a windows application which displays a remote report using the >> >> > reportviewer. It works fine except on the form load it runs the >> >> > report. I rather the report just display instead of running. This >> >> > is >> >> > a problem for two reasons: >> >> >> > 1. My report has parameters. Since no parameters have been chosen, >> >> > the report runs with an error "The 'parametername' is missing a >> >> > value". I'd rather let the user choose the parameters and then run >> >> > the report. >> >> >> > 2. Since the report runs on the form load event, it takes a long >> >> > time >> >> > for my form to load. >> >> >> > Is there a way to just display the report without running it? If I >> >> > exclude Me.ReportViewer1.RefreshReport() on the load event, the >> >> > reportviewer is blank. Is there another method I could use? >> >> >> > This seems like it would really easy, but I can't find anything. >> >> > Thanks for your help. >> >> >> > Billy- Hide quoted text - >> >> >> - Show quoted text - >> >> > So there's no way to just load a remote report instead of running it? >> > That seems strange.- Hide quoted text - >> >> - Show quoted text - > > I still can't get this to work. I removed all parameter default > values in my report, and it's still tries to run the report on the > load event. (Previously, only some parameters had defaults, but I > removed all to see if that would make a difference.) > > When I created my reports I didn't write any code. I just dragged the > reportviewer on the form, and set all the properties in design mode. > You can set the Processing Mode, ReportPath, ReportServerUrl through > the properties window in designer. Once you place a reportview on a > form, it automatically inserts Me.ReportViewer1.RefreshReport() on the > load event. > > Should I set the properties in runtime instead of design mode? If so, > what order should I set those properties? > > > > > >
Don't see what you're looking for? Try a search.
|
|
|