LM and PDF? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: LM and PDF? (/showthread.php?tid=2341) |
LM and PDF? - MarcusH - 13.11.2019 Hi I've tried to search for this, but can't find anything. Is it possible to somehow create a template with scripting that can import values from LM database and visualize it with graphs and all the imported values and send it to mail as an PDF without third party services? The case is, im creating a energy monitoring system. My initial tought was to just send a pre fabricated CSV file to the owner, but started to think it might be better to create a PDF document which was sent to the owner every month with graphs and values for each office area or industrial building which makes it easier to bill their different tenants. Best regards Marcus RE: LM and PDF? - Erwin van der Zwart - 13.11.2019 Hi, Why not build a html page and add it to the mail? This way you can make a great layout with any format you like and add it to the body of the mail. I have some energy report samples with tables so it shows how to do that but you need to optimize them.. BR, Erwin RE: LM and PDF? - MarcusH - 14.11.2019 (13.11.2019, 15:50)Erwin van der Zwart Wrote: Hi, Great! If you could share it with me, I would be very greatfull I've not used html that much, but everytime is a first. Best regards Marcus RE: LM and PDF? - Erwin van der Zwart - 14.11.2019 Hi, Here is a sample how to build a HTML formatted energy report.
HTML Energy Report.lua (Size: 4.81 KB / Downloads: 122)
BR, Erwin RE: LM and PDF? - Geert - 15.03.2020 Hi, How can I combine the HTML report with a csv attachment? RE: LM and PDF? - admin - 16.03.2020 See this thread: https://forum.logicmachine.net/showthread.php?tid=394 3rd argument (message) should contain HTML that you want to send. RE: LM and PDF? - Geert - 19.03.2020 Hi Admin, It's not quite clear for me how I can implement HTML text with variable text into the Message Code: -- adjustable information RE: LM and PDF? - admin - 19.03.2020 What kind of variables do you want to add? RE: LM and PDF? - Geert - 19.03.2020 Hi, The variables I want to add are implemented in the HTML text as shown in the testscript: ]] ..FINummer.. [[ ]] ..current_date.. [[ ]] ..current_hourandseconds.. [[ ]] ..Filename.. [[ ]] ..AantalECG.. [[ For every project variables are put on top ( --adjustable information--) to change depending the project. Now the message in my mail is as shown at the top, but I want to replace it by the HTML text (--HTML text to implement in Message--) RE: LM and PDF? - admin - 19.03.2020 Line 48 is incorrect, try this: Code: res, err = mailattach(MainEmail, Subject, htmldata, Filename, csv, 'text/csv') RE: LM and PDF? - Geert - 19.03.2020 Thx again! RE: LM and PDF? - Fahd - 05.05.2023 (14.11.2019, 08:56)Erwin van der Zwart Wrote: Hi, Hi, While I'm trying to use the script from Erwin van der Zwart I got this error in the logs, Quote:* string: error:1408F10B:SSL routinessl3_get_record:wrong version number RE: LM and PDF? - admin - 05.05.2023 Change secure = 'sslv23', to secure = 'tlsv1_2', RE: LM and PDF? - Fahd - 05.05.2023 (05.05.2023, 07:14)admin Wrote: Change secure = 'sslv23', to secure = 'tlsv1_2',Forget to mention that I changed this part headers = { from = "sed <xxx>", to = "Rcpt Name <xxx>", subject = "Report" }, body = { [1] = { headers = { ['Content-type'] = 'text/html' }, body = htmldata }, } } r, e = smtp.send{ rcpt = "<xxx>" , from = '<xxx>', source = ltn12.source.chain(source, filter), user = 'xxx', password = 'xxx', server = 'smtp.office365.com', port = 587, secure = 'tlsv1_2', } RE: LM and PDF? - admin - 05.05.2023 For port 587 you need to change secure to starttls instead of tlsv1_2 RE: LM and PDF? - Fahd - 05.05.2023 (05.05.2023, 07:25)admin Wrote: For port 587 you need to change secure to starttls instead of tlsv1_2 Thanks a lot |