I am using Visual Studio 2010 and I want to make some reports dynamically. I want to display in the reports viewer my own created dataSet and table adapte开发者_StackOverflow社区r. Is this possible? Or it is possible to change the connection string from the dataset at runtime? I have different connections strings which are defined in the settings.xml file and i want to use this strings at connection. Thanks for help!
If you want to have the same report i.e. a "Pie Chart" with different data bound to it then that is already how they work. When you make a report viewer report all you are doing is defining the layout. Data gets bound to it at runtime. So at runtime you could add some logic to bind whatever data set you want to the report.
If you want a truly dynamic report such as sometimes a pie chart sometimes a bar graph I don't know if that is possible. You could make all the options (if there is a limited enough number of them) and pick the right one out of a multiview then bind to it at runtime.
EDIT: To clarify my first point it does require that the data set passed in have the same column number/names. So if you are using vastly different datasets you would need something like my second option if that would work.
精彩评论