开发者

how to change group header values each time in datareport in vb6.0

开发者 https://www.devze.com 2023-01-30 10:12 出处:网络
i am developing application in vb6.0 here i am using datareport for displaying report i want to assign values for each group heade开发者_JAVA百科r RptLabel at run time without using dataenvironment pl

i am developing application in vb6.0 here i am using datareport for displaying report i want to assign values for each group heade开发者_JAVA百科r RptLabel at run time without using dataenvironment please advise me to achieve this


You need to create a hierarchical recordset for the datareport to use as a datasource.

First off, you need to set the recordset's ActiveConnection property to MsDataShape :

rsDataSource.ActiveConnection = "Provider=MsDataShape;Data Provider=None;"

Here is an example of how you can define the structure of the recordset :

    rsDatasouce.Source = "SHAPE APPEND NEW adInteger As ParentId, " & _
    "New adVarChar(100) As HeaderValue1, " & _
    "New adVarChar(100) As HeaderValue2, " & _
    "((SHAPE APPEND New adInteger As ParentGroupId, " & _
                   "New adInteger As ChildGroupId, " & _
                   "New adVarChar(25) As ChildValue1, " & _ 
                   "New adVarChar(25) As ChildValue2, " & _
                   "((SHAPE APPEND New adInteger As ChildId, " & _
                                  "New adVarChar(8) As SubChildValue1, " & _
                                  "New adVarChar(100) As Description " & _
                     "RELATE ChildGroupId To ChildId) AS ChildDetail) " & _
       "RELATE ParentId To ParentGroupId) AS GroupDetail"

Having done this you need to populate the hierarchical recordset.

0

精彩评论

暂无评论...
验证码 换一张
取 消