在设计ARJS报表时,往往会设置时间类型。比如短时间、长时间、短日期、长日期等。由于时间类型在json中是以字符串的形式存储的,所以在设计报表的时候要使用Format函数来设置时间,需要先把字符串转成时间类型,再设置时间格式。下面不多说,直接上手演示1.首先进行时间转换,将Json中存储的字符串类型数据转换为时间类型使用“DateTime.Parse()”转换时间类型DateTime.Parse([,])2.打开报表设计器,将数据源数据集绑定到数据源:OrderDate表示时间[:"山泰企业","OrderDate":"1996/01/3110:00:00","Freight":32.38,"ProductID":42,"ProductName":"BrownRice",Unit8"Quantity":10,"Discount":0,'Amount':98,"DiscountAmt":0,"NetAmount":98},{"OrderID":10248,"CustomerId":"VINET","CompanyName":"山泰企业","OrderDate":"700/1","0/396"Freight”:32.38,“ProductID”:72,“ProductName”:“SourCheese”,34ice:“Quantity”:5,“Discount”:0,“Amount”:174,“DiscountAmt”:0,"Netamount":174},{"Orderid":10248,"Customerid":"Vinet","CompanyName":"山泰企业","OrderDate":"1996/10/3100:00:00","Freight":32.38,"Productid":17,"Productname":"Pork","UnitPrice":14,"Quantity":12,"Discount":0,"amount":168,"Discountamp":0,0,"Netamount":168},{"Orderid":10249,"Customerid":"Tomsp","CompanyName":"DongdiWang","OrderDate":"1996/07/0500:00:00","货运:11.61,“productid”:14,“productname”:“沙茶”,“unitprice”:18.6,“数量”:9,“折扣”:0,“金额”:167.4,“discountAmt”:discountAmt“:0,”"NetAmount":167.4}]3.数据源数据集绑定后,将对应字段绑定到表中4.转换时间类型{DateTime.Parse(OrderDate,"YYYY/MM/DDHH:mm:ss")}5.设置Format格式6.预览结果