Print Page | Close Window

Report Control Footer Text Multiline

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=22967
Printed Date: 23 November 2024 at 9:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control Footer Text Multiline
Posted By: carlitm
Subject: Report Control Footer Text Multiline
Date Posted: 17 March 2016 at 9:59am
Hi
Please enlighten me as to how I can specify LFCR in the footer text to make it multiline.

TIA

Carl



Replies:
Posted By: olebed
Date Posted: 20 March 2016 at 3:52am
Hello,

Firstly you should turn on multiline
void CReportSampleView::OnReportcontrolMultilinesample()
{
     m_bMultilineSample = !m_bMultilineSample;

     int nCount = GetReportCtrl().GetColumns()->GetCount();
     for( int i = 0; i < nCount; i++) 
     {
          CXTPReportColumn* pColumn = GetReportCtrl().GetColumns()->GetAt(i);
          if (pColumn) 
          {
              int nAlign = pColumn->GetAlignment();
              nAlign = m_bMultilineSample ? (nAlign | DT_WORDBREAK) : (nAlign & (~DT_WORDBREAK));
              pColumn->SetAlignment(nAlign);
          }
     }
     GetReportCtrl().GetPaintManager()->SetFixedRowHeight(!m_bMultilineSample);
     GetReportCtrl().GetPaintManager()->m_bUseColumnTextAlignment = TRUE;

     GetReportCtrl().AdjustScrollBars();
}


then add  ES_WANTRETURN  to editOptions
   for (nColumn = 0; nColumn < nFreezeCount+nColumnCount; nColumn++)
     {
        CXTPReportColumn *pColumn = wndReport.GetColumns()->GetAt(nColumn);

        pColumn->SetAlignment(xtpColumnTextWordBreak | xtpColumnTextVCenter);
        pColumn->GetEditOptions()->m_dwEditStyle |= ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN;
     }

[Enter] and [Shift]+[Enter] now gives only carriage return. For saving changes in cell and exit from edit mode - use [Tab] key or [Ctrl]+[Enter]. [Esc] key cancels all changes. 

Regards,
 Oleksandr Lebed



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