Print Page | Close Window

Report Control in dialog layout problems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=7017
Printed Date: 22 November 2024 at 8:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control in dialog layout problems
Posted By: adrien
Subject: Report Control in dialog layout problems
Date Posted: 30 April 2007 at 7:27pm
Hi
 
I'm having problems with the report control layout using it in a dialog.  I'm using it as a replacement for a CListCtrl, so that I can set font / styles / colours etc per cell.
 
If you set SetAutoColumnSizing(FALSE), so that resizing columns kinda behaves itself (i.e. only resizes the column you are resizing), then if you make the headers wider than the window (I'm using the control inside a dialog, so it's restricted in size) it displays a scrollbar. 
 
The scrollbar doesn't respond to any mouse events, so you can't actually scroll to see the final columns, which makes for an unpleasant user experience.
 
Also if the total columns doesn't add up to the width of the control, then the final gap is exactly that - a gap: no gridlines.  It's a bit ugly.
 
So is there a workaround for this?  Do I have to add an empty column at the end or something?  And what about scrolling?
 
Thanks
 
Adrien



Replies:
Posted By: adrien
Date Posted: 06 May 2007 at 5:43pm
PS, this is 11.1.0


Posted By: sserge
Date Posted: 16 May 2007 at 4:50pm
Hi,

1) Scrolling at least is working in a regular sample applications; I'm not sure which methods you call and in which sequence to make it non-working; need more information, an attached piece of code for example.

2) You can leave AutoColumnSizing enabled, but disable resizing for each particular column except the last one for example. In this case only the last column will be resized with the control itself.

--
WBR,
Serge


Posted By: adrien
Date Posted: 17 May 2007 at 10:11pm
Hi
 
thanks for your reply.  I'm having problem with vertical scroll as well.  Basically the scroll-bars don't seem to get messages.  If I click in the control and use the mouse-wheel it scrolls, but the scroll-bar itself ignores mouse events.
 
My code is like this
 
in the DIALOG RC file, I have created a frame items.  it has styles WS_NOTIFY, WS_VISIBLE, and WS_EXCLIENTEDGE
 
then in the dialog class, I use
 
DDX_Control(pDX, IDC_REPORTCONTROL,  m_Schema);
 
This then creates the control with the styles that the control in the dialog resource has.  To draw I use
 
 CXTPReportColumn* pFirstCol = new CXTPReportColumn(0, "Symbol", 180, FALSE);
 m_Schema.BeginUpdate();
 
 m_Schema.AddColumn(pFirstCol);
 m_Schema.AddColumn(new CXTPReportColumn(1, "Type", 70, FALSE));
 m_Schema.AddColumn(new CXTPReportColumn(2, "Access", 70, TRUE));
 pFirstCol->SetTreeColumn(TRUE);
 m_Schema.AddRecord(...);
 m_Schema.AddRecord(...);
etc
 
 m_Schema.Populate();
 m_Schema.GetSelectedRows()->Clear();
 m_Schema.EndUpdate();
 m_Schema.RedrawControl();
 
 
I suspect if I explicitly call Create on the control it may get the scroll-messages but I haven't tried that one yet.
 
couple of things I don't like.
 
1. Have to call Clear() on GetSelectedRows, else the control selects row 1 by default, which paints it grey.  by default nothing should be selected until a user explicitly selects it.
 
2. Clicking outside a row in the control doesn't reset the selected rows either.  It would be nice if it did, otherwise I have to add a notify handler to do this.
 
3. The tree control mode doesn't use standard tree control layout.  specifically an expand/contract glyph has an "elbow" line coming into it from the side rather than a straight one down from the top the top (as in a tree control), and the line style is not settable (i.e. can't do dotted lines like a real tree control).
 
Adrien
 


Posted By: adrien
Date Posted: 17 May 2007 at 10:34pm
As I thought, if I use a call to Create to create the report control, the scrollbars work.
 
Down-side is I'm having trouble setting extended styles on the control now for its border.  I'm calling Invalidate() to get it to redraw, but it wont.
 
not until I expand a tree item in the report - then it displays the border on the control.  It's driving me nuts.
 
Also, I tried setting autosize off on some columns, but now I can't manually resize them either?  what's with that?  Surely turning off auto-resizing should do that, and that alone - not disable sizing altogether.


Posted By: adrien
Date Posted: 17 May 2007 at 10:51pm
OK, got it drawing the extended styles at the start.  I had to call CreateEx to do it though, which requires a WndClass.  I couldn't find a way to get the WndClass of the report control, so I just used AfxRegisterWndClass(0), which seems to work.
 
Need to add a CreateEx call to the report control.


Posted By: sserge
Date Posted: 02 June 2007 at 7:55am
Hi,

The Report Wnd class is defined in XTPREPORTCTRL_CLASSNAME. See implementations of: CXTPReportControl::RegisterWindowClass,  CXTPReportControl::Create
 
See also our ReportDialog sample.


About columns --  see methods:
    CXTPReportColumn::IsAutoSize, bAutoSize parameter in the constructor
    CXTPReportColumn::IsResizable, EnableResize

--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net