void CXTPReportColumns::Add(CXTPReportColumn* pColumn)
{
	pColumn->m_pColumns = this;
	m_arrColumns.Add(pColumn);

	GetReportHeader()->OnColumnsChanged(xtpReportColumnOrderChanged | xtpReportColumnAdded, pColumn);
}
Example #2
0
CSimpleReport::CSimpleReport()
{ 
	FocusSubItems(TRUE);
	AllowEdit(TRUE);
	EditOnClick(FALSE);
	SetMultipleSelection(FALSE);

//	GetPaintManager()->SetGridStyle(TRUE, xtpReportGridLargeDots);
//	GetPaintManager()->SetGridColor(RGB(200,200,200));

	GetPaintManager()->SetGridStyle(FALSE, xtpReportGridSolid);
	GetPaintManager()->SetGridColor(RGB(220,220,220));
	GetPaintManager()->SetGridStyle(TRUE, xtpReportGridSolid);
	GetPaintManager()->SetGridColor(RGB(220,220,220));

#if _XTPLIB_VERSION_PREFIX == 1020
	GetPaintManager()->m_columnStyle = xtpReportColumnOffice2003;
#else // if _XTPLIB_VERSION_PREFIX == 1200
	GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);
#endif
	GetPaintManager()->m_bDrawSortTriangleAlways = TRUE;
	GetPaintManager()->m_bHotTracking = TRUE;
	GetPaintManager()->m_clrHighlight = RGB(170, 200, 255);
	GetPaintManager()->m_clrHighlightText = RGB(0, 0, 0);
//	GetPaintManager()->m_clrSelectedRow = RGB(200, 230, 230);
//	GetPaintManager()->m_clrSelectedRowText = RGB(0, 0, 0);

	GetReportHeader()->AllowColumnRemove(FALSE);
	GetReportHeader()->AllowColumnSort(TRUE);
	GetReportHeader()->AllowColumnResize(TRUE);
	GetReportHeader()->AllowColumnReorder(TRUE);

	SetFontText("Arial", 14);
	SetFontHeader("Arial", 14);
//	SetColorBack(RGB(240, 255, 255));
//	SetColorHightLight(RGB(0, 0, 0), RGB(255, 255, 0));

	callback_add = NULL;
	callback_del = NULL;
	callback_copy = NULL;
	callback_newrec = NULL;
	m_bAdd = false;
}
void CXTPReportColumns::Remove(CXTPReportColumn* pColumn)
{
	m_pGroupsOrder->Remove(pColumn);
	m_pSortOrder->Remove(pColumn);

	int nIndex = IndexOf(pColumn);
	if (nIndex != -1)
	{
		m_arrColumns.RemoveAt(nIndex);
		pColumn->InternalRelease();

		GetReportHeader()->OnColumnsChanged(xtpReportColumnOrderChanged | xtpReportColumnRemoved, pColumn);
	}
}