Building a PDF invoice generator and storage platform with server-side Blazor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this video now this will be a video about a pdf invoice generator it's a blazer server-side application we have a glorious interface where we see a list of existing interfaces for a user right and we have the ability to create a new invoice that goes into the database it gets started and it can later be retrieved and edited so i'll see i'll show you rather how it's all implemented how beautiful it all is but most importantly i'm showing you this to show you how you can skip a few things in order to get net software released in order to get that project of yours actually released and published and in the next videos i'll show you a bit of an improvement and i'll also show you how it gets published into the ios manager how everything gets self-assigned and more importantly how it can get monetized with the ad implementation which can be a bit difficult in blazer but nothing to worry about i'll explain a few options that you can choose from and we'll go from there to publishing and you'll actually see this application published you'll be able to interact with it so you won't just be able to get the code you will also be able to see the live application so i will show you the interface where we interact with databases and also i'll show you the generator we are using pdf shop you can take a look at my video on how to use it first that will be quite useful and we will do a generator it will generate a pdf file and that pdf file will be exported so without wasting any more time let's get into this what you're looking at now is the result of the whole code now we have right here we have two sections and you will see how i saw fast forwarded the development of this nice little purple bar right here navigation bar whatever you want to call it which is actually tabs in mudplay so see how that works and how it actually doesn't really work all that well but it's going to be good enough because again it's an early beta i don't want to spend hours upon hours creating this navigation by it's a waste of time so we have my invoices which is basically the list of the users invoices and then we have a new invoice page now i have already created some basically nonsense values invoices and first of all we have the draft you'll see how all the statuses come together in this case for now at least we have a free statuses we have draft paid and sent so three different options and then i can add more a few of them change them replace them and do lots of different things but it's going to be good enough okay now you can see right here i get the output and the dateju it wasn't set it's basically the default date time and c sharp and then date created it's been set automatically so it does exist and then we have the id for the invoice we don't have really any other data and that may be a mistake that may not be a mistake that is something i will likely add later i will also add some more things later that don't exist that were missed or perhaps excluded as well so you will see some of those videos and i'll also add some things behind the scenes before i actually show you the publishing process of this whole arrangement now we also have the date picker this is all modblazer you can watch my video on how to implement my blazer how to implement tables in my blazer as well this is one of the more recent videos i've made so we have a date we pick the date and we get our invoices now let's go to something a bit more exciting let's say paid okay and we have this one right here and if i click right here i get the export right here i get the link and if i click on that i'll get to the actual document we'll get to the documents a bit later it's offer separate things first we will look at the whole basically database level arrangement and then the export will follow after we deal with all the databases with the interface and all that stuff now again if i go into sent we'll have a couple more items a few more actually and we have the total we have the sorting for the total so if you want to learn specifically about these filters and thoughts on the on these mod laser tables take a look at my video and right here we just have these filled invoices okay and if i go to edit it will take me to actually the new invoice page but first let's start with a new invoice with a brand new one as you can see i just enter the page this is what it looks like from above and we can start from shipping address so let's say test okay and why not and once i exit once i lose focus so it basically binds at that point it is saved now you may notice a bit of a flaw it doesn't actually say anywhere right it doesn't say that it's saved but again this is something that you can easily add later so there's a real reason to sort of bother with it at the moment okay we have the basic product we have something that we can release into the beta testing and that's good enough after that we can search for little bugs and perhaps features that are missing and then we can add them okay but at that point someone hopefully will be already testing if you have beta users so they will be testing for other problems of your application right so with that base code not just what's missing we also have comments which is not implemented okay it's not implemented in the comments i can enter but it's not actually implemented in terms of generating into that pdf invoice then we have the day 2 right here we can pick that say 12th of june why not now we have the draft then we can do paid or send and again once it changes it goes to the database it all gets saved now as you can see the total is zero and that will be added once we add the items before we add the items we need the company data and you can do the company name all of these are not mandatory okay you can actually exclude them and it will be generated but you have to sort of be careful with these things because by default you would most likely have them strings as naughts right so you you have to make them empty strings rather than north i will explain that all later but there are some pieces and things that have to be that have to be handled carefully right anyways let's get into the items you can see right here we have the new item field and then we have price quantity sales tax which could be v80 or something else basically attacks that's added on top of the sale right so we have quantity tax discount and there's a simple formula that divides and multiplies things and calculates the total of that particular item so let's say it's 100 with 50 percent discount okay let's say test item if i can do item and then test d for test description and then i click add it actually shows the total for the item which is 50 right 100 of 50 discount is 50. i added and it is now in the list it is now in the list you can see right here we see 50 we see zero sales tax and we see 50 discount and 100 the price now you may notice there is something missing and that is the currency right so the currency i forgot to add which was my mistake right and i will show you in the later video how i correct that mistake which is not perhaps the easiest thing in the world to do it's not too difficult but it is actually consuming time consuming that is so it's always well better to have a proper plan before you start coding which i did not really have for this particular project okay so we have title and description item and all the rest and then if we go to the bottom right here we have total 50 okay so that's that will add up all the items and if i click export it will give me the document that will be a link and we'll get to that later i guess in the second part of this video of this uh course if you will okay so you see what it does you see what uh it can provide and now let's get into some code and see how things come together so before we get into the c sharp part of things it is important to see the code for the databases for the database rather and for the tables we have three tables and there is a specific structure in terms of how they interact with each other and this is basically what the whole project is based on now the first and the main one in a way we have the invoices invoices table now invoices stable will have the unique identifier for each record that is the id for each invoice that is what the user see that is what everyone sees then we have the owner this one is extremely important because once the application is released one user will only be allowed a certain amount of invoices to have to the account right that's very important because that's uh it might get troublesome if there is no limit right uh so we have the owner and only the owner will also be able to see the invoices which makes sense right we don't want everyone in the world to see someone's invoices we just want the owner to see them and that's great now we also have company 2 and company from company from is the company that invoices the company too so the company two is the company that covers the invoice that pays for the invoice okay and we have and more char because that will be an id and companies will be listed in the company stable right here we have a company stable and we have id for each company again it's a unique identifier it will be assigned for each company then we'll have company name company id which is company code one of those government issued government ids now i do notice that in certain countries is not really used all that widely even on invoices but for example a country i live in it is sort of mandatory to to put it on the invoice otherwise you can't really be clear which company it is so it is kind of an important thing and especially for me if i would send an invoice to someone uh i would put that on i would have to put that on if and if the system i am using does not allow for that arrangement well i'm not going to use that system it will be impossible the next thing is of course extremely important which is the address and we also have the country just in case okay now at the moment it's sad to and by child we don't have a country picker i might make a video on how to make your country because something like that we'll see about that but we do have that field right there and then we have the invoice id okay so it's referenced like this it's referenced from the company okay each company belongs to a specific invoice and that is referenced in this record okay it's not listed somewhere in the invoice records but it is listed in here but also at the same time okay at the same time we do have if we go back to the invoices we have these right company from and company two so in general we will be using these two we will create a company in the company stable and then if it's company 2 that will be put in this field if it's company from it will be put in this field now that can be used later on for some additional things it's not really that important but i would prefer to leave it right away because it will be easier later on now there is a problem with the currency i am aware of that and i will show you how that will be fixed but again if you know about it if you think something will be done later on it's better to do it right now then we have the date created which is daytime okay so the date the record was created and i always like to put these things because it makes your life easier if you have to test for sort of live issues if your customer complains and you have to test it and it makes your life a lot easier if you have to go through that that and analyze the issue it's just a great thing to just have dates anywhere where it's possible and then we have the vat id that's the government issued the i.t uh id um that's obviously going to only apply to european union but it is something that's very useful to have and that is for the companies now getting back to the invoices we have the shipping address okay we don't have that feature where you could set company address to shipping address we just have a separate one for now and then we have the comment record which we don't actually use in generating the invoice another thing we don't use is the logo id right here we have the logo id which we do not use right now but i just added it right away because i do believe i might actually implement that at some point and if i do i will make a video on that now we have also date created and then we have the day two they created is set automatically once the invoice record is created the date created is set and then day two is set by the user and final thing for now at least we have the status okay we have the status now the status is the most important thing here because that is basically how we determine what the invoice is what the status of it is and that will help in the search of invoices as well now i'm gonna skip those two for now and let's go into the invoice items just quickly uh you saw the invoice items so when i showed what the application actually does we have title description price discount tax total and then we have the owner okay the owner for this item so you see the owner is added pretty much wherever it is possible because it is quite important to have that ownership structure of these records we don't want them falling to the wrong hands and we want them to be sort of easily accessible as much as possible and then we have date created just like we have for every other record now after that quantity and then the invoice id to which this item belongs that's the only point of reference in terms of the item so unlike the companies we have sort of two points of references um two-way referencing kind of thing going on in the invoice items we do not have that now getting back to invoices right here we have the total which is the sum of those items that are associated with this particular invoice and then we have a discount which is a standalone discount which then can be applied to the whole invoice okay so it's just a sort of global discount for the total value for every uh item not very specific we do have discounts for specific items but we also have a global discount as well now you see the structure you see we have three tables we have lots of procedures we have lots of things to go through so now we will start with the creating of a new invoice i'll show you how all of that works and functions and how things go into the database and then we'll get into the list and into all these different things now that you know a bit about the databases and what they look like in this arrangement i will show you the initial setup of the new invoice page so right here we have the new invoice page dot raiser which is the blazer page which you saw that is the page where you insert the new invoice the data for the new inverse in then you can export and do all these different things now i will show you how the data gets into that sort of binding arrangement with a bind and how we bind it and why we do it that way and how we update things later on that's very important but first of all how we generate those initial records right because basically what we do in this page we go into it and then on initialize the sync right here we generate the initial records we generate the invoice then we generate the companies for the invoice and then we go on from there right we only uh let the user access anything uh after we generate those records and then those ids are laying around in here and that would be right here invoice data so that will be our invoice model class model right we call it invoice so this is the object into which all the inputs will go into and then we will have invoice item which is the new item we'll get to that later but this invoice thing is the main thing and let's go first of all into this model let's go to definition right here like this you can just go to definition and you'll get into the class now you will see that i do have a sort of an overload on the constructor i'll explain that later and you see there's a update total right here but basically what we have here is lots of data for the invoice id shipping address comment logo invoice date day 2 and then you can see we have the list for the items and then we have the invoice companies company 2 and company from also discount status and total which is calculated whenever there's a change in the items list right so uh whenever there's a change in there it will be uh recalculated so to speak right so that's all good and great and we'll get to this probably a bit later but basically just calculates the total for the invoice okay now then let's get into that uh initialized on initialize the thing and let's see what it all looks like we are now in the new invoice page dot razer and we are in the on initialize the sync right here as you can see the first thing we have is connection right the sql server connection so we establish that uh before the try and catch statement uh then we'll close it and solve for different ways for different outcomes uh we take the connection string from the environment variables so you just provide that for wherever you publish your database if you want to see how to publish a database somewhere you can take a look at my video i have here and if you want to learn more about sql server you can take a look at my whole course on this sql server from basics to more advanced stuff i will show you everything you need to know so we start the connection it's kind of an interesting structure and how we establish the connections we establish them for sort of each specific procedure right or bulk of uh smaller procedures so we don't use this for every tiny input and output and update opening and closing them we just use one connection for several things but also we don't use a global connection because that can cause problems too so in the try and catch statement right here let me expand like this we have an if statement right we have an if statement and we have the else for the if you see right here it's the invoice id this will be for updating the existing invoice we'll get that later in this whole arrangement now we get to the else and we open the connection we need to open a connection in order to do something and then we construct something called invoice data upload here we have services invoice invoice data upload which is a class which in turn contains several methods uh which then will upload that data it will insert the main records into the database and then i'll show you a very interesting arrangements on on how i made the updating of these fields for records very simple actually so the first thing we have to do is invoice id we need to assign that invoice id okay we need to add the invoice which basically just creates an empty record as i mentioned previously and then it assigns the id to this variable in this page let's go into this let's just go to definitions very easy to do as you can see this is the invoice data uploader now on the constructor it simply takes the connection puts it in here and now it's accessible throughout the class perfect and simple right and we are looking now at the add invoice to database which is again quite simple really we have the command right just the usual sort of sql server arrangement command of course command type which you must not forget otherwise terrible things will happen and then we have parameters we add the value and what we add is the owner okay it's we owner now the owner is user id which as you can see it comes from this authorized class now the authorized class is basically how the whole thing will be secured okay it's how it will be secured i'm probably not going to go into the security arrangement because it will be once i actually show you how it's being uploaded it will be timed into my main confiscation solution platform where you can buy my courses and do some other things that as well and there are some new things coming through and it's basically a sort of a third-party single sign-on kind of an arrangement so i'm probably not going to show you that but basically from the authorize we just do that sort of inheritance thing and we take the user id okay we're logged in user user id and that will be referenced as you will see later on many occasions for safety security purposes right so let's go back to the invoice add invoice as you can see that executes the script which returns a string now a string is an id and i'll show you the start procedure in which we have the id we have it right here insert new invoice that's where we have it insert new invoice as you can see it takes the owner of the invoice which is great and now we simply insert these sort of default fields in a way we have the id which is generated with a new id remember it was unique identifier type and this is how we generate that unique identifier in that case you don't need to add any kind of a loop and special arrangement and constraint and then all these different things to make the id truly unique it just all happens for you automatically and then of course we add the owner and then we add the date created now the day created as you can see is cis utc date time utc udc is crucial in any application that you do you must always use utc if you want to display that date sure go ahead convert it to the time zone of the user other than that you always store utc in the databases i have consorted many projects where this was the issue and believe me the fix was actually very very difficult because you had to change the existing dates and you had to basically think of some ways to even to remotely fix it because this can cause many issues now i talk about this all the time so i'm not gonna get into this too deeply but the next thing is the output the output basically uh it's like select right instead of selecting you output and what we output in this case is the id right here the id and then once we execute a scalar right a sync of course we do everything as sync in this arrangement we get that value and you need to convert as you can see right here to string value to string it fails it becomes null and then we handle it from there so this is how we do that initial record of the database and then we will have the company right so let's just take a look at that it's sort of a similar thing right we have insert invoice company and voice id the invoice id comes in so as you can already see you first need to generate the invoice and then you need to add that and then once again we execute scala because if we look at heads kind of the same arrangement takes id invoice id in this case instead of the owner but again almost exactly the same and then it takes out the id the generated id and then it uses it and actually will put in put it into the invoice so if we go back to the new invoice page right here to the on initialize the sync as you can see we add the invoice we have dealt with that and then we check for no if it is no and just in case i added this because it might have changed and all that stuff so we have the id that's great if we don't we return now i haven't added any kind of a failure message here yet i kind of skipped on those things because it does bloat the code quite a bit i did add a few error messages and i'll show you how you can make that happen uh but uh it it does bloat the code quite a bit all these error displays and things like that now the next thing of course is uh adding the company so company two we construct new invoice company like that okay and then we just as you can see we usually add company to database method from the uploader and then we assign that id to the newly constructed company so that should be all good and great hopefully that's all good and then as you can see later on we use invoice data upload update invoice data so we don't use it from the uploader anymore we use it to solve for well directly like this and and you will see in this method we have invoice id of course as a sort of normal parameter in a normal method but then we have this company two okay we have company two that's a bit weird you might think right why would i do this the reason i do this is so i could have one method to update any of those fields in the database without touching any other field and without having 10 or 20 different start procedures so let me show you how this is done because this is probably one of the more interesting parts of this whole video that i'm making so we are now in the invoice data upload class and we are looking at the update or up pay date invoice that now i am well very well aware that there is indeed a typo right here and i just went with it because who really cares right so i can change it later uh anyways we have the updated voice data the method it returns a boolean value that's all great and good but then it takes the id which is the invoice id okay it's the invoice id and in fact i'll do something on the go here i'll make a few comments you see i added three slashes and it gave me this sort of nice comment template i'm gonna write invoice id okay just in case someone takes over and they don't know which id it is because we have quite a few we have a user id all these company ids and then invoice items ids and all that okay so we have update invoice data which is great and good and then we have owner then we have company two and i can go on and on and on and then it goes to company from and then shipping address and all that you get the idea it's all basically the fields that would be updated in this uh record right in this row table row but as you can see all of them have default values and those values are null now if you think about it what would happen what would happen if right here let's go a bit to the bottom right right here i add with value if you're familiar with sql server you know what happens in the parameters we have add with value and then say this is null or this is null what will happen is it will say the value is missing it expects a value but it is missing the reason for that is because the no in c sharp does not correspond with the null in sql server it just doesn't okay and that means it's missing it's sort of a different kind of a null basically it's not the kind of a null that could be inserted in the database in the table but it still recognizes something that's empty or not existing and you can find that out in the sql server procedure okay so we assign that null and if you don't provide it in the parameters by default it will be null and nothing will happen and i'll show you why it won't happen we need to go into the update invoice okay we need to go into the update invoice which is great right and we have something default as well you see right here the owner the owner the parameter in the procedure has a value assigned now this is something that you probably won't see very often you don't really add these defaults like that too much i don't believe in sql server 3 at least in these more basic arrangements but we have the null assigned to this okay so if it doesn't find if it doesn't find anything if it comes from c sharp part of things with a null that means it doesn't find it but it does not default and all okay by default it does not default to a null if it knows from c sharp so we have to assign the default null if this particular value is missing okay and now at this point if it's missing if it was not provided we will carry that sql server but then there's another issue right if you just insert it if you just set uh that particular field then it will be updated to no which we don't want to happen so we have the update right update invoices and then we set say owner and then we check for is null okay so if if it is no right or rather if it isn't it doesn't really matter right if it is no it will basically assign the existing value you see that's the name of that field it will assign the existing value if it's not null meaning value is indeed provided it will assign the new value that's how it works and you can see the same arrangement is throughout there are several more classes or other methods i'll show you them as well and this is how we will do it this is how we will do it we'll use them as we go and as we need and now let me just say that quickly and let's go to the new invoice page let's get back to that and you can see right here i just want to show you how to actually use this parameters if you don't know how to use them you have a method right you have whatever the first sort of simple parameter is and then if you don't want to do them in a sort of row right and in the correct order in the original order if you only want to add the parameters that you want this is how you assign them so you do a specific parameter and then you provide the value and then you use colon it's kind of like an equal sign in a way or think of it as maybe jason writer company two is this value company from is that value so this is how we use it and if we go back to the invoice data upload right here and the invoice data upload you can see we have also update invoice item which we will probably look at later just a bit and then we also have we also have if i can find it properly update company data now there are some more tricky bits in here okay there are some more tricky bits and let's take a look at them first of all is the date due which is date time okay day time you see by default uh daytime doesn't have a null you probably know this from c sharp if you've used it long enough you may have noticed that sort of i would say a bit of an annoying thing about it but it does not have a no it just has a sort of constructed daytime which is a zero zero zero date uh but basically this acts as an all this you can use as an all okay so if i expand this once again you can see right here you can see right here we have day two if it is equal to that value if it is indeed equal to that value we will then okay we will then basically if it's not provided it's all right we will then provide the database no and this is how you uh basically push through into that parameter through that parameter the sql server that is the sql server no db no value do we know value that is the sql server it's not uh let's see if i can do it it's not this no it's not it's not it's different the idea is the same but it is different it doesn't uh convert so to speak but this is how it works okay so if it does exist obviously we just provide the datu another thing is the numbers the digits okay the digits they don't have north either just like the date and we also can't really use the default which is zero because it could be zero quite possibly right it could be zero so we can't use that we lose all those options what do we do then well it's quite simple okay it's quite simple and it is right here we have object so you see instead of a double instead of an integer we just have an object and then the object can definitely be null objects can be no and if we need to access the double from the object we just cast it to double perfect right perfect and if you're struggling to understand some of this stuff you can take a look at my c sharp course where i show you so from the very basics to something a bit more advanced how to use c sharps everything you need to know it's not a bloated course there's not a lot of technical terminology it's just basically how to use it where to find things and how things work and how things function and you will be able to use that and you'll be able to get some exercises from that as well you can find all the links in the description so this is how we update the data and now we'll get into the next step which is actually taking a look at that layout blazer layout the ui elements which in this case we are using a third party which is something i don't really like doing but this is a decent third party it actually works and it is mud blazer you can take a look at some of my videos on how to interact with mud blazer and how to set it in the new invoice page you'll find the mud grid right here now mud grid is kind of like a bootstrap row in a way at least and then you have these items in the grid and then you see the item is 12 that's a 12 out as well so it will take up the whole row if it's not like here for example we have md4 that's just one third of the row so it's kind of like bootstrap pretty much exactly the same thing so let's start with the first part right here we have mod item and in the mod item we have paragraphs and then we have mud button now if you want to learn how to use this whole mud blazer thing take a look at a couple of my videos about the tables and also about the general setup of it with the buttons but as you can see with modblazer you can put in just basic html in there so kind of do both things at once which is a great thing because you can modify and customize whatever you need whatever you want now this will be for the export and then we have the error message for the export and then we'll have a link i'll explain we're exporting later but for now we have the total invoice total displayed right here so once you start adding those items you'll see that later you will be able to see the total for all the items so that's how it all works now the next thing that will be as you can see shipping address okay shipping address so we have a sort of uh a row here these uh these three will be i can sort of separate that a bit it is a bit difficult to separate things in in these uh in this html part or in this case mud blazer part but uh i think it's quite obvious so what things are doing here so for first one we have shipping address which is the mod text field which is basically a text box write an input of text and you'll see right here we have a value changed okay value changed on which we take that new value from a text box and we assign it to shipping address and also also right here if i can just go a bit to the left you will see that i am using that update method you see update method and i simply update the shipping address provide the invoice id update the shipping address now since this is a text field with multiple lines you also need to declare the number of lines that you want to have just a basic kind of an arrangement and also a very important thing is the type so in this case it's the text therefore we use string as the type that's what we do now you will also see the value so you might think why do we have unchanged the value and then we have the value right here put in here the reason is because we will be using the same exact page for editing and so for editing the data will come into this page it will come into this page and therefore it will have to be displayed if we don't do that it will not display right it will be just empty and then on the value change they'll start from the empty and everything will be empty and it will be very troublesome so you see these values provided right here i'll talk a bit about more a bit later so we have the mod item and then we have date picker we need the deducer it's all again the same process we assign the value to the object to that uh current uh invoice data and then we update it okay now as you can see there's not much error handling going on but again this is just a sort of basic product that you can release okay that's what i'm going for that's what i'm looking for so i am skipping a few things because otherwise it will be a never rending process you work on it work on it and then it will become too expensive at least in terms of your time and you just drop a project and never release it so it's good to have some limitations for your expectations so don't overwork it just do whatever is possible at minimum to release it and go ahead and release it and then you can deal with all the bugs and new features and all that stuff the next thing is the mod select so it's just sort of a drop down selection this is kind of a complex thing you need to provide the values of original value once again because we will be using that for updating the existing invoices editing them but then you see we have the type okay the type and then again on value changed we'll be changing values and updating and the contents of it the child elements you might call them we have much select items so you have mod select and then mod select item is what you select but one thing you can notice here i have value which is zero and then one and then two and then i have this word so word will be very important right because you don't want to store use in the program or store it in the database the actual word that you provide to the user a friendly name if you will but you do want the value so you use the value as something the user cannot see but if they select draft they will get zero if they select sent they will get two that's how it all works okay so on to the next one we have mud text field once again this one will be the comment and the comment again the same exact thing let's go down now these are the company details company from on the left and company 2 on the right again i didn't add too many words floating around too many labels and things like that there's no need for that for the initial release this will be good enough because you know chances are no one's going to use your product right away you might have a few friends and colleagues to test it out but probably initially it will be just launched and it will sit there for a while and then maybe you'll get some traction maybe work out the box but you will have time to do it because you will be able to relax your product is out there it's published it's all good to go it's working to some decent extent and then you can add more features make it all pretty and do all these different things now in here we have a few mod text fields a few text boxes right and they just do exactly the same thing the only difference from my previous ones is that they go to company from okay company from and so we do update whichever one it is but company from is in the invoice and then we'll have company two it's exactly the same thing the only difference there will be the word from and then to this one is from the other one will be two so after that we have invoice data upload update company you saw those static methods the update methods and then in this case we just pick company uh country rather an address and all these different things then we have a label for the text field which is kind of a useful thing you don't have to write another uh html element for the label it sort of gives you it in in the actual text box uh i do kind of like that it saves a bit of time and sort of messiness in the code and then six lines and string that's all we need to have in here let's go to the next one which is the company 2. i already explained that it's exactly the same and you can find the source code on patreon and as i mentioned before this will actually be published so i show you the sort of publishing process in the iis manager how that may work and more importantly i will show you the ways to monetize the blazer project because we can put all these different links in a simple javascript arrangement but it doesn't work exactly the same way with blazer applications so i think that's going to be something that's really interesting and very useful to see now the next one we have a whole row saying new item and this is where adding of the new item begins so we have basically some pieces of the item and then we have uh the whole display right here we'll have a this is the total for the item and then we'll have the whole display so now at this point you sort of see what it all looks like in terms of this initial mud blazer arrangement plus the initialization of the invoice and now we can go and take a look at how the items are added to what's the procedure in there how it all works in general doing a list in blazer is actually very easy that's what blazer is good for one of its advantages right you just add it to the list and it gets displayed but this arrangement is a bit different because we don't have a safe button right we don't have any kind of a simple action where we just insert the form fill out the form and then save it to the database so we do everything solve on the go and the list as you can see right here it will be saved on the click of the add button that is the item to the list will be saved so first of all it needs to be saved into the database and only then we can actually display it otherwise we'll need to display an error because it did not work for whatever reason and this will be the error right hash you can see i'm displaying the errors in a very very simple and straightforward way simply a paragraph and the color is red and if there's no error the paragraph will not be seen if there is an error if there is an error message it will be seen in red very simple solution and i use it all the time these days now after that we will have a table and we will get to the table once i actually show you how it's all inserted where it goes and what it does there now for this we have new item new invoice item invoice item is the model that we're using for that and everything right here you can see we have a all the data bind value we use bind value in mod blazer mod text field we use once again and in this case we use bind value because we just put it into that new item it's not saved into the database just by changing the value saying price or quantity or sales tax or whichever one else it is it will be saved again on the add button the whole object will be saved a new item will be created and then added to the list now all works by reference so we'll need the invoice id but basically again we bind the values and then on the click of that button right here on the click of a button we execute the add item method which will be down here below okay and the first thing we do in the add item method we set the add item error to nothing right the reason we do that is because if there was previously an error and now we won't have an error we need to have it as empty that makes sense right if it was just sitting in there it might just sit if you don't have any kind of a success message which we don't really have here we just see that the item is added to the list so it makes sense to have that uh set to nothing to empty text or empty string in this case and after that we establish our connection okay we establish our connection from the environment variables this is remember server-side blazer so we do have that option of using environment variables so it's quite easy to do it's just like any other api application or something similar so after that we establish a try and catch statement which is obviously very important we need to catch those errors at least to some extent and then we open up a connection now after that we use invoice data upload once again and then we use this method add item to database it takes in all the data let's go into that just quickly again it's just it's all very soft the same way right we don't have a many differences between these procedures we have insert new invoice it takes all these different pieces of data but two most important pieces here the two most important pieces will be the invoice or id right here in voice id because that is how we reference okay we don't have the list in the invoice record we just have the invoice id for the items of the invoice to which they belong that is our reference point and then we have the owner now the owner at this point we don't really use we don't really need it but if i would want to later add a feature where i say you can pick the existing items from the list you will need that owner okay that owner will be needed so that the list of previously inserted items could be retrieved for that specific user only not for not everyone's items can be retrieved by everyone that would be a big sort of security leak and that is something we do not want now after that of course we just execute scalar and what we get is the id in the output inserted id the same thing we did with the other stuff so there's not much to look at here we can go back and as you can see we simply assign the new item id we check for it if it's not nor if it's not an empty string and if that is all true we only then add it to the list you see only then we will add it to the list and then we will reset the item you see we will reset the item therefore all the text boxes will be reset on the other hand if it fails we go into the else right we don't get the id means it failed and then we just say something went wrong try again we don't have too much of a handling here but we do have something and then of course we have the exception and then once again it's the same exact message now do notice i already have a break point right here that is how i like to debug my stuff i have the exception right here and i have a break point so if i launch it on the first try it will go through it will break here and i'll be able to just hover on that e and see what the exception is i won't have to relaunch it reset the breakpoint to go through the procedure again none of that time wasting we just go and see and then hopefully fix it right but this all has been tested and then fixed and it's all working now the next thing will be the removal of the item but first let's go into the table and see what the table itself looks like and if you want to learn more about these mud tables take a look at my video on youtube it's about the mud tables so mud blazer tables you'll learn all about the sorting and filtering and all these different things quite a useful thing to know and it's a great tool to use i mean it really helps you out the tables look decent they have all these features um and many options in them so i would definitely use them if it's nothing uh especially beautiful in terms of my application so we have the items okay you set the items and then you set the header content the header content is the table header basically the first row of the table and we have title description price discount sales tax and total we have the total now after that we use context you see these are the cells these are the cells and this is the row so it's kind of like a for each loop basically it loops and instead of a sort of general definition of a for loop for each loop rather you have items in this case is the weirdest context the same exact thing on each uh cycle you'll get to pick your data and we just place it right heavy only so for more difficult part here is the discount as you can see we have a discount in percentage and then we have the discount in the actual currency which by the way we do not have the currency because i forgot to add that field and i later on just thought i would add it later make another video out of it to show you basically how much time it takes to sort of fix that kind of a mistake when you forget to add one field it's not a quick procedure you have to go through everything again and again and again and it will take a bit of time so you hopefully get our idea of that in that next video so we have a discount and then we have a sales tax once again we have it in percentage and then we have it in the currency and then finally we have the total now the total if i go into the total and go to the definition i have to show you this as well because the total is calculated in the model in the class model right here it's calculated like this basically whenever there's a change in discount quantity price or sales tax in any of those variables it will be recalculated that's why i like this approach now there are a few perhaps uh problems and issues with it uh you can't really set it you have to make a different arrangement if you want to set it from some kind of a different place right but this works quite well this does work quite well as you can see it was a whole formula hand again you can find all the source code on patreon and then you also be able to find a link and see how this platform looks when it's published so let's let's just go back quickly to the invoice right here the final thing we have is the mod icon button which is just a button and it will have an icon displayed instead of piece of text it will have an icon and so on that we have on click and in there we have remove item as you can see it takes vid and it will be removing the item so now let's take a look at how you remove the item the procedure to remove the item will be very similar to adding the item if we go into this method remove item where we provide the string id the item id not the invoice id the item id that comes from the contacts in the year table we saw that before so basically once again we create the connection we don't have an error message of any kind in this case which isn't the best thing but that's how it is for now now the next thing open a sync we open the connection we construct in this case we construct the invoice data manager because that's where we will have the method for removing the invoice and this is where we have that method being used so we have remove invoice item we provide the id and that gets removed let's go into the definition right here see we have a public boolean it returns a boolean and it uses the remove stored procedure removing voice item it removes and we don't have any kind of a specific result we just have a result of how many rows were affected and this is what we get from the execute non-query async we do expect it to be one therefore we check for it to be one and then we return true another safety sort of security feature that i added is this owner see user id owner and then we have the item id so it will only remove the item that has this particular id but also it belongs to that particular user so that we don't get any um kind of an abuse in a way right just in case there is that low safety feature so getting back here once that executes and once it gives the green light the true value on the boolean we can then go and remove the item from the list and we just use a bit of link kind of an arrangement and we get rid of that item in the list after that we close connection and we're good to go and once again as you can see i already have a break point in the e the exception okay so this is how you add the items this is how you remove the items and now if we go to the top okay if we go to the top i believe this one right here see we have the invoice total so each item added will add to that list and therefore the total will add up and it will be displayed in here so now you know how we set up the invoice okay we don't have any kind of a final thing here because it all goes into the database so one by one we add the item it goes in we change a piece of text that goes in so we don't have any kind of a save button finalize button maybe i'll add that later but basically now we just work by status and that's all that there is to it so now let's go into the list of my invoices as i called it and in the interface uh let's take a look at that let's see how the list gets displayed and then let's see how the invoice can be edited and how i reused the whole page basically just just a few tweaks on the on initialize the sync to actually allow the user to edit the invoice for the invoice list we will begin from the c sharp part of things rather than that uh mud blazer arrangement so what we have here we have a list right here we have the list the first thing and the most important thing here and then we have a couple of search parameters because we do have the search and the search will occur on a click of a button it does not get initialized on initialize the sync or maybe on the change of something you click a button and then it retrieves the data it's a simple and straightforward way to do it we have the invoices that will be displayed and that is invoice list item invoice list item we use it doesn't contain all the data for the invoice it just contains a few things as you have seen and then we have the search date range this date range is a mud blazer thing it's from the date picker i'll show you that a bit later but basically it has date from and day two and then we have the status the status of the invoice so whichever way selected that will be searched and filtered and sorted and all that so this will occur on the click of the button you'll see that a bit later but once again we open the connection okay construct it then open it and then we are good to go so in this case we need invoice managing with data manager which will provide us with a method to retrieve those invoices this takes date from date two right date from day two and the search status that's so all the parameters that are involved and we won't have anything else let's just go into the definition i'll explain a few rather important things there you can see redhead returns the list that we want it takes the parameters and then it's a retrieve invoices start procedure now this all procedure isn't really interesting you just select and we select a specific item so we also provide all these different things and you may notice there is an additional piece of context here uh an additional parameter and that is the user id or the owner as it is called in the database record this one is obviously extremely important because we don't want a security leak and believe me i have seen quite a few i have think what if you happen this way no one noticed no one cared oh until someone complained and that's not when you want to find out about these because this will be quite obvious if you use a searches for something that is their own right and these other parameters will match this one will not exist well guess what they will retrieve the data for the other users which would be a huge disaster so we do want that okay we filter where the user id is and then we have date from and date two and then we have the status as well have a simple arrangement now after that we establish the results of temporary list then we have the reader we will need the reader because we're reading a loss of data right it's not a scalar so we need a reader and then we'll look through a reader now if you want to learn more about handling the sql sql server procedures via the c-sharp and general sql server you can take a look at my sql server course it covers all the basics of more advanced features the automation inside the sql server the jobs as they are called and also how to interact with it from the c sharp so you can see right here we just add everything to resort but one thing i really want to note here actually two things we have the get value that's the first one you see right here we have the type unique identifier that is not a string that is not a string you need identifier is not a string therefore we get value and we converted the string so that we have a displayable id the next thing is is db null a sync this is to check whether or not the database record is null right whether it exists you see the index the 10 does it exist or not if it doesn't exist therefore it is db no it is no in the table right we will give it zero because in the database it can be no right it can be not can also be zero but it can be no in the database but in c sharp you can't have a norm and also these laws don't convert anyways remember we saw that previously we did a very kind of a great uh updating thing with its methods providing with parameters with nodes and then c sharp nodes and database nodes those are different remember that always remember that and then we get the decimal we use decimal so we have to convert to double and as you can see i check for the nose everywhere i go and of course daytime does not have an author we have to use new date time and now let's go back to my invoices page.razer and once again you can find all this source code on patreon the lowest here is one dollar one euro and you'll get a free course of mine you can pick and choose whichever one you want from the conversion solution learning platform so you'll get all the things that you need so now once we retrieve invoices that is assigned to the list and we get the list other than that i don't display any errors again it's as minimal as possible at this point that's what i wanted to do and later on we will take a look at the exporter now then we can take a look um at this whole table right here we have mud table the same thing that you have seen with the items with the items in the new invoice okay and one thing i have to note is the data models invoice okay so you see i'm using the namespace for the data model so that i wouldn't have to write these huge descriptions which can be quite annoying especially in this kind of a blazer page code you always want to make well try to make as little as possible of that code in this page because it gets messy very fast obviously using more components would be helpful as well but again i wanted to keep everything as quick and as simple as possible later on you can split it around and put different things in different components say header content you might put in a in a different component and place it right hand do all these different things but again in this case we just have header content and we have something called mud table sort label you can take a look at my video about the tables about mud tables in blazer and i'll show you how to use the sort and how to use the filters and all those different things but in this case we just have the sort so this is kind of a funk arrangement again just take a look at that video it's too much to explain in this arrangement it is quite complex but it is very easy to use once you actually know what the stuff means but basically it will sort the list from top to bottom from lowest to highest from smallest to biggest to largest and all that stuff uh but we are saying we are only sorting on the total and we need these empty ones just to keep the style going and then we have a toolbar content which should have been the first thing but it doesn't really matter here we have the mod date range picker so you just bind that to the date range you don't bind it to date time this is not a c-sharp specific type this is a mud blazer specific type wherefore you need to bind it to that date range and then as you have seen it will have uh from and to two dates in that one object so kind of a simple thing nothing too fancy in there and then we have the mod select you have seen this before this is obviously an exact replica of what you've seen in the new invoice because we do need all those different statuses uh the draft the paid and the center and that binds to the search status and then finally on the mod icon button we have on click and then we simply just execute the search method on click which retrieves all those invoices now going into the actual data this is where things get a bit more interesting we have all these um cells they are cells called the right or with that it comes from the context from the list so this is kind of boring and then you see we have this edit link we have the edit link so every invoice will have a link for the editing which as you can see it takes to the new invoice page new invoice page as i mentioned many times previously will be used for editing as well now below that you can see the export arrangement but the exporting of the invoices to pdf that will be the final thing to get to this is probably the most exciting thing on on this whole applications of a weird arrangement is something that i do believe works extremely well but in any case once the user clicks on that link they go to the new invoice page and they can edit it so now let's see how the editing works after the user navigates to this page they will be able to edit the invoice and in order to do that we need to bring the data for that particular invoice into all these fields or more specifically we need to bring it into this invoice invoice variable right we need to put that in and then the user will be editing uh just the same way as they would with the new invoice once they change something in the text box it goes into the database once they add a new item it goes into a database once they remove an item an existing one it gets removed from the database so that's how it all works and the goal here is to bring everything into the invoice but we can't just bring it all the time every time or at least attempt to do it on every uh going in to this page because right here you see we have new invoice page so it's the same page and i'm reusing it which saves a lot of time but you see we have a parameter we have a parameter so that parameter will either exist or it will not exist and here in the bottom on the uninitialize the sync we check for that to be either true or false or either null or something so if invoice id this is the parameter as you can see parameter public and then get set this is how you set a parameter if you don't know and if you want to learn more about blazer take a look at my blazer course i'll teach you all these things about navigation and components and all these different arrangements so we have invoice id and if it's not null that means it was navigated from the list meaning that we need to bring in the data for that particular invoice id we need to bring in the data and for that once again we will be opening a connection a connection is established right here we will be opening it and then we will have the invoice data manager in which we will first use retrieve single invoice method that will be retrieved and it will be assigned to the invoice let's go into this this one is quite complex it's a bit more complex than some of the previous ones yes we have retrieve see we have retrieve invoice items that's not what we want we want retrieve single invoice that's what we want this one right here as you can see it returns the invoice data and we will need a reader even though so one item is so not a scalar value so we do need a reader and then we have a result id see we assign the id from the method parameters to the id to that new object and everything else we retrieve but as you can see right away it's not as simple as that first of all we need to retrieve the companies right we need to retrieve the companies to put into that invoice object so for that in turn we use retrieve company let's go to that we have retrieved company right here as you can see it returns invoice company we have two different companies company from and company 2 but they are all stored if you remember in the same table all the companies are stored in the same table we just get the reference that is the id for one of those companies and we use it in the appropriate place either company from or company 2 and we take the id put it in the start procedure which then simply retrieves the data for that company that's all that barista and as you can see i have a break point in this exception just in case it breaks and i have to handle it let's move to the top so let's see we are back into the tree retrieve single invoice okay and as you can see we get the string if we did get the string that's great and good then we retrieve it now i'm not using the null because we can't have no we can't have north of the company to and company from it gets inserted on the initialization for the new invoice so under normal circumstances that just shouldn't happen for everything else i did put an all handler because that can become quite troublesome and this is not the first time we are talking about it in this whole arrangement as you can see everything else is quite similar we can convert the decimal to double as what we need to do we get in 32 where it's appropriate but we always handle the nulls so let's go back let's go back to the new invoice page or rather the old invoice page in this case right and as you can see once we deal with the invoice retrieval if it fails it will either be no it will be the id will be empty we want to be rather the id either no or empty that's what we want to sort of check for in this arrangement at least or we could just check for the whole invoice to be no it doesn't really matter what we do both of them could be applied but in any case if it failed to do that we just return and that's it it will have failed now as you can see there is no error message right but this is not something that i expect to fail quite often therefore i skip out that extra step which i will add later i will add later but again as i mentioned in the beginning of the video and several times during the video the important thing here is to get it released because many times you have a project you work on it you perfect it to try to perfect it you work and work and work and then you decide to drop it because it's been doing that you've been doing that for half a year it got messy you forgot what was going on and it never got released what a waste of time right so the goal is to get it released as soon as possible with as little effort hopefully as possible right so after we have the invoice we can retrieve the item so we have the items and then we use retrieve invoice items method we can just take a quick peek into that you can see it returns a list of invoice items again we will have a just a procedure and you can get all the source code from patreon you also get a free course at least one free course for the higher tiers who gets several courses and you also get an opportunity to request a specific video from me so maybe you want some c-sharp explanation maybe you want perhaps some third-party tool explored i will do that for you so we have retrieve invoice items that's just store procedure that will retrieve the invoice items and you see this is what it does now this one did not exist i didn't want to mess with it i just skipped it okay we don't need the date we don't use the date in the display yeah i just established it but we didn't have it so whatever right i just skip it just let it go i didn't bother with it because we don't really need it and then we return the result that's all that there is to it just if we go back as you can see this is the last step this is the last step and then we have items if it is no we assign new list okay we assign new list because it has to be new list because we're simply adding it we're not checking for no on every new item ad attempt now the next thing the next thing is actually quite important now you may know in c sharp when you have a list and you push it through some kind of a method and those parameters it will not be basically a new instance of that list it would just be the reference of the existing list therefore we need a constructor a separate constructor to sort of create those lists for the generator we will need that so update total okay update total will only allow the total of the invoice to be updated when it is set to true okay when it is set to true it will allow for that to happen now if we go just into that invoice let's go to definition let's see if we can go quickly let's do it like that go to definition again and here we have it you see we have update total is false so if it's forced it will be updating total and then we have this overload of the constructor there is a normal sort of class model right where you just um take it construct it and assign the values that's all great and good okay but then we have the total which gets calculated in this kind of a weird way perhaps but this is only probably the only way to do itself properly and sort of on the go which is what we really want otherwise it would mess up the whole view of the code in that actual page now we have this method it takes obviously the item so whenever the items change this will get recalculated the total will get recalculated right here and so it does the calculation anyways but the point is basically to update the total okay update the total in the database in the database now the reason is the reason for that is because initially when that invoice is created everything is null and it all will default to zero okay so let's go back to that i'll try to explain this as best as i can and so right here this will be which will get constructed it will come from here but the invoice might have a few items so therefore it will have some kind of a total which is inserted into the database right so let's say it has three items and the total is 100 okay the total is already 100. if we were to just construct it and leave it be what would happen if we go back to see if we can go back to this right here what would happen is this would run okay this would run update invoice data and the total would be updated and at that point the total for the invoice would be set to guess what zero it would default as whole calculation would default everything to zero and that may ruin the database record in the database therefore we only want to update the total once we are sure that we have the whole list of items in this object once we're sure that we can set update total true and only then it will be updating once you add a new invoice once you remove uh rather add item and remove item so only then will it be updated this is very important and as i mentioned before we do need this kind of a stuff because we do need uh this constructor this is quite a important assist constructor as you can see it creates a new instance of the list see a new instance of the list it doesn't uh take the reference because we will be using that list in the sort of perhaps a bit more of a weird way when we're generating the invoices and speaking of generating the invoices we have now gone through the initialization of that invoice we have gone through editing we have gone through the list and now it's time to take a look at the export feature of that pdf invoice how it gets generated where does the controller come in and all those different things before we get into the code let's take a look at how it all works in the actual interface right in the application itself so we have a new invoice which is actually the edit page oh new invoice page is the added page as you have already learned and now if i click the export button the file the pdf file will be generated okay it was generated and i'll click on that link and it will be downloaded what happens is the file gets generated somewhere in the server and it will lay around with that link being available now at the moment it was laying around forever because again i didn't want to waste any time and probably in the future i'll actually make a video on a windows service how to create one so for for this kind of a thing to remove the stale files that haven't been used for say half an hour or an hour but basically the idea is that if someone exports it opens it up and then closes it they can go back and click on the link rather than clicking on the export which generates the file which in turn uses a lot of resources so uh the hope here is to save some server resources that's all that restored now if i click on the link it takes me to a new page and i have my invoice right here the invoice is nothing special and again just a basic layout for that basic first release that's what the whole thing is all about here but we have invoice we have the id of the invoice and you could do something different with it obviously right but i chosen this because that is the id recorded id in the record that is what we use so that is what i display then we have the ship too as you can see doesn't do it doesn't go into a different line doesn't do lines so that's something you have to work out in a different way i didn't bother with that because again it would be a waste of time for that sort of initial release after that we have business from business too nothing was inserted therefore it's empty and then we will have some items so just quickly i can go and add some items right here let's say let's do 50. okay let's say test and test and let's click add so now that we'll have that and as you can see the last export was 255 now it's gonna be 257 as you can see it did change i'm gonna go into that and as you can now see we have total 50. and if we go down you can see we do have that first item test description is test the price is 50 quantity is one and then we have the sales tax which is zero percent discount zero percent therefore the total is 50. so everything matches everything works now let's just take a quick look at the list let's go to my invoices as you can see this sort of quick tap arrangement doesn't really work all that well but it doesn't really matter so i have my date range picker right here i have a set to draft yeah let's just go into draft and this is the invoice that you saw previously it's created today just a few moments ago we have the id and then if i click the export right here you see it exports right in the list i'll explain how that works a bit later and if i click on that we go into the invoice everything works perfectly so now what i will do i will go into the code and i will show you how this page gets generated and then i'll show you how the interface works so how it works in the list and how it works in the new invoice page the whole code for generating a new pdf invoicer file is contained in one simple class or not exactly simple but at least in one single class we have it in the services in the invoice folder as you can see we have everything sorted quite properly in these folder arrangements and let's start looking at it now if you don't know how to use the pdf generator do take a look at my video about that do take a look at my video about the setup and just adding the items creating the list going to multiple pages before going through this video okay do that before it will be more exciting to actually watch this particular arrangement because you know all the complexities and it is very complex it is actually very difficult to use and not just knowing what to do but just in general thinking about it looking at things you don't really have any kind of a designer you have to just put in numbers and hope for the best basically now the whole thing right here the class right and we have a couple of variables the first one is the pdf document so this is where the pages will go in where perhaps the document data will go in and finally this is the object that will be exported into a file the next thing is the invoice data and the invoice data will come in on the constructor it will come in on the constructor just like it usually does but then as you can see we'll use that fancy constructor for a model remember the list in c sharp if you just pass it through a parameter it will be a reference and therefore when we're dealing with this kind of a thing it might get ruined the original list might get ruined you might get items removed and all those bad things can happen and to avoid that we need to get rid of that reference and create a new instant for for ourselves so this is how we do that you saw that previously a few minutes ago in this videos and basically the previous section right so we have the invoice and this is what we will work with the main method here is generate okay the main method of this class is generator let me just expand that a bit like that you can see we have the first page region we have add pages and then we have the export so the export is a sort of standalone method and generate is the standalone method the other ones although they are set to public for some testing reasons they should be private right they they could be private at least and they are basically referred to and used by this generate class okay let's go into the first page we add the page and we have the first page we must start with the first page and we must add those different things and you could add some of these things at once so you could add general information business information and the first page table at once just do tasks um and all these different things right and if you want to learn about uh sort of for running several things at once in c sharp take a look at my c sharp course you also learn many more things about all these files and what to do with files how to use files how to use that sort of binary data when with c sharp basically everything you need to know about c sharp now let's get back to this and you can see we have the x graphics we get x graphics from the page and basically this x graphics class it allows you to draw everything so if you want to modify the page you do it by referencing x graphics again take a look at my video you learn all about that but we take that and then we provide it into the ad general information it is a sort of a reference okay it is all for reference so we don't need to return it reassign it or something like that we just take a reference into the add general information and you'll notice we always take the x graphics we always take the x graphics we do not take the page that won't work we need to take the graphics there will be several reasons why it won't work but uh that's how we have to do it so do be mindful about that if you need to reference something uh with these arrangements use the x graphics rather than going by the page okay pdf page it is i use the variable because i was lazy probably but it is a pdf page the type of it so let's go into the add general information let's just go to the definition right it will be in this first page region let's open it up the first method it does return a boolean i didn't add any kind of an error handler in here anywhere because again as mentioned previously many times this is made to be released it's not made to be your perfect project sitting somewhere who knows where this is just what we need to do where we can cut corners so perhaps somewhere it will be a bit ugly perhaps some errors won't be handled as well as we should be but at the end of the day it will be released it will be in that beta mode maybe someone will help you test it maybe some random user will help you test it and you will be getting some data and you will be happy because you have achieved something now we have that in general information so let's just go to this whole thing and basically we will be drawing strings we will be drawing quite a few strings in this case we just draw the strings we draw lines or rectangles something like that but you saw the invoice right this is the top line the top line of the whole thing we have the invoice and we have the invoice id so we just draw it the invoice for word will be a bit bigger font the invoice id will be a bit smaller we add some styles we use x font to create a font and then we use x brushes to create the color we use black but again this is all about the layout at this point some call this a bit a bit different but it's not really about the design in terms of colors and the sizes of things it's more about the layout and that's what you should really focus on when dealing with with this library first you focus on layout and then you can maybe add styles if that's what you really need because doing the layout it ain't easy right it is not easy by any means you have to just basically guess the numbers now i have done quite a few of these arrangements so i do have a sort of a feel for it but even then it's easy to get lost in these numbers and especially once we get to some of these other parts so we have x point right this is from the left this is the margin from the left and this is the margin from the top this is where the text will sit and the same goes for the next one for the id and after that we have draw string total discount business 2 business from okay just like that since it's all in the one line for the total and for the discount we don't need to draw additional strings to draw these totals and in fact this is actually uh probably a bit better especially once i will add that feature of adding the currency because then i won't have to worry about the distance between this text and the currency right now it wouldn't really matter uh because it begins at this point somewhere anyways it's a fixed place but once you have something beyond that non thinks fixed place that's where you can have quite a few problems so this is just a general data quite a simple thing nothing too difficult here okay so what's the next one we have the next one will be the shipping information and the shipping information you saw that it creates a sort of rectangle but it could be empty right you don't always ship items so you don't always ship your invoices in fact i've never shipped an invoice at least i don't believe i have but i have issued many of them so either shipping address may not be used and if it's not being used we don't want to go through this because if we go into it you'll see that we create a rectangle in fact the first thing we do is draw a rectangle so that's a container for the shipping information and if we had no shipping information we could just go through it this if this was no it would fall it would throw rather the exception okay it but it wouldn't be instead it wouldn't insert anything it would just have a rectangle laying around which is not nice it's not pretty it's pointless it shouldn't be there so that's why we have that little if statement now other than that we draw the container with a rectangle you'll see another container drawn with lines instead of rectangle kind of a pointless thing but i wanted to show you the difference so this is the rectangle this is one line and this is how you achieve a rectangle you have the x-pen that's the color basically just the color and the weight of those borders that's it and then you have the placement of it just like we have with the text we have left margin from the left margin from the top and then we have the size the width and the height that's all we have so these you can separate them like that this is the placement of the container and this is the size of the container that's it that's all that there is to it and then inside there we draw another string and then another string above it to say ship two and then obviously inside will be the shipping address now i'm not handling the new lines which i should be doing probably and maybe i'll show you how to do that but it gets complicated really fast with these arrangements it's just insane how complicated it can get and and so every little corner you can cut you should just take the opportunity to do it because again it will waste your time and sometimes these don't really work all that well for most part the basic stuff is great but if you go into some more advanced arrangements so you can get some of these weird errors and exceptions and those will be troublesome to handle to say the least now then we have the ad shipping information let's go back to our main point of reference and now we can take a look at the business information okay adding the business information we will look at these basic things and then we will take a look at the pages probably the most exciting thing in here let's go to the business information this is kind of a bit more complex let's expand that and you see i have company from and i have a rectangle now can you guess where the rectangle is can you guess oh it's probably quite obvious right i have top to bottom lines and left to right line so this is my rectangle and if you remember the previous one was just one line of code this if you draw lines you have four lines of code and it's incredibly difficult to get it right you need to make calculations you need to maybe even guess some of these numbers to fit them right and into the right places so it is quite difficult i wouldn't advise using this method i just want to hopefully show the differences if you can actually see the difference but you can get the source code on patreon and if you compare the source code directly on your computer you should be able to see the difference now having said all that if you do draw lines you will have more place to sort customize things right you can maybe do the lines that are left to right longer than uh the whole width of the container so do kind of a fancy sort of arrangement or something like that maybe you want to bend it a little right or do something exciting with it if you're a bit more of a designer than i am so any in any case we have this whole thing and once again we just have two points for the lines and that's the first point left to right okay this is the first point so that's margin left to right and that is uh our margin from the left and that is margin from the top and this is the second point exactly the same thing so it goes from one point to the other that is how lines work in mathematics right you know all about the lines it's not too difficult and then after that we have all the company data all the company data now you see we do have quite a bit of code and it doesn't look too difficult but getting the placement right is actually quite tricky so the less you have to do the less data you have to show the better the quicker you will be able to be done with it and to get to the next thing which is hopefully the release of the project the publishing it on iis or maybe using azure or something else so we have all this stuff and again we just set the font and we have in this case i'll show you uh we use uh x solid brush this is how you set the custom color so uh you can see right here it's from arbg uh just a random color now if you need the colors you just go to google and google uh color picker just write a rbg color pick and you'll get many of them so it's not that difficult to do you shouldn't be guessing the colors even if you know even if you you're very much experienced with it and you think you know these colors just go and to find the picker it will be a lot quicker like that so after that the x point and that's it basically it goes for everything like that and then we have the company too so this one is a bit further as you can see again something that's quite difficult to get right you need to match the top margin but you need to move the left margin and you sort of keep the top margins in place and then move that around a very difficult procedure indeed but it does work in the end and once again this is just the copy basically the difference here the difference here if i can show you properly uh see we have in the first one we have a 50 okay the starting point is 50 from the left that is the company from and then if we go to company 2 it's 350. therefore we have moved 300 points from the starting position okay 300 points uh further is the new starting position for that second container and that one hasn't changed we don't want that to change so that hasn't changed now you know sort of how this whole thing gets generated to the extent of general data the totals are right but we still need to add the items so now we will look at adding the items at this point you have seen what we do to generate the general information the shipping address and the business information so all that stuff is ready and is in the page now what we are left with is the items okay the items the final thing but that comes into two stages given that there are enough items first of all we have add first page table the items are in a table and we will be adding them into tables but if we have more than five items and we check for that right here we will move that into the next page because obviously it will never fit into one page all the items if you have 50 of them they will never fit in one page we need to move into the next page and this is what we do if we have five or less we don't even bother because the first page can take all five and then we just do the first page if we have more okay if we have more we saw of finish with that first page and then we move with adding other pages maybe one maybe two maybe 50 who knows and it doesn't matter it will add all of them but of course we start with the add first page table method and once again i just want to note we do take gfx x graphics right here we do not take a reference to page directly we need to take the reference to the x graphics so let's jump into this and let's see what's happening the first thing you have to do all i had to do or we have to do is set the count or the n okay so this is uh how many items there will be in this first page now you may be thinking we have total of five maximum of five so why do we need so many well the reason is because we are building a table we are establishing a table okay and it will require drawing some lines in some ways where you have to know the exact scope of the table meaning the exact number of records in that table and so if the count of items invoice items is more than five meaning that it will jump into second and maybe more pages then we just set the count okay or rather we just set the five but on the other hand if it's less than five then we set the count for the items meaning it's a different number it might be one item it might be two or three or four items or five items but it's not more than five it's if it's more than five we just stick to the five and that's it because that's the maximum we can go to okay let's start with the first part of it you can see right here i have a rectangle i have a rectangle i have a few lines and i have a few strings what is this this is the head of the table right the first soft row where we name all the columns you may notice we don't have the description because if you've seen uh the previous part of this video and you should have seen it it's very important to see it the description goes into a sort of next row kind of a bottom i do that because description would obviously contain more text than the title for example of a price at least in theory and in general that's the idea of the description right it should be larger than the title so we leave more space for that basically the whole width of the table we leave for the description therefore we don't name it anywhere in here but we do have to establish a rectangle for that and the rectangle as you can see it just has all these dimensions again there's nothing too much to explain in terms of the dimensions what you have to do when creating these things you have to find your reference points so initial reference points and then do some trial and error and then do some calculations along the way now obviously you could create some kind of a perfect plan but if you're not experienced with this pdf sharp library it will be extremely difficult to actually do that and it will be time consuming either way and chances are you'll miss one of these numbers you write in a wrong one you make a mistake and then you'll still have to go through that trial and error process so planning is indeed required but not too much of it i would say so what we have here we have if you remember this is a left margin from the left margin from the top this is the extract it actually says uh you see it's x and y so or you could say the starting position i guess x starting position and y starting position of of that rectangle in this arrangement and then we have the width and the height as you can see the height is 25 so this will basically uh cover those uh names for things right the title the price and these different arrangements now these lines these lines are separating they are separating uh all these names so these lines are vertical these are vertical lines that we are drawing and that's it that's all we need for the names now the names uh the beginning of that table that's the easy part it's not too easy per se but it is the easy part of this arrangement because the next part is indeed difficult now we need first of all to set a starting point a starting point for the first two lines the first two lines each record will have one line the first line okay the line one right here that is the starting point from the top margin from the top the y okay the first one ends with the price the discount the title with that row that you've seen okay and the next one will end with the description and it will go and go and go and go and it will be increased and increased and increased and all that happens in the for loop it all happens in a for loop let's open that up and as you can see the for loop the limit of that loop is the n the n if you remember that is the maximum amount of rows in that particular table in this particular first page so what we do here we start drawing the lines we start drawing the lines and some of them are thinner some of them are thicker the lines all kinds of different arrangements we will have but as you can see all of them are lines now they there aren't that many of them and there aren't that many strings in here but it is very difficult to do it is very difficult to do you just have to take your time and do it there's no real cutting off the corners here obviously you need to simplify it as much as possible and that's why i tried to do here to get it up and running and released as soon as possible having said that i am not going to lie to you this is not an easy process and you should expect to take some time with it in fact you probably take more time with this whole generating thing then you take time with setting up those databases and inserting the records and editing the records so just to give you some real world comparing of things and how much time they take to make so let's start with these two lines as you can see we have a thickness of a bit of a different perhaps thickness and these as you can see let's go a bit to the left the right you see this is the line one line one line two line two so this first line will be the actual line one and this one will be the actual line too these are the actual lines so now on the next ones i did something a bit different i'm not taking uh i'm not taking the original lines i could have done a reference point to that as well just as simply as a i could have done with that it doesn't really matter in this case but basically okay if i just go to just a bit to the left like this we have the draw of the line and we have it increasing on every cycle it will be increasing so this one starts from the left to 50 right and then it's 521 the original size will be 12 521 because we it will add zero 60 y0 would be zero but on every cycle it will be increased by 60 okay it will be multiplied and increased like that so this takes some time to sort of work out and see if things are actually matching but it does work out in the end now this as you can see the x-coordinate is the same therefore what that means is that the line is vertical right it goes from 521 to 550 okay and the next one will be 581 okay that would be well not this one but on the other cycle in the next cycle right it will be 581 and then that will be 610 and it will go and go and go and go and go and go like that just like that and we have a few of them so basically these are matching those initial lines for the column names that's what we are matching in fact if we take a look at the top let's say we have 250 and 320 okay 250 and 320 and we do indeed have that right here 250 320 and then 420 and then 500 it all goes and it will match the previous arrangement and actually this is a kind of a reference point that you can check you can see if everything is working correctly you take a look at that if they match that's great and if they don't match obviously it won't align so they do have to match now then on to the next thing we have i guess we can take a look now at the drawing of the spring because those are just the vertical lines and then we draw the strings draw the strings which is great and good but you may have noticed in the models okay in the data models for the item and for the invoice i always had preset the empty string are no nose in there i do not use nose the reason for that is because if i put a null value in here it will indeed throw an exception and it will ruin the whole thing now this is sort of done in a way where if one method fails it will still generate somewhat of an invoice having said that if it fails say on the title it will mess the whole thing up and it will actually be very difficult to debug at least in terms of getting some users feedback and debugging from that now speaking about debugging i will get to that actually i'll get to that a bit later but let's just finish with this as you can see it just loops through the items using the eye for from the for loop and that inserts it and then it inserts it again if you're not following this you should definitely watch my video on how to use pdf sharp in the first place because it is rather difficult and i actually show you how to make a table and how to sort of jump into the next page and to other pages and different pages and just the basics of it what does the drawstring do how to set up the documents how to set up or draw the lines of the basic stuff and how to set it up in general because in blazer and dotnet 5 it won't work just by referencing the library do you need to have a fancy arrangement there is a way to make it work and as you can see i am making it work but you do need to do something in order to make it work now then we have a a few perhaps more exciting arrangement we we have a quantity q and t short for quantity in this case and then we put it right here but we put it below the price okay we put it below the price the price is for one item right just like we insert in the table and then the total right hand the bottom the total will be calculated by multiplying the quantity by the price and adding a sales tax and subtracting the discount but as you can see we do both things just like we did in that uh setup thing in the table in the blazer and the well mud blazer right we used for that arrangement we do calculate the price in money and we have the price in percentage and we do need to put it in one string that's the best case scenario you see i draw one string and i simply add the percentage the separator and then also the total of that percentage rather the monetary value of that percentage value add it in one string the reason for that is because the string that one string it will have one static starting point but then it will be able to scale to the right to sort of fit properly i won't have to sort of be worried that maybe the discount percentage will go beyond this percentage sign it will go into that number no it will not happen it will go sort of properly just like you would have any other string obviously it can't go out of bounds and this is kind of one of the flaws with this whole application you have seen that happen with a shipping address that is not addressed that's of going out of bounds things but again you want your basic product you want something releasable and so you have to avoid those sort of nitty-gritty kind of things so you just have to avoid it there's no other way around it otherwise you'll spend a lot of time and this will never get released okay so on every cycle on line one y uh we add plus 60 that's what we do that's what we add this basically all that we really need to do and it just draws and draws and draws okay and then finally once we end the loop remember we still don't have the borders on the left and the borders on the right we don't have those two giant lines and this is where we add the lines okay this is where we basically add the lines as you can see it always starts at the same point this is the line on the left this is the line on the right but then we multiply 60 by the n the n is the total number of uh those rows that were added in this particular arrangement in this particular case and then we draw the line up to that point and that's how we have the table for the first page and that's it now just before we go to the multiple pages i want to address one thing about the task okay a sync task now i'm sure someone will see this and comment uh that you shouldn't have a task like that you should return task completed or do something else and all that stuff having said that vsync is where for a reason i will be adding some insights later on so i could actually follow and track some things and see if something breaks some logging arrangements i will be adding therefore i will be needing the async part that's why it's green i know i am aware of it it's done on purpose so with that said now we can move into multiple pages at this point we are done with the first page region right here we have the first page region and we are done with it you saw how to add the first page table how that is done and so now we can jump into the add pages so for more pages one or two or three or however many you have or need right it will depend on the items if we jump into that just quickly go to definition as they usually do open that up we have a pdf page and we have line two and all these different things well let's start let's start with say the loop okay let's start with the loop kind of going from a different place but it will come together because as you can see the loop starts from i five it's not from zero the reason for that is simply because we already have those previous items inserted in the first page we already have that we don't need it anymore so we can move on to the next thing and then we start from that particular index and then our limit simply becomes the count okay the count of the items is our limit that's it now initially initially we need a page we need a page we also need the x graphics because remember we can't really reference the page all that properly we need to uh sort of reference and recreate the x graphics rather than the page it's just the way it goes the way it works so let's get into that we have a page right and then we have a new page being added add page that creates the reference for the page and then we create the reference for the x graphics we take that from the pdf page this new page but you see it only happens in this if statement what does it mean right what does the if statement mean it's either equal i equals to the five meaning that it will be the first cycle okay so it's going to be either first cycle or it's going to be divided by 10 meaning every 10 every 10th item so we have these two parameters and that is when the page will go into the next page just as simple as that and for that we need to then add a new page take the gfx and then do all this stuff in the new page that's all that there is to it now it seems all simple and ready to go but actually creating this once again it takes a lot of time so you do need to get those corners in order to get this whole thing released okay but the whole thing is again we have this if statement hey this if statement basically starts up a new page if it's not a new page it simply adds the items if it is a new page it once again goes into the if statement and recreates that page creates a new page has the reference and now we are working with that new page so now let's take a look at how it all comes together in the if statement after the new page is created and the reference is added for the x graphics we can begin drawing and everything pretty much everything in this new page in this if statement will be meant for establishing the top part of the table so the head of the table the header of the table show what you like to use and that's all we have now we also have this uh vertical line for the whole tape or just like you saw in the first page in the first arrangement so we have this uh these two draw lines and then we start drawing the vertical lines we start drawing if we go to the left a bit uh you'll see this one is the top one and then we start drawing these vertical lines and i kind of align them with the text so we have a title then we have our little vertical uh line that's separating the next thing which is the price and it goes on and on and on similar way to what you saw previously and once again you can find the source code in patreon and you'll get a free course as well maybe a few free courses depending on your tier you'll be able to choose them uh whichever one you want for my courses on the competition solution learning platform so the next thing of course is sales tax and again we just have everything to set of that table in that simple sort of way and another thing you see we have line one y and line two y so just like the first page table we have the first line for all these different things that goes below all of these right and then the second line goes below the description that's how it works now these you see we are set we set them right here this is we sort of initial set we would didn't really need them but it doesn't really hurt to add those numbers here just so you have a bit of a reference again some cleanup is required here but it doesn't matter as long as it works and so on every such cycle where you need to move into a different page you need to reset the line one because obviously we need to start from the top of the page and that is what this does so now let's minimize this if statement let's get into the next part right and the next part is of course just that row of the table so kind of a simple thing again we'll need a few lines and and in this case we just use this line 1 y and line 2y if you remember for the first page table i did it in a sort of a different way which doesn't really matter which one you do but that one was 60 multiplied by i in this case we don't multiply it by i we just use the line two and line one y okay and then on every cycle we just add it and you saw that in the if statement on a new page it will reset to that sort of default value but other than that we just add 60 and add 60 and add 60 we have 10 items for each page and they fit quite well now other than that you already saw this and you saw this in the first page okay we have all these vertical lines the horizontal lines uh being drawn and then we draw a few strings we also make the calculations right we make the calculations price quantity multiplied by discount we get the discount and do all these great things so that the user can see everything quite well let's see if i can get back to it so that's basically it right we exit the loop and we return true again you see no handling here but i'll just add a few things to log the errors for now i'm probably not gonna do a video on that it's a very specific system of mine i don't really want to show that but you get the idea you just log the errors somewhere in the exception probably uh write a file somewhere do something like that now you see how this works so hopefully you have a bit of an understanding and of course you can download this code and learn more about it that way here just to go through it and see how it all actually comes together if you're just starting out of these pdf arrangements or in general if you're just starting out with c sharp and you've never seen something sort of very complex you know you've just been doing maybe a few interfaces i think this will be helpful to sort of get an idea on how you can do things in a more simple way not what you see in these fancy books where you have who knows how much code for a very tiny little feature so you know just to give you a bit of a perspective on on what can actually be achieved if you just don't really care about every little detail and you just want to get something actually published actually released now with that said we'll jump into the export i'll explain this sort of fancy arrangement within that export it's kind of an interesting thing so let's just do that i will now explain the two-step system that we have here for exporting the files we of course start with the export method and in it we simply have the exporting of that document so remember we have a first point of reference to the document the document object that has all the pages all the data that you need for the pdf file and then you can choose to either save it to a stream or you can choose to save it to a file which is what i do in this arrangement now you might think it would be perhaps more straightforward to save it to stream and then somehow download that and it may be possible to do something like this but i believe this is better and this is more efficient in terms of those server resources or at least it might be the case now mind you we don't have a service to remove stale files as i mentioned previously but that will be added later and we'll probably make a video on that it can be quite interesting with services so we just have where it goes where the file will go we create a directory because that might be a problem if it's not created in the server we would just check that it does indeed exist and then we simply create a file that will be file okay the id for the invoice dot pdf that's it we just save a pdf file that gets created and it returns true and if it fails it returns false i'll show you the interfaces later but now let's go and see how it gets downloaded so in here i have my invoices controller i've added the invoices controller to the server side blazer project that is indeed possible adding these controllers it's not actually that difficult to do and i think this might be useful if you have say server side blazer application the web application and you also want to develop a mobile app say for android ios or something of that nature so in that case you can just add a controller now let me just quickly explain how it's added you can see right here we have controllers folder you add your controllers like you would do in an api project and if you want to learn more about api development take a look at my api development course or if you want to learn blazer and api development and sql server take a look at my whole huge course it's about 11 hours at the moment and it's a slow paced course where i type the code in and explain it but you'll learn the blazer you'll learn api development you will learn sql server in two different ways add-on net plus the entity framework access and you also learn a bit about html plus css so a very useful course it is a slow paced environment so if you're into that do check that out uh on my confiscation solution learning platform and you'll get some other great deals or you can get the source code for this on patreon and you can pick that course to get it for free now let's move on we have a controller let's write the controller folder we still need to add a few things in the startup if we go quickly to the startup i'll explain this a few things just to sort of set it up and have everything running in the configure services we need to add controllers okay we need to add controllers because we are using them now also you may notice we have this add mod services is this is for the mod blazer in order to make the mod blazer work you need to add the services so you also need to add services for the client side blazer as well which is perhaps quite unusual but you will need to do that so check out my video about implementing the mudblazer setting it up sort of for basics of mudblazer it's a great video and you'll learn all about it and and how to set it up and where to put different things but in any case we add the controllers right here and we will need to map the controllers right here just like that endpoints map controllers and that's it we have the controller so nothing too difficult here you might just have to play around a bit with it but it is indeed possible to add that as you can see and again it might be quite useful if you're developing something else here an app a mobile app or something like that let's get back to the invoices controller we just have one route download generated pdf that's all that we need you see that link displayed right you saw that with the date the last generated data and then we just have download file file result and we just open the read for the generated files for that particular id in the same structure that we saved it in it's going to be application slash pdf the content type and it will download the file that's it that's all that there is to it now you could add perhaps some token to make it a bit more secure or something like that it all is possible and it's all very very useful so you see how we download it now let's take a look at two different interfaces for the new invoice and for the list for the new invoice page the export is relatively straightforward because we only have one expert on that one page so one export per page basically right and for that we just use a couple of variables we don't need to have anything too dynamic here we have boolean export ready originally it's of course false right and then daytime last export let's just go a bit to the top right here this is where it will be displayed you saw that link so if the export is ready true right expo ready true we display this mod link it goes to a blank a new tab and we give it a link the link if you remember that comes from the controller that's it we provide the id and it takes the id and it downloads the file and of course we have lost updated at last export so this is how the display works and let's see how it's uh it gets 12 generated we also have this export arrow we saw that it's displayed in a simply red colored paragraph a red color for the text only so if the text is empty it's not displayed if it's not empty it is displayed that's it that's all that where is it and we use this export button or method rather on the button we need to reset the error every time in case there was one and you retry and it all works perfectly so that it wouldn't be sort of lurking around and then we construct generate invoice pdf we went through all that it generates the invoice and to generate the invoice we simply run the generate method you saw that as well it checks all these things and says checks if it's one page or more pages and adds all the data and then it returns it actually does return a boolean value but i didn't bother with that we don't really have any sort of proper way of checking it anyway so we just have what we have but we do have a try and catch statement and it catches we do have a break point right here so if it goes into the catch into the exception it will say unable to export and if it's else on export boolean it will say once again unable to export unfortunately but that's how it is right it may not be able to export hopefully it will be able to export and hopefully it will run well but once we have the export we set export ready to true therefore the link gets displayed and we simply update the last export time and we convert it to local time as all that were restored in this new invoice now let's take a look at the invoices list in the invoices list the export is a lot more complex because we have more than one possible export in this page right so we have to have some kind of a list in this case we have a dictionary and let's just zoom into this we have this dictionary string which is the invoice id and then date time which is the last export for that particular id now if we go to the top this is the table okay the table you saw this before this is the mod button for the export so once you click that the export begins the export method takes the idea i'll show you that a bit later but then we have this if statement okay if statement so remember in the row template everything is different on each cycle you get a new context a new object for each cycle and then on each cycle we check if it contains that specific id for that specific invoice if the dictionary does not contain an id that means the invoice was never generated right it was never generated therefore we do not display this link to the invoice to be downloaded right we do not display it however if it was indeed inserted it will be in that dictionary and it will contain that key therefore it will display the link and then we will also just take from the exports we will take the value key value write dictionary value is the daytime last updated ad so kind of a relatively simple arrangement with a a bit tricky to arrange but again as you can see the code is relatively clean there's not much stuff going on into it now if we get to the export this will be a bit more complex because we actually need to retrieve the invoice from the database we don't really have it we have the list and we have a bit of data for the invoice itself but we don't have the items when we don't really have some of the other stuff right that we need say for example the companies therefore we will establish the connection we will open the connection and we will use invoice data manager just like we would do for the editing you saw the editing we retrieve single invoice and then for that single invoice we retrieve all the items all the available items for that invoice and we reset the error export like that um perhaps it should be done a little bit earlier wouldn't hurt probably but it doesn't matter right i'm not going to bother changing it now i can do that later so after that we get to the pdf generator construct that take the invoice and generate and export just like you have seen previously in the new invoice page now this is of course a bit different because we need to check we need to check if exports contain that key if it's already been exported right if it's already been exported it will be the key will be in the list it says that the file has been updated wherefore we just update the date we just update the date and we move on if not if it's a new if it's a newly generated pdf file then we add the key the id and then we add that current time and that's it that's all we have and on else if it's not able to export we say unable to export and if it fails with the exception we say unable to export now the error isn't really all that well displayed in here but it really doesn't matter it's not the point in this case if you wanted to display this a bit better obviously you would need to use a different object rather than dictionary or you would use dictionary but instead of chess day time you would use a custom model and do you have the time the error and then you can display it like that but all that can be done later there's no need to bother with all of that right there's no need to bother because there are more important things to do such as publishing this application and also in this arrangement since i missed the currency i will also be adding the currency so the next video will probably be adding the currency or it might be the publishing i'm not really sure but the next video will be coming out very soon uh whichever one it may be so look forward to that and also take a look at my courses in the meantime take a look at those videos about the pdf shop about the mud blazer and of course check out my other videos you can also take a look at some of my other blazer examples my free blazer example course now on youtube three different examples um perhaps a bit smaller ones but they are on client side laser so that's i guess somewhat interesting as well and of course if you want to get the source code get it on patreon you'll get a free course maybe a few free courses depending on the tier and with that said we will conclude this video
Info
Channel: taurius litvinavicius
Views: 946
Rating: undefined out of 5
Keywords: blazor, .net 5, server-side blazor, blazor example, pdf invoice generator, pdf invoice generator in blazor, pdfsharp, pdfsharp example, pdfsharp tables, pdf sharp, invoice storage platform, c#, programming, programming examples, .net 6
Id: gz_0Kb0lclQ
Channel Id: undefined
Length: 150min 50sec (9050 seconds)
Published: Mon Jun 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.