Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - dropdownlist having multiple columns
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

dropdownlist having multiple columns

 Post Reply Post Reply
Author
Message
rolf View Drop Down
Newbie
Newbie


Joined: 06 November 2006
Location: Germany
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote rolf Quote  Post ReplyReply Direct Link To This Post Topic: dropdownlist having multiple columns
    Posted: 06 February 2007 at 2:58am

i want to create something like i've been using in MS Access (former times):

 
There is a report control item named "Artikel", which should contain a legal articlenumber (e.g. 3141203).
 
The dropdownlist contains two cols :
1. the available articlenumbers
2. the articletext
 
When i select an item out of the dopdownlist (e.g. "3141203 Formteile 1203"), the articlenumber "3141203" is the value that has to occurs in the report control item.
 
In MS Access it's pretty easy : just create a dropdownlist that contains the two fields and tell Access that it should use column 1 (the number) as the result out of a dropdown selection.
 
This is a pretty user friendly form of selecting a sensfull number ...
... but i have no idea how to do that in a report control !?
 
The values added by AddConstraint(...) are not formatable to show two cols. And the return value of the selection process is number + text.
 
Anyone with any idea how to realize this nice feature ?
Thank's for any hints !
 
Rolf
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2007 at 3:02am
See method CXTPReportRecordItemEditOptions::AddConstraint(LPCTSTR lpszConstraint, DWORD_PTR dwData)
You can use lpszConstraint - as a part title and dwData as a part number.
 
Just format part title in some nice way (preserve for part number 10 chars for example).
 
If your part number is a string - you can use OnConstraintChanged to parse title and save part.

--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.