{ "Version":"6.7.5.1", "Title":"7-2a.脚本.计算字段", "Author":"锐浪报表软件", "Description":"在记录集的“提交记录前脚本”属性上写报表脚本,实现计算字段求值。", "Font":{ "Name":"宋体", "Size":105000, "Weight":400, "Charset":134 }, "Printer":{ }, "DetailGrid":{ "CenterView":true, "PrintAdaptMethod":"ResizeToFit", "Recordset":{ "ConnectionString":"Provider=Microsoft.Jet.OLEDB.4.0;\r\nUser ID=Admin;\r\nData Source=C:\\Grid++Report 6\\Samples\\Data\\Northwind.mdb", "QuerySQL":"select d.Productid,p.ProductName,d.Quantity, d.UnitPrice\r\nfrom OrderDetails d inner join Products p on d.ProductID=p.ProductID\r\nwhere d.Productid<10\r\norder by d.Productid", "BeforePostRecordScript":"var AmtFld = Sender.Fields.Item(\"Amount\");\r\nvar QtyFld = Sender.Fields.Item(\"Quantity\");\r\nvar PriceFld = Sender.Fields.Item(\"UnitPrice\");\r\nAmtFld.AsFloat = QtyFld.AsFloat*PriceFld.AsFloat;", "Field":[ { "Name":"Productid", "Type":"Integer", "Format":"000" }, { "Name":"ProductName" }, { "Name":"Quantity", "Type":"Float", "Format":"#,##0.##" }, { "Name":"Amount", "Type":"Float", "Format":"#,##0.00" }, { "Name":"UnitPrice", "Type":"Currency" } ] }, "Column":[ { "Name":"Productid", "Width":1.5875 }, { "Name":"ProductName", "Width":3.38667 }, { "Name":"Quantity", "Width":2.38125 }, { "Name":"UnitPrice", "Width":2.2225 }, { "Name":"Amount", "Width":2.77813 } ], "ColumnContent":{ "Height":0.582083, "Cursor":"Magnify", "ColumnContentCell":[ { "Column":"Productid", "DataField":"Productid" }, { "Column":"ProductName", "DataField":"ProductName" }, { "Column":"Quantity", "TextAlign":"MiddleRight", "DataField":"Quantity" }, { "Column":"UnitPrice", "TextAlign":"MiddleRight", "DataField":"UnitPrice" }, { "Column":"Amount", "TextAlign":"MiddleRight", "ForeColor":"0000FF", "DataField":"Amount" } ] }, "ColumnTitle":{ "Height":0.582083, "Font":{ "Name":"宋体", "Size":105000, "Bold":true, "Charset":134 }, "ColumnTitleCell":[ { "GroupTitle":false, "Column":"Productid", "TextAlign":"MiddleCenter", "Text":"产品编号" }, { "GroupTitle":false, "Column":"ProductName", "TextAlign":"MiddleCenter", "Text":"产品名称" }, { "GroupTitle":false, "Column":"Quantity", "TextAlign":"MiddleCenter", "Text":"数量" }, { "GroupTitle":false, "Column":"UnitPrice", "TextAlign":"MiddleCenter", "Text":"单价" }, { "GroupTitle":false, "Column":"Amount", "TextAlign":"MiddleCenter", "Text":"金额(计算字段)" } ] }, "Group":[ { "Name":"Group1", "GroupHeader":{ "Height":0 }, "GroupFooter":{ "Height":0.582083, "Font":{ "Name":"宋体", "Size":90000, "Bold":true, "Charset":134 }, "Control":[ { "Type":"SummaryBox", "Name":"Summary1", "AlignColumn":"Quantity", "Left":4.97417, "Width":2.40771, "Height":0.582083, "TextAlign":"MiddleRight", "DataField":"Quantity" }, { "Type":"SummaryBox", "Name":"Summary2", "AlignColumn":"Amount", "Left":9.57792, "Width":2.80458, "Height":0.582083, "TextAlign":"MiddleRight", "DataField":"Amount" }, { "Type":"StaticBox", "Name":"StaticBox5", "Width":1.98438, "Height":0.582083, "Text":"总计" } ] } } ] }, "PageHeader":{ "Height":0.79375, "Control":[ { "Type":"StaticBox", "Name":"StaticBox7", "Left":0.185208, "Width":3.41313, "Height":0.396875, "Text":"产品销售汇总表" }, { "Type":"SystemVarBox", "Name":"SysData1", "Left":8.17563, "Width":7.62, "Height":0.396875, "Format":"报表打印时间:yyyy年MM月dd日 HH:mm:ss", "SystemVar":"CurrentDateTime" }, { "Type":"Line", "Name":"Line1", "Top":0.608542, "Width":16.0073 } ] }, "PageFooter":{ "Height":0.582083, "Control":[ { "Type":"MemoBox", "Name":"MemoBox1", "Center":"Horizontal", "Left":6.21771, "Width":3.59833, "Height":0.396875, "TextAlign":"MiddleCenter", "Text":"[#SystemVar(PageNumber)#]/[#SystemVar(PageCount)#]" } ] }, "ReportHeader":[ { "Height":1.5875, "Control":[ { "Type":"StaticBox", "Name":"MainTitle", "Center":"Horizontal", "Left":4.7625, "Top":0.185208, "Width":6.48229, "Height":0.608542, "Font":{ "Name":"宋体", "Size":150000, "Bold":true, "Charset":134 }, "TextAlign":"MiddleCenter", "Text":"按产品统计销售汇总报表" }, { "Type":"StaticBox", "Name":"SubTitle", "Center":"Horizontal", "Left":1.13771, "Top":0.79375, "Width":13.7319, "Height":0.608542, "Font":{ "Name":"宋体", "Size":120000, "Bold":true, "Charset":134 }, "TextAlign":"MiddleCenter", "Text":"金额字段在记录集的“提交记录前脚本”中计算" } ] } ] }