Question

In am making visual basic forms to learn SSRS (don't worry about the SSRS). Each form points to a .rdlc file which is an XML file that holds the GUI/Look and feel of the form and also the SQL to pull data for the form.

My problem is that when I keep the form 2 tab active and debug the app, the report for form 1 is displayed. I realized that this happens because, in project properties, the startup form is form 1. I changed that to form2 and got the desired report to run.

But, I cannot change the startup form like this for every new form that is added. How do I simply do away with this "startup form" thing and see only the form which I to execute ?

My project structure -

enter image description here

Was it helpful?

Solution

What you're seeing is exactly what you should be seeing. Can I ask why exactly it's such a chore to change the startup form each time? It takes about 3 seconds max.

Anyway, if you don't want to have to change the startup form then you're going to have to do something else that takes as much work. There are a number of options.

  1. I would think that the most sensible option would be to just have one form with one ReportViewer control and then have some mechanism for selecting a report on that form, e.g. a ComboBox.

  2. You can disable the Application Framework and use your own Main method. You can then specify your own startup form in that method.

  3. Create a separate startup form and place a Button on it for each of the other forms, allowing you to display any report you want at any time.

There would be other options too but, really, none of the options are any simpler than taking 3 seconds change the project startup form. If that's really to much effort then you probably ought to give up programming now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top