Displaying RDLC report in WinForms .Net 6 application Using Visual Studio 2022

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone we will talk about reporting in.net we will make four projects two four win forms and two for and of which one of each will be for will be targeting net framework and other will be targeting dot net core we will just try to demonstrate how to display reports in various environments and it will be just basic a basic report in the beginning and then we might add some tutorials about creating and designing reports but initially we will just make projects to display the words in this variable in this various environments our first video will be about creating the initial solution then we will add videos to demonstrate the report the displaying of reports in various settings i am sorry for my slow speech and for the sound quality this is the best that i can do right now and my english is i am not a fluent speaker i will just you will just have to bear with me see you in an end so we will open visual studio create a new project now we will first start by creating a windows forms that target dot net 6 project all right let's select the windows forms app not all right we will name rule number two all right the first thing you should do is to go to extensions manage extensions in the search type rdlc you'll find the microsoft rdlc reward designer 2022 all right if you haven't installed it yet just click here and click here download this will prompt you to close visual studio and install this extension then do so just install this extension and then restart the visual studio okay after installing the the extension the second step is to add the reward viewer nuget package you should go to solution explorer right click your project manage nuget packages here click browse now remember we are targeting dotnet 6 are using one forms project and we are targeting targeting dot net sex for the net checks you should search for this nugget package reverse viewer core the twin forms alright click on it then click install all right after that we will make a new folder here i will call it report all right we will add a reward add new item we will call it hello world reboot all right we will just add assemble text box that says hello all right if you are using visual solution to design your reports you might need to enable enable the toolbars in this area alright to do so enable this one's formatting but just right click on the toolbar and enable the the i don't know what's its name the marshall turbo or whatever whatever you will find beside each one of them a handle like this you can use this handle to move it to expand the toolbar like this this one here this one here and this one here and this one here like this all right using this toolbars will make your development much much easier all right now let us change the font to get it get it get it give it some thing more this is just for disability verboses a little frustrating you see all right here is our first report after that we will go to our form and go to toolbox find the import viewer control right drag it to the form now we will notice that nothing happens you drag the word viewer to the form and nothing happens that is because the designer is still malfunctioning until now but the solution is easy just go to the designer and add the following line it normally added after the the setting of the client size just add this note controls all right that is the first step after doing so and going back to the designer you will find the reward viewer is here now we will face the next problem the next problem is there is there are no handles you cannot change the uh the report side the report of your size like this it is there is no handles in the report viewer control again here go to the forms the properties here should be available here if it is not it is just rebuilt now after rebuilding the project we can just if you click on the form and go to properties you can open the drop down here and select the reward viewer all right now we can manipulate the properties from the properties paint you can anchor it to all the sides you can change its size and position like this four months is if you set the width and the height after you make the anchor it will not work you should you should first if you are anchoring it like this and try to set or modify the dimensions but it's working enough if it didn't work for you just go to the anchor here and remove these two then manipulate the size as you like then put it back this is very tiresome and it is a problem a problem in the designer until now it has not been solved but we can manage until the designer is solved and supports the report viewer better we need to manipulate the position like this all right all right i just manipulated to this size all right now let's display the reward we go to the load event we must if you have if you have been using the old audi or the net framework version here in the designer you might see a drop down to select the report definition here in the dotnet core it is not supported as of yet we need to go to the form code behind here in the form load event we add go to embedded your1.localreward.com and we set this to the fully qualified name of the report here is the solution name the project name the namespace name and the report name and its extension all right after that we say reward viewer1 dot refresh report all right now let's try this run the project and now we run to our next problem there is nothing displayed that is because the build action here the reward definition has a build action of none this should be set to embedded resource all right after setting the reward definition to embedded resource and rebuilding the solution now let's run i didn't display because i said refresh it should be refresh keyboard not just refresh right run it again and here we go the report is displayed and we are done so to recap to display our dlc robots in wind forms projects that target net six the first step is you should have the extensions the rd lrd and see first step is you should have the microsoft rdlc robot designer 2022 extension this is the first step the second step is you should have the reward viewer core dot one forms nougat package installed this is the second step the third step is after you add the report viewer here you must go to the forms code behind from here and add this line of code this control list that controls that add this to three word viewer one the fourth step is to manipulate the position and the size of the reward viewer via the properties pane and all of this should be after you have built uh build the solution all right the fifth step is after adding the your your reported definition file you should go to properties and go to build action and select embedded resource the sixth step in the forms load event you should set the reward embedded resource you should set it to be the fully qualified name of the reported definition file and you should pay close attention to what you type here because one letter wrong will make it not run there is a better solution than this but now is not the time for it this is for the sake of simplicity you must do it this way the solution name the project name the namespace and the file name and its extension after that you must call the reportviewer.refreshreport remember refresh report not just refresh after that the reward will be displayed like this alright i hope this can help and for those who might find it difficult to to understand from my way of speaking i am very sorry i am not fluent in english and and sometimes i struggle to find the correct word to describe what i want to say which makes me a little bit slower in speaking i just hope this video will help you and i will publish the the source code to github so you might check it there and find find help there also i will add more videos about wbf project targeting.net sex and also i will add two more videos about wbf and one forms projects targeting framework and i will publish it all on github maybe in the future inshallah i will be adding a course about designing and displaying our dlc reports i hope this helped you and see you next video inshallah goodbye
Info
Channel: Coding Fantasies
Views: 30,565
Rating: undefined out of 5
Keywords:
Id: Ul6r0GZXgsg
Channel Id: undefined
Length: 21min 27sec (1287 seconds)
Published: Sun May 29 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.