ReportViewer in Visual Studio 2019

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi hi everyone in this video i'm going to share with you how you can prepare report to viewer and prepare your first report using visual studio 2019 so let's start i have already prepared a demo application for report viewer first things that you need to do you need to install few extensions if you haven't done so so in order to do that go to extensions menu then click on manage extensions now in manage extensions go to the search box and write rdlc this is going to be our first extension that is required to install into your visual studio so microsoft rdlc report designer so make sure this is installed the other one that you need to install as well you can write reporting the text box and then find or locate microsoft reporting services projects this might take a little time while downloading it depends on the speed of your internet once you're done close visual studio to complete the installation for these two extensions after they are done then reopen visual studio the second step you need to install one package right click on your project go to manage new get packages and then again here write reporting okay so now scroll down to find microsoft dot reporting services dot report keyword control the twin forms and install this package into your project after you're done close now you need to add report viewer first just copy the location where your project is located soon you will know why i need this tip go to the toolbox and locate report viewer if you can't find it then you need to right click any area inside the toolbox and then click choose items then click browse and navigate to your project this is why i copied the path of my project earlier now when you come here go to packages so this is the folder where the packages that you installed reside inside and then open microsoft dot reporting services the one that we installed earlier and and you get then go to lib net 40 and find the dll microsoft.reportviewer. click open once you do this step you will be able to see a report viewer as one of.net framework components then click ok now you should be able to find the control report to viewer so just a drag and drop into your form and then click on the smart small tag here and then click doc in parent container and now we are almost ready now the next step that we need to do that we need to prepare our rdlc report our file report so go to add new item and search for report okay give a name to your report and then click add okay so now i have created my report report1.rdlc and now i'm in design mode so go to your toolbox and then find the control that you need to add i'm going in my case to use table and then here it will show me a wizard asking me to choose my data source the type of data source just keep it as a database click next what type of database model do you want to use data set and it's the only option then here you need to choose your connection string if you haven't set up connection string earlier in your project then just go to new connection and then type here your sql server database instance name okay if you don't know you need you can refer to services inside windows and see what is the name of your sql server instance name and then click on test connection i'm pretty much ready and then i'm going to choose my database click ok now my connection string is ready i click on next and here it's the place where you need to choose your table where the data is coming from if you have a join table joint query then you may think of preparing stop procedure but now the data i'm pitching simply coming from one table then i click you can change the name for your data set or just i am i'm going to keep it with the default name click finish now here you see i got the definition for my fields inside the table now you click ok and here is my table okay now you need to choose what kind of data you need to present inside your report so for example i'm going to show id first name last name and probably i'm interested to show the date of birth okay now the final step that you need to do either you can go to your to your report viewer and click on the smart tag and choose your report from this way or there is another way where just simply you go to the form to your report viewer and then go to the load event and write these lines so the first thing i'm going to call my table adapter okay so this one i didn't program but one when i was setuping but when i was preparing my data set so this was already prepared for me so i'm going to call the table adapter to fill my student data set again these i didn't program those were already taken care by visual studio when i prepared my data set earlier during the process so you call this function and then you specify the report name that you you like to show inside the report viewer so in my case it's report1.rdlc and don't forget to include your namespace this is very important first the namespace then the report name then you go to data sources and add a new report data source here you give the name of your data source which is data set one if you're not sure what is the name for your data set you can go back to your report locate your table go to properties and see the data set name so it's data set one okay so data set one and then simply i'm taking the data from my test one data set okay from the first table which include which includes my data and finally you can call refresh report function now we are ready to observe the output just go to debug start without debugging and here we go if you see that i got my data presented inside my report viewer now for date of birth simply because i don't have any data inside my table so if you check my table i don't have any data for date of birth this is why here the the field for date of birth is empty okay so that's all for how to prepare report to viewer okay so that's all thank you for watching if you have any comments please leave it in the xbox if you have found this video is helpful please don't forget to click like and subscribe to my channel to receive new videos thank you for watching
Info
Channel: Abdulkarim M. Jamal Kanaan
Views: 23,529
Rating: undefined out of 5
Keywords: visual studio 2019, report viewer in visual studio, windows forms with report viewer, winforms with reportviewr, report viewer, report, viewer, visual studio, steps, clearly explained, windows forms, forms, winforms, winform, application, crystal report, reporting services, reporting, excel, pdf, dummies, 2019, best explanation, easy to understand, clearly, intuitive, services
Id: S1XnkKPwwD4
Channel Id: undefined
Length: 9min 6sec (546 seconds)
Published: Fri Nov 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.