Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Report displays empty rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report displays empty rows

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


Joined: 03 December 2008
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCTF Quote  Post ReplyReply Direct Link To This Post Topic: Report displays empty rows
    Posted: 06 July 2009 at 6:36am
uploads/20090706_063301_ReportQuestion.rar
 
Hello, we have a problem with the simple implementation of a Report Control inside a View. With simple implementation I mean the use of text columns, not the complex record types used inside Codejock´s examples (CMessageRecord).
 
We need to insert a ReportControl inside a view. As another controls must be inserted in it, the CXTPRecordView is not a solution for us. We start using the ReportControl as a member variable of our view (the simple standard view of a SDI application). Inside OnCreate function we create the window for the control and after, we create one simple column and just one single record with a CXTPReportRecordItemText in it (just to test). After we call Populate function inside OnInitialUpdate. All this seems simple enough to work fine but, unfortunately, we don´t get a correct behaviour. The control is created, the column is created too with its caption, even a record is created (as a white marked rectangle is shown), but there is no text for the record. It seems to be empty.
We took a look inside Codejock´s examples. First of all, except for the VirtualList one, they all use complex types of records that only make everything more obscure. We decided to change VirtualList example. We set it with just one column and commented the line where the virtual mode is created. Instead, we use the same lines of code we implemented before in our project and... it worked.
I don´t know the reason why with apparently the same lines of active code the behaviour is different. If someone wants to help us, you´ll find on the top of this page a link to a jpg image showing these elements. If we don´t find a solution for this question we should consider the use of another control different from those of Codejock.
 
Thanks in advance.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2009 at 10:09pm
You don't need to use SDI or MDI - check Dialog-based Report sample - e.g. ReportAddRecordEx or ReportDataBinding
Back to Top
AlexCTF View Drop Down
Newbie
Newbie


Joined: 03 December 2008
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote AlexCTF Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2009 at 4:02am
Thanks for your answer.
 
I cannot get rid of the Record Control inside a view, in fact inside a FormView. The using of a SDI was just to test, but the final application I want to implement it in is a MDI one and I can´t change that. Of course I checked out the Dialog-based Report sample but again it doesn´t work. I attach this Dialog-based example with a modification inside. This modification consists of a new Record Control embedded in the same dialog; a new custom control added of XTPRecord class, the same window styles. One new variable added for it (m_myrecord). You´ll see inside OnInitDialog (line 238) the new code added for this new report. One column, one recordEx with one text item. It doesn´t work, again correct control creation, column creation, column display but no text for the new item!
 
I´ve attached the Debug executable. It is linked with Codejock version 11.2.2. and compiled with Visual Studio 2003 v 7.1.
 
Thanks a lot.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2009 at 8:00pm
Sorry - I can only follow most recent code - 13.1 with current updates
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 13 July 2009 at 11:29pm
Funny bug: you create column with index 1 and add item with index 0:
//Creation of one column 
//m_myReport.AddColumn(new CXTPReportColumn(1, "COLUMN 1", 100)); - SHOULD START FROM 0 - VB Background?!
m_myReport.AddColumn(new CXTPReportColumn(0, "COLUMN 1", 100));
//Add one record

m_myReport.AddRecordEx(new CXTPReportRecord());

//Add one text item to the record

CXTPReportRecords* p_record_collection = m_myReport.GetRecords();

CXTPReportRecord* p_record = p_record_collection->GetAt(0);

p_record->AddItem(new CXTPReportRecordItemText("THIS TEXT SHOULD BE SHOWN ON FIRST COLUMN"));

//Populate the record

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.188 seconds.