mogsdad / sheetconverter Goto Github PK
View Code? Open in Web Editor NEWGoogle Apps Script library - interprets Google Sheets Formats, converts to formatted text or html
Google Apps Script library - interprets Google Sheets Formats, converts to formatted text or html
I wanted to add an additional attachment to the emails that I send, so along with the email, I wanted to attach a PDF document that represented the HTML content that was sent in the body of the email using your SheetConverter.convertRange2html(rangeObject). I used this small tutorial to go about this, however there is one small issue: it doesn't seem to convert colored ranges over into the PDF. Most of the formatting looks correct. Just no background color is showing. I did a small test without SheetConverter and just a small piece of html with an h1 and color set to red, and it worked just fine. Any ideas on how we can go about this to correct it?
Also wanted to check on any progress that might have been made to fixing merging cells to show up properly through HTML.
Best,
Gerneio
Could you enable SheetConverter to work with V8 Runtime?
https://developers.google.com/apps-script/guides/v8-runtime
6
SyntaxError: Unexpected token 'class' (line 58, file "Code", project "SheetConverter")
Can able to convert excel into web app with EASA software , Spreadsheetconvert and Appizy ..But cannot able convert google sheets into web app .......
Pleases How to help me for Google sheets convert to web app .....
when using the convertRange2html functiun, and tryng to send the html code by email then, the result does not correspond to what we see in googleSheet
There are problems on :
V6, last version I think
If merged cells are present in sheet, all text gets pushed to first cell
Merged cells
Expect to see result as merged cell
6
var ss = SpreadsheetApp.getActiveSpreadsheet();
var conv = SheetConverter.init(ss.getSpreadsheetTimeZone(),
ss.getSpreadsheetLocale());
for (var key in colNums) {
var colNum = colNums[key];
// use a range and preserve formatting with SheetConverter
var range = thisSheet.getRange(rowNumber, colNum, 1, 1);
var array = conv.convertRange2html(range);
console.log("sheetconverter "+rowNumber+","+colNum+": "+JSON.stringify(array));
// ...
See screenshots of original cell and the result...
If I just use convertRange(range), it only seems to grab the plain text in the array.
Either way, it does not grab the formatting of the bold words. I don't really care about the background color. I just want the bold words.
This is a translation table for comic book dialog.
When we have a range of merged cells in the worksheet to retrieve the range of these cells and convert to html, html generated table presents separate cells.
Logger.log(SheetConverter.convertCell(new Date('Sun Oct 25 2015 14:10:58 GMT+0200 (CEST)'), "h:mm am/pm"));
// Bug: Returns 13:10 PM instead of 1:10 PM
Latest
Can you give an indication as to by when will you be able to fix the issue?
When cells are merged in spreadsheet it doesn't display it correctly on mail body. It display all such data in first column.
Data should be displayed in same place where it displayed in spreadsheet for merged cells.
Data should be displayed in same place where it displayed in spreadsheet for merged cells.
5
I am looking into modernizing my current Google Apps Scripts (GAS), within which I currently use SheetConverter. However, as this guide points out, local scripts will not "know about" referenced "Libraries" (as the GAS docs refer to them) unless they are wired up via a corresponding type/npm package.
Make SheetConverter available available as an npm package so that modern GAS implementations can import them.
Per the GAS + typescript docs, you can simply ignore reference errors in local code with a ts-ignore
statement. I will probably do this for now, but eventually I would like to implement a true package reference for SheetConverter so that I can run tests at its boundaries.
Hi David!
Hope you're doing well! Firstly, I'd like to say THANK YOU for your outstanding work and the SheetConverter in particular. You saved A LOT of time for me and numerous users. I really appreciate your effort and contribution!
May I kindly ask whether it might be possible in the nearest future to export tables that might contain links in some cells?
Thank you and have a wonderful day!
Alex
Hello,
When trying to add the library in appscript engine i get the following error:
"Unable to look up library. Check the ID and access permissions and try again."
Do i need to request for access or are there any org setting that are preventing me from adding this library?
Hello,
I am using a QUERY() function to create a tablet in a sheet that is then sent via email using Google Apps Scripts with your library.
When the numbers are formatted as currency (e.g. €), the email with the table is wrong.
In particular, all the numbers have €-2
prepended.
For example € 2
(as seen in the spreadsheets) becomes € -220
(in the email receveid) and so on.
I have added a trigger for scheduling mail to my script, but the trigger seems to fail. My sheet is generated by a query as below.
=Query(Sheet1!A1:E99,"Select B,C,D Where E = 'Open' Order By C,D" )
The script works fine if I run manually.Here is my script:
function ReportByMail() {
var ss= SpreadsheetApp.getActiveSpreadsheet();
var mRows = ss.getActiveSheet().getRange('F2').getValue();
var range=ss.getActiveSheet().getRange(1, 1, mRows-1, 3);
var conv = SheetConverter.init(ss.getSpreadsheetTimeZone(),
ss.getSpreadsheetLocale());
var html = conv.convertRange2html(range);
MailApp.sendEmail("[email protected]","Daily Reminder Services","body",{htmlBody:html} );
}
When running the function I'm getting the error:
Execution failed: Those columns are out of bounds. (line 213, file "Code", project "SheetConverter") [9.712 seconds total runtime]
Seems the issue is around this part of the code:
for (var col=startCol; col<=lastCol; col++) {
colWidths.push(120==sheet.getColumnWidth(col)?100:sheet.getColumnWidth(col));
tableWidth += colWidths[colWidths.length-1];
}
I'm pulling the range I want to send over email in with formating this way: var range = s.getRange(4,2,s.getLastRow(),46);
If I change column 46 to column 45, the issue is solved, but it will exclude column 46 from the output. Sounds like column 46 was out of range, but it actually exists (used COLUMN() function to be sure is they right number). I also tried getMaxColumns() with the same result.
Here's the full function I'm using,
function myFunction() {
var s = SpreadsheetApp.getActive().getSheetByName('MYSHEETNAME');
var range = s.getRange(4,2,s.getLastRow(),46);
var to = "MYEMAIL" ;
var htmlTable = SheetConverter.convertRange2html(range);
Logger.log(htmlTable);
var body = "Launches with timeline changes:<br/><br/>"
+ htmlTable
+ "<br/><br/>"
MailApp.sendEmail(to, 'Subject', body, {htmlBody: body})
var rangesToClear = ["B5:AT"];
for (var i = 0; i < rangesToClear.length; i++){
s.getRange(rangesToClear[i]).clearContent();
}
}
Should be getting the full range from column 2 to column 46, and from row 2 to the last empty row.
Version 6
i'd like to edit the tableformat variable with my own design flair, is it somehow possible to declare this outside of the base code?
cannot run and is showing error message SyntaxError: Unexpected token 'class' (line 58, file "Code", project "SheetConverter"
cannot run and is showing error message
6
https://github.com/mogsdad/SheetConverter/blob/master/SheetConverter/Code.gs#L58
class
keyword is reserved, you should rename it.
When sending an email using the HTML converter, cells with a duration over 24 hours are reduced to a time format h:mm:ss
"[h]:mm:ss"
37:05:24 shows as 13:05:24
6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.