Home > database >  Value of the column sum for dynamic data window, how to say
Value of the column sum for dynamic data window, how to say

Time:10-03

//the following statement is to create a dynamic data window
//dynamic data window dw_1 create instance
String lserr lsSQLstr, lsDWsyntax, lserrC
//3 of the following statements is the key, if dw_1 built please delete these three statements for the mouse point, otherwise will go wrong,
DataWindow dw_1 u_d_sample//if the user USES the data window object, can be changed to: u_d_sample dw_1
Dw_1=Create DataWindow u_d_sample//if the user USES the data window object, this sentence should be removed,
OpenUserObject (dw_1)

//Select... The As... As the column headings can be displayed As the As the character after, more flexible and convenient,
//can design according to the actual situation to generate a Select statement and the Where clause of the visual interface
LsSQLstr="Select name, product name, unit price, number of packages, amount, date, note the from cp order by name, date of asc"
St_2. Text="Select * from cp sum (amount)"
LsDwsyntax=SQLCA. SyntaxFromSQL (lsSQLstr, "style (type=Grid)", lserr)//construct SyntaxFromSQL () function
If Len (lserr) & gt; 0 Then
//if the tectonic SyntaxFromSQL () function failure, then display an error message and exit the
Messagebox (" error!" , lserr)
Return
End the if
Dw_1. Create (lsDwsyntax lserrC)//Create the dynamic data window dw_1
If Len (lserrC) & gt; 0 Then
//if failed to create dynamic data window dw_1, then display an error message and exit the
Messagebox (" error!" , lserrC)
Return
End the if
//the following set some properties of the dw_1, according to actual needs, set up,
//dw_1. X=5
//dw_1. Y=5
//dw_1. Width=5000
//dw_1. Height=1200
//dw_1. Visible=True
//dw_1 Enabled=True
//dw_1 HScrollBar=True
//dw_1 VScrollBar=True
//for dw_1 distributed transaction object SQLCA
Dw_1. SetTransObject (SQLCA)
//to extract data
Dw_1. Retrieve ()

CodePudding user response:

To use grammar generated

CodePudding user response:

For calculation of DW, generates the syntax, and then the corresponding according to the change.

CodePudding user response:

Why make such a trouble, you can according to your statement condition prior to draw a window, bring you to the amount of the total,

CodePudding user response:

Eldest brother, kind of, I don't PB built-in language I want other kind, what to express

CodePudding user response:

As if it's not that simple, ha ha.
  • Related