I am new to python, and your video helped me to automate creation of 500+ docs with tables inside. I saw other videos, but your is the one I was looking for. I just copied the code and adjusted to my specifics, and everything worked like charm, no errors. Thank tou very much, sir, really appreciated!
Hi dude, a great video . Thanks 4sharing. Lets say we have to print all the invitations of the first example in the same file but in different pages? Or even in the 2nd example we have to print differents reports in different pages in the same file. How to deal with that? Thanks in advance.
Hii, just just a for loop to print all the invitations or reports in the same file. You can also insert page break in the template word file to ensure that each report starts from a new page Hope this helps, Cheers 👍
Hi i am getting the following error "the file is not displayed in the text editor because it is either binary or uses an unsupported text encoding" - i have my doc staved as doc.x and can see it in my explorer under desktop folder.. why won't it work?
Hi, the docx files shared the video description are word files. So please try to open the files in Microsoft word or libreoffice. Hope this helps, cheers 👍
Very informative video..Can you please tell what modifications should be done in this to integrate with a CSV file/excel ?(Suppose we need to generate certificates for internship candidates)
Hi, unfortunately this solution only works with word template. You can use libraries like openpyxl for populating templates in Excel files Hope this helps, cheers 👍
I'm trying to link where (in the dictionary) sNo is k+1, but item.sNo doesn't appear in the template word file. I can see the column, but no variable reference to it? Does it read the header? The header is s.No instead of sNo.
Hi, I understood your question. Actually the serial number is auto generated by word. We did not send serial number variable in the context rows. Please download and see the template word file. If you are not comfortable with this, you can also use the serial number as a variable in each context object row. Hope this helps 👍
Great video! Is there any way to automatically add multiple images from a folder? If the number of pictures changes from time to time, I was wondering if you can make the code to add them dinamically into the word file in a table. Congrats for the video anyway:)
Hi, it is really simple to render a list of images in word file using docxtpl. Just create a list of image objects and assign to a context object key. Then use word file table to render the list of image objects using for loop. That's it. I will also try to make a video on this in the future. Hope this helps. Cheers👍
Hi, On this topic, I have created a video at ruclips.net/video/mcZkZvkwgFA/видео.html and blogpost at nagasudhir.blogspot.com/2022/01/render-images-from-folder-in-automated.html
Hi, the blogpost for this video can be found at nagasudhir.blogspot.com/2021/10/docxtpl-python-library-for-creating.html In this example, we have initialized random sales rows and populated in the report template. But for real world problems, the rows can be derived by fetching data from a database or calling an API Hope this helps, Cheers👍
Hello my friend. Thanks for your video. I have some questions. 1.- Is neccesary to put curly braces for replacement? 2.- In my template (is a resume template) i have 3 bullet list as an sample. Can i remove this list and put my own elements (can be 10+ elements) with docxtpl? 3.- I have a section "Work Experience" that has Year start and end, company, position and description for each position the candidate worked. It is not in table or bullet list. can i replace this?
Hi, 1. curly braces are necessary because it is jinja templating 2. At 11:40, I have explained how render a list, please refer that 3. You can replace this the same way using the technique I mentioned at 11:40. You need to render a list of objects where each object has attributes for year start, end, company, position etc. Hope this helps, cheers 👍
@@henryvaldivia3355 hi, download the template word file from the description of this video. Copy paste a table from that word file and customise it as per your requirement. May be this helps👍
Suppose we need to send letter and a customer has multiple addresses. How can we use python to generate copies equal to the number of address ess? and how can we add a tick a addresses so for example if a person has two address it should be possible to generate two copies and put a tick on the first address in the first copy and put a tick on the second address in the 2nd copy.
Hi Arvav, It is definitely possible to create multiple reports from a single template. For the use case you mentioned, you can create a report context for each customer address, run a for loop and create a report for each context. You can have a variable in each report context that has all customer addresses in an array and a variable that specifies the index of the address to be ticked (Example: index=2 means 2nd address). Based on the address index, you can tick only the specific address in the generated report. This is a solution I just made up. You can also create more optimized solutions to solve this problem. Hope this helps. Check out the link of the blog post in video description for source code. Cheers 👍
Hi, my recent blog post and video are on this topic only, you can check the video at ruclips.net/video/KV6iHKhJDdM/видео.html and blog post at nagasudhir.blogspot.com/2022/01/conditional-statements-nested-for-loops.html Hope this helps Cheers 👍
Great video! Thanks a lot. Is that possible the output to be in powerpoint? For example, I have a Word report and to do it the same using a powerpoint output.
Hi nice tutorial. Can I do an If-else statement on the word template? Like if there’s no data from the python program then there should be no table created via the word template?
Hi, I have created a video on how to use conditional statements in docxtpl templates at ruclips.net/video/KV6iHKhJDdM/видео.html The blog post is at nagasudhir.blogspot.com/2022/01/conditional-statements-nested-for-loops.html Hope this helps Cheers👍
Hi, good question. As per the documentation at docxtpl.readthedocs.io/en/latest/index.html?highlight=escape#escaping-1, this issue is due to escaping of XML characters like "
hello, in one of my application if user order more then one product we have to create same structure of table for each product dynamically and stable structure, style provide user only , we just know filed/label are fix. so any one can guide how we can achieve.
Hi, you can create multiple tables using for loop. But the style of all the tables will be the same. If you have a complex scenario, you can create HTML files dynamically using jinja templating. I will try to make a video on this topic in the future Cheers 👍
Hi, all the formatting of the table, paragraph etc can be done manually in the word file. docxtpl just populates the data in the template word file. hope this helps👍
Hi, you can set page numbers in word template itself and it will appear in the rendered document. We don't need any python programming for that... Table of contents can be created programmatically and injected into the document. Or else you can create the table of contents elemnt in the template itself, but user need to manually update the table of contents in that case. Hope this helps, Cheers 👍
Hi, It happens sometimes, please create a new word file and copy paste the text and use it. Sometimes it works. If still problem exists, then it might be due to the problem in jinja template markup of ur word file. You can send me the word file and python code so that I can see what's wrong. My email is learningsoftwareskills@gmail.com. Hope this helps👍
@@learningsoftwareskills Excel contains specifi data like Pass or Fail, just for instance. Instead of giving Excel report if we provide pie chart report. It looks good..
@Imran20091990 Hii, it is achievable. Just read excel data using pandas into a dataframe Use that data to create a plot (like pie chart, bar chart etc) using matplotlib and save the image as an image file. Use that image file to populate in the report template (watch from 15:42) Hope this helps Cheers 👍
Hi, thanks a lot for your encouraging feedback. You can email me at learningsoftwareskills@gmail.com. I am very delighted that this content helped you Cheers 👍
Actually you can't import pandas dataframe directly into the word file. You need to run a for loop over each pandas row and render the required columns in the template word file table. However, i will also try to search if we can create columns dynamically which may make this possible. Cheers👍
im sorry but its so anoying to hear ur intrincated and dificult to understand accent. i wish some normal people do this in porper english not that giberish you speak
Hi, thanks for your feedback, please checkout the blogpost at nagasudhir.blogspot.com/2021/10/docxtpl-python-library-for-creating.html if you have issues in understanding the English accent Hope this helps, cheers👍
I am new to python, and your video helped me to automate creation of 500+ docs with tables inside. I saw other videos, but your is the one I was looking for. I just copied the code and adjusted to my specifics, and everything worked like charm, no errors. Thank tou very much, sir, really appreciated!
Thanks for the encouraging feedback 👍🙏
Great Video, Nice Explanation.
Thanks a lot for the encouraging feedback👍
you saved me with this tutorial - THANK YOU! straightforward and gets the job done. 10000/10 🔥
Thank a ton for the amazing feedback. I am very happy that this content is helping people 👍😊
Sir you have really saved my day. Thank you for this tutorial.
Thanks a lot for the feedback 👍
Thank you. That was an excellent and simple video to follow. Congrats.
Thanks for your positive feedback👍
Wonderful explanation! thanks a lot for this masterpiece
Thank you for the awesome feedback 👍
Thank you so much for the detailed explanation. it really helped me!
You're welcome 👍🙏
Great Video! very helpful
Thanks for the amazing feedback 👍
Thank you so much! You're very helpful for me to get how to work with tables :)
Thanks. I am glad that this content helped you👍
Hi dude, a great video . Thanks 4sharing. Lets say we have to print all the invitations of the first example in the same file but in different pages? Or even in the 2nd example we have to print differents reports in different pages in the same file. How to deal with that? Thanks in advance.
Hii, just just a for loop to print all the invitations or reports in the same file. You can also insert page break in the template word file to ensure that each report starts from a new page
Hope this helps, Cheers 👍
Great Explanation
Thank you 👍
exactly what i needed!!! thanx
Thanks for for the encouraging feedback👍
highly appreciated work
Thank you 👍
Great video! Thanks so much. Please make a video on linking excel sheets into word using python.
I am getting 'ModuleNotFoundError: No module named 'docxcompose'. I have installed it using pip but still the error persists
Awesome man, thanks, this helped me
Hi, I am glad that this content helped you. Cheers 👍
Hi i am getting the following error "the file is not displayed in the text editor because it is either binary or uses an unsupported text encoding" - i have my doc staved as doc.x and can see it in my explorer under desktop folder.. why won't it work?
Hi, the docx files shared the video description are word files. So please try to open the files in Microsoft word or libreoffice.
Hope this helps, cheers 👍
Very informative video..Can you please tell what modifications should be done in this to integrate with a CSV file/excel ?(Suppose we need to generate certificates for internship candidates)
Hi, unfortunately this solution only works with word template. You can use libraries like openpyxl for populating templates in Excel files
Hope this helps, cheers 👍
I'm trying to link where (in the dictionary) sNo is k+1, but item.sNo doesn't appear in the template word file. I can see the column, but no variable reference to it? Does it read the header? The header is s.No instead of sNo.
Hi, I understood your question. Actually the serial number is auto generated by word. We did not send serial number variable in the context rows.
Please download and see the template word file. If you are not comfortable with this, you can also use the serial number as a variable in each context object row.
Hope this helps 👍
thanks for your sharing.
Thanks for the feedback 👍
Thankyou you saved me.
You are welcome, thanks for the amazing feedback, cheers👍
Great video! Is there any way to automatically add multiple images from a folder? If the number of pictures changes from time to time, I was wondering if you can make the code to add them dinamically into the word file in a table. Congrats for the video anyway:)
Hi, it is really simple to render a list of images in word file using docxtpl.
Just create a list of image objects and assign to a context object key.
Then use word file table to render the list of image objects using for loop.
That's it.
I will also try to make a video on this in the future.
Hope this helps.
Cheers👍
Hi, On this topic, I have created a video at ruclips.net/video/mcZkZvkwgFA/видео.html and blogpost at nagasudhir.blogspot.com/2022/01/render-images-from-folder-in-automated.html
Thank you for helping me.
You are welcome 👍
except for the background noise and the not so good voice quality
you my dude explained without a hitch and clearly
Thanks a lot bro 👍🙏
Thant you for this video, I have a question about how I can automate range of rows in salesrows
Hi, the blogpost for this video can be found at nagasudhir.blogspot.com/2021/10/docxtpl-python-library-for-creating.html
In this example, we have initialized random sales rows and populated in the report template. But for real world problems, the rows can be derived by fetching data from a database or calling an API
Hope this helps, Cheers👍
@@learningsoftwareskills thank you
Hello my friend. Thanks for your video. I have some questions.
1.- Is neccesary to put curly braces for replacement?
2.- In my template (is a resume template) i have 3 bullet list as an sample. Can i remove this list and put my own elements (can be 10+ elements) with docxtpl?
3.- I have a section "Work Experience" that has Year start and end, company, position and description for each position the candidate worked. It is not in table or bullet list. can i replace this?
Hi,
1. curly braces are necessary because it is jinja templating
2. At 11:40, I have explained how render a list, please refer that
3. You can replace this the same way using the technique I mentioned at 11:40. You need to render a list of objects where each object has attributes for year start, end, company, position etc.
Hope this helps, cheers 👍
Hi my friend thanks for your replay, i do exactly what you say but i got error saying unrecognized tag tr why this happens?
@@henryvaldivia3355 hi, download the template word file from the description of this video. Copy paste a table from that word file and customise it as per your requirement. May be this helps👍
Suppose we need to send letter and a customer has multiple addresses. How can we use python to generate copies equal to the number of address ess? and how can we add a tick a addresses so for example if a person has two address it should be possible to generate two copies and put a tick on the first address in the first copy and put a tick on the second address in the 2nd copy.
Hi Arvav, It is definitely possible to create multiple reports from a single template.
For the use case you mentioned, you can create a report context for each customer address, run a for loop and create a report for each context.
You can have a variable in each report context that has all customer addresses in an array and a variable that specifies the index of the address to be ticked (Example: index=2 means 2nd address). Based on the address index, you can tick only the specific address in the generated report.
This is a solution I just made up. You can also create more optimized solutions to solve this problem.
Hope this helps. Check out the link of the blog post in video description for source code.
Cheers 👍
@@learningsoftwareskills could you show us?
Hi, my recent blog post and video are on this topic only, you can check the video at ruclips.net/video/KV6iHKhJDdM/видео.html and blog post at nagasudhir.blogspot.com/2022/01/conditional-statements-nested-for-loops.html
Hope this helps
Cheers 👍
Great video! Thanks a lot. Is that possible the output to be in powerpoint? For example, I have a Word report and to do it the same using a powerpoint output.
Hi, nice query. I will search in the internet of there is a library for populating templates in PowerPoint.
Cheers👍
Hi nice tutorial. Can I do an If-else statement on the word template? Like if there’s no data from the python program then there should be no table created via the word template?
Hi, I have created a video on how to use conditional statements in docxtpl templates at ruclips.net/video/KV6iHKhJDdM/видео.html
The blog post is at nagasudhir.blogspot.com/2022/01/conditional-statements-nested-for-loops.html
Hope this helps
Cheers👍
Μπράβο, μπράβο !!!
Thank you 🙏👍
I am not able to populate less than a symbol using docxtpl. for example "< 1 " gives me output only 1
Hi, good question. As per the documentation at docxtpl.readthedocs.io/en/latest/index.html?highlight=escape#escaping-1, this issue is due to escaping of XML characters like "
hello, in one of my application if user order more then one product we have to create same structure of table for each product dynamically and stable structure, style provide user only , we just know filed/label are fix. so any one can guide how we can achieve.
Hi, you can create multiple tables using for loop. But the style of all the tables will be the same. If you have a complex scenario, you can create HTML files dynamically using jinja templating. I will try to make a video on this topic in the future
Cheers 👍
How can I add just blank tables without data in it?
Hi, just keep blank tables in the template word file itself. Does this solve your issue...👍
Danke!
Hi, thanks for the feedback. Thanks for the super thanks too 👍
How can we add outer border only on table. and how can we add border to paragraph
Hi, all the formatting of the table, paragraph etc can be done manually in the word file. docxtpl just populates the data in the template word file.
hope this helps👍
Hi, is there any way to create header and footer ( with page number ) and Table of Content with this library?
Hi, you can set page numbers in word template itself and it will appear in the rendered document. We don't need any python programming for that...
Table of contents can be created programmatically and injected into the document. Or else you can create the table of contents elemnt in the template itself, but user need to manually update the table of contents in that case.
Hope this helps, Cheers 👍
@@learningsoftwareskills thanks brother.
@@arpitj07_ any time 👍
great tuto, but pdf converting doesn't work, No PDF file is generated and no error is shown!?
Hii, docx2pdf requires Microsoft word to be installed in the computer. Please check 👍
@@learningsoftwareskills Yes it was the problem
@@wiki-infodevelopment3369 Glad that it helps 👍
Hi, I tried this way of writing to document files but when I open the saved word file I get an error 0x80004005. Could you help me fix that?
Hi, It happens sometimes, please create a new word file and copy paste the text and use it. Sometimes it works.
If still problem exists, then it might be due to the problem in jinja template markup of ur word file.
You can send me the word file and python code so that I can see what's wrong. My email is learningsoftwareskills@gmail.com.
Hope this helps👍
Could you pls do the video for Excel into Pie chart or any other..
Hi, I did not get what u meant by "excel into pie chart". Could you please elaborate...
@@learningsoftwareskills Excel contains specifi data like Pass or Fail, just for instance. Instead of giving Excel report if we provide pie chart report. It looks good..
Based out on Excel data we should provide pie chart report. Both should be available..
@Imran20091990 Hii, it is achievable. Just read excel data using pandas into a dataframe
Use that data to create a plot (like pie chart, bar chart etc) using matplotlib and save the image as an image file.
Use that image file to populate in the report template (watch from 15:42)
Hope this helps
Cheers 👍
@@learningsoftwareskills Excellent. Thanks.. will try...
Thanks this help my large law firm project go smoothly.
I don't know if I could contact you to get some help
Hi, thanks a lot for your encouraging feedback. You can email me at learningsoftwareskills@gmail.com.
I am very delighted that this content helped you
Cheers 👍
Θα με ενδιέφερε να δω πώς θα εισάγω df Pandas μέσα σε αρχείο word...
Actually you can't import pandas dataframe directly into the word file. You need to run a for loop over each pandas row and render the required columns in the template word file table.
However, i will also try to search if we can create columns dynamically which may make this possible.
Cheers👍
And python pdf plz
Hii, please watch at 18:03 of this video, there pdf report is also explained
Hope this helps
Cheers👍
im sorry but its so anoying to hear ur intrincated and dificult to understand accent. i wish some normal people do this in porper english not that giberish you speak
Hi, thanks for your feedback, please checkout the blogpost at nagasudhir.blogspot.com/2021/10/docxtpl-python-library-for-creating.html if you have issues in understanding the English accent
Hope this helps, cheers👍