Print Page | Close Window

CXTPReportControl can't be shown in a tab dialog?

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=17780
Printed Date: 29 September 2024 at 5:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl can't be shown in a tab dialog?
Posted By: owyo
Subject: CXTPReportControl can't be shown in a tab dialog?
Date Posted: 13 January 2011 at 5:18am
Thers is CTabCtrl m_tabMain in my main dialog and another dialog member
CDialogPrinter m_dlgPrinter.
I init m_tabMain as follows:
CSize s(20, 40);
 m_tabMain.SetItemSize(s);
 m_tabMain.InsertItem(0, _T("111"));
 m_tabMain.InsertItem(1, _T("222"));
m_dlgPrinter.Create(IDD_DIALOG_PRINTER, GetDlgItem(IDC_TAB_MAIN));
 
 CRect rs;
 m_tabMain.GetClientRect(&rs);
 rs.top += TAB_SIZE_HEIGHT;
 rs.bottom -= 2;
 rs.left += 1;
 rs.right -= 2;
 m_dlgPrinter.MoveWindow(&rs);
 m_dlgPrinter.ShowWindow(TRUE);
 m_tabMain.SetCurSel(0);
 
And then I add CXTPReportControl m_rcReportPrinters to the class CDialogPrinter with init m_rcReportPrinters as follows:
m_rcReportPrinters.SetGridStyle(TRUE, xtpGridSolid);
 m_rcReportPrinters.GetReportHeader()->AllowColumnRemove(FALSE);
 m_rcReportPrinters.GetReportHeader()->SetAutoColumnSizing(TRUE);
 m_rcReportPrinters.GetReportHeader()->AllowColumnSort(FALSE);
 m_rcReportPrinters.GetReportHeader()->AllowColumnReorder(FALSE);
 m_rcReportPrinters.GetPaintManager()->SetColumnStyle(xtpColumnFlat);
 //
 //  Add sample columns
 //
 m_rcReportPrinters.AddColumn(new CXTPReportColumn(0, _T("Column 1"), 50));
 m_rcReportPrinters.AddColumn(new CXTPReportColumn(1, _T("Column 2"), 50));
 m_rcReportPrinters.AddColumn(new CXTPReportColumn(2, _T("Column 3"), 50));
 CString str;
 for (int i = 0; i < 1000; i++)
 {
  CXTPReportRecord* pRecord = m_rcReportPrinters.AddRecord(new CXTPReportRecord());
  pRecord->AddItem(new CXTPReportRecordItemNumber(i, _T("Item %2.0f")));
  str.Format(_T("Item %i"), i);
  pRecord->AddItem(new CXTPReportRecordItemText(str));
  str.Format(_T("Item %.4i"), i);
  pRecord->AddItem(new CXTPReportRecordItemText(str));
 }
 m_rcReportPrinters.GetPaintManager()->SetColumnStyle(xtpReportColumnFlat);
 m_rcReportPrinters.Populate();
 
But the m_rcReportPrinters always can't be shown.
I want to know how should I do if I want use a CXTPReportControl  in a tab control dialog.
Thanks.
 



Replies:
Posted By: owyo
Date Posted: 13 January 2011 at 8:01pm
Hug



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