Get Datawindowchild SQL and DataObject in PB DataWindow

Source: Internet
Author: User

In the implementation of a function, want to get a data window in the Datawindowchild inside SQL, and then put SQL into a datastore to retrieve, the original idea is this

Adw_main.getchild ("xxxx"= ldwc_temp.dataobjectls_sql = Lds_temp.getsqlselect ()

Find Datawindowchild There is no dataobject this attribute

Through Baidu only know can directly through the Datawindowchild Getsqlselect () method to get SQL

SQL is available, and that's the question, how do I get the name of the datawindowchild associated DataWindow?

See the data window of the source to know, this datawindow placed in the Dddw.name property below

<DW Control Name>. Describe ("<COLUMNNAME> Dddw. Name ")<dw Control name>. Modify ("<COLUMNNAME> Dddw. Name=<name of DataWindow used as dddw> ")

This will do it:)

Integer rtncodestring ls_nowfld,ls_deptid,ls_sqldatawindowchild fld_childrtncode= Dw_1.getchild ("unit_id", Fld_child)//get the handle to the UNIT_ID field name pull Data windowIf Rtncode=-1 Then MessageBox ("Error!", "Not dropdown data Window!")) Fld_child. Settransobject (SQLCA)//set Transaction ObjectLs_sql= Lower (fld_child. Getsqlselect ())//get the SQL statement for DDDW//remove the WHERE conditional clause in the SQL statement, such as a WHERE condition clause in the original SQL statement, where you need to perform a more//complex processing should be subject to specific circumstances. ifPos (Ls_sql, "where") >0 then Ls_sql = Left (Ls_sql,pos (Ls_sql, "where"))//to reset a WHERE Condition clause in an SQL statementLs_deptid=dw_1.object.dept_id[getrow ()]//gets the current dept_id selected valueLs_sql= Ls_sql + "Where dept_id = '" +trim (ls_deptid) + "'"//To reset the SQL statementFld_child. Setsqlselect (Ls_sql) fld_child. Retrieve ()//get the data that meets the criteria

Get Datawindowchild SQL and DataObject in PB DataWindow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.