jrp Posted June 6, 2025 Posted June 6, 2025 Hello, How to access the values in the summary row of TUniDBGrid? (not from the OnColumnSummaryResult event). Thank you Quote
Sherzod Posted June 6, 2025 Posted June 6, 2025 Hello, Try searching the forum using the keyword summaryRenderer — you might be able to extract a solution for your case. Quote
jrp Posted June 6, 2025 Author Posted June 6, 2025 Hi Sherzod, thank you. I read the threads with the keyword 'summaryRenderer' but sorry I could not understand the JavaScript 😅 I need to read the text in the summary row. I just need to read, not write. Could you show me how to do that? Thanks Quote
Sherzod Posted June 6, 2025 Posted June 6, 2025 Hello, Just to confirm — you want to read the summary row value on the client side, right? Could you maybe explain your goal a bit more? Quote
jrp Posted June 6, 2025 Author Posted June 6, 2025 53 minutes ago, Sherzod said: Hello, Just to confirm — you want to read the summary row value on the client side, right? Could you maybe explain your goal a bit more? Yes Sherzod. I want to read the summary row on the client side. My goal is to make a procedure to create HTML table from UniDBGrid for printing purposes. The procedure would take a UniDBGrid as input, and produce HTML table from it. I could read all data rows of the UniDBGrid from the underlying Dataset connected to the UniDBGrid, but I haven't been able to read the contents of summary row from the UniDBGrid. Quote
Sherzod Posted June 17, 2025 Posted June 17, 2025 On 6/12/2025 at 11:50 AM, jrp said: Any news about this? Hello, One possible solution: 1. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniDBGrid1.JSInterface.JSAssign('summaryValues', [UniDBGrid1.JSInterface.JSObject('')]); end; 2. procedure TMainForm.UniDBGrid1ColumnSummaryResult(Column: TUniDBGridColumn; GroupFieldValue: Variant; Attribs: TUniCellAttribs; var Result: string); var I : Integer; F : Real; begin if SameText(Column.FieldName, 'quantity') then begin I:=Column.AuxValue; Result:=Format('Total Units: %d', [I]); Attribs.Font.Style:=[fsBold]; Attribs.Font.Color:=clGreen; //(Column.Grid as TUniDBGrid).JSInterface.JSAssign('summaryValues.quantity', [VarToStr(Column.AuxValue)]); (Column.Grid as TUniDBGrid).JSInterface.JSAssign('summaryValues.quantity', [I]); end else if SameText(Column.FieldName, 'unitprice') then begin F:=Column.AuxValue; Result:='Total Cost: '+FormatCurr('0,0.00 ', F) + FmtSettings.CurrencyString; Attribs.Font.Style:=[fsBold]; Attribs.Font.Color:=clNavy; //(Column.Grid as TUniDBGrid).JSInterface.JSAssign('summaryValues.unitprice', [VarToStr(Column.AuxValue)]); (Column.Grid as TUniDBGrid).JSInterface.JSAssign('summaryValues.unitprice', [F]); end; Column.AuxValue:=NULL; end; 3. On the client side: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.