How to Make a Shopping Receipt on VB.NET with Visual Studio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this video we will show you how to create reset report using phoebe.net on visual studio 2019 the report is look like this usually we found this report on the market and on the coffee shop or on the store you can see here for example the report is look like this if we print it showing the report like this how to make this report you can follow this instruction first i will close this project and open visual studio i'm using visual studio 2019 here then i will create new project don't forget to select visual basic on the desktop because we need a windows home application we choose windows some app here and click next and this is i will give the name legib import from elsewhere or like this you can give the name of project you want and click next after that in here i'm using net 5.0 and click create you can using another visual studio version if you don't have visual studio 2019 but if you want to download this visual studio you can check the link on the description i will put the code of this project also in the description in here we need add text block i'm sorry button i mean then we need data grid view and also we need a print document okay in here you can design the grid view and the button like you want i will change this button text or button name is to button print like this and the text i will change to print and for the data click view we can add column in here in the first column let's [Music] doing with the name i give the column one is item and the column 2 is quantity and the column 3 is price like this and then if need we can also make this speaker like this and after that we can double click in the print document but if cannot click you can just go to these event and then go to bacon prints and we need just to make this as print document for pd like this after that you can delete this item we need just not manually type these privates sub okay after that we can just [Music] import import system dot drawing dot printing in here and then we need to declare some variable with events in here pd as new print document then we need to declare again for print document dialog as new i mean preview dialog bring preview dialog and in here i also declare for long paper as integer okay in the pd underscore print our baking prints we need to declare team big setup as new fake settings like this and then fix it up the paper size equal to new paper size in here we need using custom and for the width is 250 and along is 500 in the last we will show you you can also using this number is dynamically so you don't wash your paper when printing document but now we're using fix and we will explain to change to dynamic later okay pd the default click settings equal to big setup okay now in here we need to select okay you can copy this event but you can delete this and for begging print in here we need to make print page and center as object a as printfx even arcs ring pitch okay here we can handles pg dot print pitch also in here is handle pd dot begin print and then we need to declare on the print page okay this is for fun declare then f8 or phone with the its size as new phone i'm using calibri you can using times new roman or atc v1 this is the font size and the font style i'm using regular to define this and we need to declare for phone here one is using font size 10 the third is 10 but with both we can add b here and the last is 14 okay now in here we change to 10 and this is 10 also but the style is both like this and the last is 14 and also using both okay and this is declare for margin okay team left marching here as integer equal dot default big settings dot margins dot left and for another we can also copy this we need to declare center and right i'm sorry here center also in here is for right margin and this is margin left okay and the center is big settings the paper size is d defeat 2 in here and the [Music] right is paper size width okay pg dot default page settings the paper sites okay with like this and this is for margin and this is for phone alignment i give a declaration in here okay if you think this too small i can change this with bigger like this or let's say using 120 okay i will show this is according okay and [Music] for fun alignment using dim right as new string format string format in here also for center new string format and right alignment and then this is string alignment for for the right and the for center not team center line this equal string alignment the center we don't uh declare the left alignment because as default the string is on the left alignment so we skip the left alignment in here and [Music] now is we need to declare team line as a string for example line is equal to this you can using this or this like you want for example i'm using this for simple and then you can try to run if a certain this project no error okay okay i'm sorry later we put the button okay no error in here for now is a dot graphics dot a string through string this is for store name for example elsewhere store like this and then using [Music] one with the font size is 14 and the color is black and then create sensor margin okay and with this is a rings from top okay and this is for text position this is for a second i will copy this for faster for example i'm using this is one size 10 and new york street for example fnu garden for example like this and process black and center margin also we add uh this is for 25 for example this is from the top of paper and okay it's better to code the button to verifying the printing document is no error okay this is for print preview document dot document is equal to print document here and uh in preview document dot show dialogue like this because we need to verifying no error in the [Music] string we can run first okay this is for the title okay and the next we can copy this okay this is for a telephone for example using phone 8 that we declare tell plus 1 for example like this and the rinse from the top of paper for example i'm using 14 now we can check okay now the top is done and the next is we need to [Music] add for example using invoice and then the cashier name and the date and time for example you can explore later but this is the basic or for for fast you can copy this this is for invoice invoice id in here and this is for this and then this is for number of invoice okay the number we can using like uh whatever in here okay for the tags this is using from it or font size it using not center margin we using left margin because we need more complex we are using zero this is will make on the left okay and this is from top of paper 60 all is 60 because it's once in here and the that's because we're not using left margin because after this text invoice id we need to showing this so from zero we can uh using for example 50 and then from the zero we can also in here using 70 for example we can run this project now uh it's over let's see the false okay invoice id using phone it brushes black this is in the center okay this is make the text is in wrong position okay it's appear right now and we can copy all of this okay and in here is showing the cashier name or employment or employee i mean catch here two for example and because this is from top is 60 we can using the 60 13 to 75 for example 45 and let's try to run like this and then the next line is using a date in time you can using it in time from a visual studio or official basic or using k10 bigger but for simple i will using a menu for example zero okay 17 2021 for example and for the format of times it's better using like at least okay for example like this and we change the position for example 100 or it's too much okay okay white is make on center let's try to see okay this is zero okay change to zero because we want on the left position okay now we need to showing uh the line so that we create before we can just copy this and the string we need to call this line okay and the position is 100 for example okay this is need uh more line in here okay i will charge my laptop first then [Music] for the item oh we need this first okay we need to verify in the line first okay like this like we want and the next is after string is for the item okay we need to declare team as integer this is we need to for data grid view position because later we want to the paper for the long auto auto size where the size is space on the item so we don't wash the paper okay in here is dmi and so on and that's a grid view one the hello user to add rows equal to false this is to prevent error okay from [Music] zero data in that bit view okay and then is for a row as a integer in here equal to okay is not possible in here let up if you want the rule count it's this one this is uh the whole item on the grid view is counting for hit is increase 15 a graphics doctor string or we can copy this but okay it's fine that that if you want that uh great v1 dot rows in here uh on the row the cells one cells one is refer to quantity because the index start from zero zero one and two okay the sales one dot failure it value dot to string the string for font size is f10 using color black presses black in here and on the left with the top from top of which is 100 plus eight okay 100 is approximately the item before the data grid field okay this is just [Music] the approximately of the height and we plus with height okay so we we can check first in here coffee one let's see okay this is for the quantity now we need to add the item and the price of course for the item because on the index 0 we change to index 0 and the font size is 10 using uh plus black our color is black this is because now on the left we change it for example to 25 and forehead is zero plus it's again okay this is tail first check this i'm sorry no that time here you need to reload again okay the quantity is the item name and the price for i in here equal to data with few ones okay dot roots the row in here on cells 2 because the price on the index 2 value grid view one the uh rows in here row the cells of course top value we need using our format like currency okay this is for i is increased chris using this format and we can copy for showing the text in here copy paste in here and then for cell 2 uh values or value dot string using f10 and brass black and in here we are using white margin and the from top is okay right and then in here because we need to alignment on the right okay let's try to run item coffee one now uh right is in here okay the next is showing [Music] the lines a team 8 s integer a2 equal to 110 plus eight and a graphic a dot graphics in here is a dot string okay we call the line again and if it okay we can also copy this and [Music] from top is h2 we change the values to hit them okay let's try coffee one and t and six okay the item looks like this now the next is we need to showing the totals you can copy this okay change the string and the font size let's using uh f10 using both for style okay and then [Music] in here because we are using our format self we can add in the drop down in here format like this and but because we don't have in here for sub we will try to execute the format later okay this is using brush black and zero change to right margin and the head is 35 plus 82 and in the center okay for turtle okay why the text is appear like that i'm sorry this is right okay and in after this we can include the price but like this for example we will good later okay next is we need to showing for the quantity we're using manual first we will explain uh later this is the manual for quantity and using a font size is 10 using bold of course and because in the left we can using zero and then [Music] the height is 10 plus head two and then okay if this then of course this is like this we change same width with the total okay like this or if too much we can just using 15 like this okay because in the same position of quantity and the total this is the value in sim plus like this is for future we will separate this to easy identifying punch for shopping i swear store here you can also add u1 in here and in here i just using f10 not both because this is just a things saying this is black and of course because we need to the position of center we are using center margin here and uh we can add this for example d5 in here is for example 15 let c first okay okay it's this is center this is also a center and i think it's a bit more in here so i changed to 40 for example 40 and this is like this okay and in here need more for example 55 i think it's enough then after all this complete we need to count the price in here for example i will show first [Music] 1080 and when printing we need to showing the quantity based on this and the total base on this okay that's doing and the easy way is we are create the sub in here sub for some price this is content price and quantity in here and declare in here theme for total price in here and so and medium total for quantity as long also okay enough then uh we need to declare comprise as long equal to zero in here i also need this for quantity but later we do it and then for row item is long equal to zero to data click c1 pc1 okay like this and this is not display for counting uh all item in the data grid view on price is equal to con price plus values on the data grid view one data grid view one dot rows item then on the sales two of course because for the price and in here is value that fail okay oops yes then uh in here let's try to t price it's coin price so we can change the total that we manually before to uh using our format in here and format in here is using variabilty price okay and then the format is sim with the price in here like this and then we need to close this with brackets and let's try to see there is error or not item coffee quantity one and tea okay the total is zero in here uh let's try to correct it this and format okay deep price on price is comprised plus values on the grid's view one dollars the pro item [Music] dot sales to dog values okay i'm sorry okay uh we don't call this a sub this is causing the error we need to call the sub some price here okay this is called the sub call the sunrise sub and let's try to run again and for item coffee and one 190 to here for example 200 and let's take a prince okay now it's work for total is 300 okay but uh something wrong in here because we need to sum this 200 with the quantity but we do it later okay you can also showing like this but the client or the customer will confuse with this you can just multiply or using sum with the other cells of the grid view you can copy this and okay for the failure you can using the symbols and with the cell one of course for the quantity okay let's try to uh item coffee sorry 1 180 and to 200 okay now uh you can select your prefer which ones like before or like this this is the right total because 1t is 100 or one coffee is 100 and the t for item is 202 200 uh multiply with 2 is 400 so the total is 500 but you can choose your flavor with uh which you want and then is for quantity game for a con quantity in here as long we can uh for fast can copy this and but for quantity we need to multiply we don't multiply here so for the quantity is on the cell 1 and the see underscore quantity is con okay this is knock on price we confused with this [Music] quantity okay con [Music] quantity in here then uh for this also click on quantity okay okay let's try oh yes we not yet call we're not showing of course and this is for total quantity okay let's uh running coffee one 100 to 200 uh sugar 1 200 for example okay the quantity is 4 right in here and t is okay multiply with 2 is 400 now this is [Music] all of this tutorial guys you need you can [Music] modifying this code or customize is on your name but later we will try to add the logo but this project is done so it's not too long to create one video in here but in the next video let's try to create a logo on the recipe reports okay let's try once again okay okay okay sugar salt and this is oh yes we don't [Music] wash the paper because the item we buy is until this so we need to make [Music] this report is no longer like this but it's up to you in here i will show how to make the long of the paper is not was your paper of course i almost forget this is something important in here i will create sub change almost forget guys okay you can also download this project the link is on the video description this is for account as integer and the long paper because the printer usually using all the paper but there is a new printer model that using auto cut for the paper it's better if we can using the newer technology like that okay long vapor is equal to zero for road com [Music] is equal to agreed to you because the dynamic just only under the w view item so we can calculate to get the approximately of the height of pitch okay long paper in here is equal to row count and this will multiply with 15 per item is multiplied with 15 and the long paper is equal to long paper without data grip view approximately is let's make 210 then we can call the chang's long paper in here in the okay in here guys we can copy this and this is for fix long paper you can choose your paper and here we are using long paper and then let's try to see this is works for you item this is coffee and the quantity is 1 200. let's just make two what what what's wrong in here okay okay okay let's try to find the mystic okay once again i forget to call this up this up this up okay where is this app for button click in here of course i'm sorry we need to call this uh ching long paper we don't call this so the function is not we get for easily to understand we can just move the print button in here okay we can call this check again coffee 1 2 2 or 200 and click print you can see now the paper is auto cut in here you can also make this smaller for example so coffee one two two no i think it's enough but if you prefer using fixed size it's up to you okay i think it's enough for tutorial today you can download the source code or the project we put link in the description in the next video i will try to create a logo on the print documents and see you in the next time hope this video helpfully for you thanks for watching
Info
Channel: Nosware
Views: 47,097
Rating: undefined out of 5
Keywords: vb.net, visual basic, programming, visual studio, Shopping Receipt, Shopping Receipt on VB.NET, receipt report with vb.net, vb.net reports, shopping receipt with visual studio, vb.net tutorial
Id: a2ZezCJL_wI
Channel Id: undefined
Length: 59min 36sec (3576 seconds)
Published: Tue Aug 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.