Print Page | Close Window

Assertion Fail on OnFilePrintPreview

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=16660
Printed Date: 14 May 2024 at 10:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Assertion Fail on OnFilePrintPreview
Posted By: XavierDev
Subject: Assertion Fail on OnFilePrintPreview
Date Posted: 04 May 2010 at 9:47am
I have build a simple MFC SDI project with View derived from CXTPReportView, and I get an assertion fail everytime the PrintPreview is called:
 
void CXTPReportView::_OnPrint2(CDC* pDC, CPrintInfo* pInfo, CRect rcPrint)
{
if (!m_pPrintOptions || !pDC || !pInfo)
{
ASSERT(FALSE);
return;
}
 
UINT nPage = pInfo->m_nCurPage;
--->     ASSERT(nPage <= (UINT)m_aPageStart.GetSize());  // Where app crashes!! nPage=1 and m_aPageStart.GetSize() = 0
UINT nIndex = m_aPageStart[nPage-1];
 
 
I have bound this simple CView derived from CXTPReportView in the codejock sample ReportSample and it works, the PrintPreview shows up !! What am I missing?
 
Thank in advance.


-------------
VS2008 SP1
XTP 12.0.0



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