简体   繁体   English

无法在Web应用程序中导出图纸数据

[英]Not able to export the sheet data in web app

I am using a web app which consists search button on top, as per search criteria it will pull the data from a sheet. 我正在使用一个Web应用程序,该应用程序在顶部包含搜索按钮,根据搜索条件,它将从工作表中提取数据。

After adding the date in sheet (example Date format-1/4/2017), it stopped working. 在工作表中添加日期(例如日期格式-1/4/2017)后,它停止工作。 If i remove the date (column C)then it works perfactly fine 如果我删除日期(C列),那么它可以正常工作

Please help me to fix the issue 请帮我解决问题

Complete code and sample sheet for your reference [Sheet][1] 完整的代码和示例表,供您参考[表格] [1]

[1]: [1]:

You need to use getDisplayValues() instead of getValues() and also you need to convert date string to date object. 您需要使用getDisplayValues()而不是getValues()并且还需要将日期字符串转换为date对象。 Replace the below lines in code.gs 将以下行替换为code.gs

var aData=sheetDatabase.getRange(searchResult+2, 1, 1,sheetDatabase.getLastColumn()).getDisplayValues();
aData[0][1]= Utilities.formatDate(new Date(aData[0][1]), "GMT +1","yyyy-MM-dd hh:mm:ss a");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过网络应用将数据保存在Firebase中 - Not able to save data in firebase from web app 使用ASP.Net MVC Web Api将JSON数据导出到Excel工作表 - Export JSON data to Excel sheet using ASP.Net MVC Web Api Google App Script - 导出没有工作表名称的活动工作表 - Google App Script - Export Active Sheet Without Sheet Name 如何在 web 页面上创建导出到 Google 表格按钮? - How do I create an export to Google Sheet button on a web page? 根据用户在 Google 站点(网络应用程序)中的选择更改 Google 表格数据 - Change Google Sheet data based on user selection in Google Site (Web App) 如何根据单元格值将 Google 表格中的数据显示到 Google Web 应用程序? - How to show data from Google Sheet To Google Web App based on A Cell Value? 无法使用 React APP WEB 部分从网站内容的特定列表项中获取数据 - Not able to fetch data from particular list item of site content using React APP WEB-part 使用Ajax将Google图表导出到GAS网络应用中 - Export google chart into a GAS web app with ajax 无法使用制表符插件将数据导出到Excel工作表 - Unable to export data to excel sheet using tabulator plugin 将数据导出到excel(.XLSX格式),XL表侧面的结构是自定义的 - Export data to excel(.XLSX format), structure in side the XL sheet is custom
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM