Report displays empty rows |
Post Reply |
Author | |
AlexCTF
Newbie Joined: 03 December 2008 Status: Offline Points: 4 |
Post Options
Thanks(0)
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.
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You don't need to use SDI or MDI - check Dialog-based Report sample - e.g. ReportAddRecordEx or ReportDataBinding
|
|
AlexCTF
Newbie Joined: 03 December 2008 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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.
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Sorry - I can only follow most recent code - 13.1 with current updates
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |