cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using the "go to page" functionality in the Crystal Report Viewer

0 Kudos

Hi all

I have a problem when I try to use the "go to page" functionality in the Crystal Report Viewer.

My application has been developed with VS2010 using c++/cli and I have a very simple CDialog that contains the report viewer.

CTestCRViewer2010Dlg::CTestCRViewer2010Dlg(CWnd* pParent /*=NULL*/)

    : CDialog(CTestCRViewer2010Dlg::IDD, pParent)

{

}

void CTestCRViewer2010Dlg::DoDataExchange(CDataExchange* pDX)

{

    CDialog::DoDataExchange(pDX);

    DDX_ManagedControl(pDX, IDC_REPORTVIEWER, m_reportViewer);

}

BEGIN_MESSAGE_MAP(CTestCRViewer2010Dlg, CDialog)

    //}}AFX_MSG_MAP

END_MESSAGE_MAP()

    

BOOL CTestCRViewer2010Dlg::OnInitDialog()

{

    CDialog::OnInitDialog();

    ReportDocument  ^reportDocument ;   

    reportDocument = gcnew ReportDocument();

    reportDocument->Load("C:\\Lantek\\Expert\\Reports\\PUNLISTA.rpt");

    m_reportViewer->ReportSource = reportDocument;    

    return TRUE;

}

Everything seems to work properly except from the "go to page" functionality: when I change the page number in the text box and I press the enter key to go to that page, nothing happens.

I have tried to solve the problem handling the key press event from the CDialog, but I do not know how to force the viewer to handle the event or how to get the page number from the text box and use the ShowNthPage function of the viewer.

Is it possible to use one of these solutions or is there a better way to solve the problem?

I am using Crystal Reports for Visual Studio 2010 with SP6.

Thank you very much in advance.

Best regards,

Aitor

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

In my Viewer App (Visual Studio 2010 with SP6, VB.NET) the go to page functionality works fine without needing to write any special code.  So I suspect something in your app is interfering with the normal windows message flow within the viewer control.

hth,

- Ido

0 Kudos

Thanks for your reply Ido, and sorry for the late response but I have been on holidays until today.

Yes, it works fine if you use VB.NET but unfortunately my application needs to be written in C++.

Anyway, I do not think that the problem is related to my application because it is as simple as the code above: a CDialog that just loads a report and it shows it...

Does anybody have the same problem? Is there a good solution for it?

Best regards,

Aitor

Answers (0)