Crystal ActiveX Report Viewer Control 11.0 - put_SelectionFormula doesn't work


  • Hi

    I'm using VC++ 2010 and Crystal Reports 11.0. Earlier I used Crystal Report Control, but Crystal Reports 11.0 doesn't contain it already, so I would like to work with Crystal ActiveX Report Viewer Control 11.0. Everything works fine excepting put_SelectionFormula. Put_SelectionFormula seems to haven't got any effect to the report, all of the records appear on the report.

    My codes:



    _bstr_t sServer(GetApp()->m_config.m_host);
    _bstr_t sDatabase(GetApp()->m_config.m_database);
    _bstr_t sUserID(GetApp()->m_config.m_user);
    _bstr_t sPassword(GetApp()->m_config.m_password);
    _bstr_t sDLLName("p2ssql.dll");

    HRESULT hr;
    hr = m_pApp->LogOnServer(sDLLName, sServer, sDatabase, sUserID, sPassword);

    if (SUCCEEDED(hr))
    m_pReport = m_pApp->OpenReport((_bstr_t)m_sReportPath);
    m_pReport->EnableParameterPrompting = false;
    m_CRViewer.put_SelectionFormula((_bstr_t)m_sReportFilter); // "{keszlet.datum} = 20120131"


    It work's, but the report shows all of the data being in the table.

    I read in connection with VB, that SelectonFormula is set "" by default in VS, that's why it doesn't deal with my filters.

    Has somebody an idea, how could put_SelectionFormula be used?

    Thanks for any idea.


    • Edited by Cavebug Sunday, March 11, 2012 6:11 AM
    • Moved by Jesse Jiang Wednesday, March 28, 2012 7:52 AM (From:Visual C++ General)
    Saturday, March 10, 2012 1:17 PM

All replies

  • Try SAP's Crystal Reports - Legacy SDKs forum.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

    Monday, March 12, 2012 11:30 PM
  • Thanks Sheng!

    I have tried that. I received an Crytal Reports uprgrade to 11.5 and SP6. Using this CR version a have other problems with craxddrt.dll - it seems so -, I get an error message "Invalid pointer Code" 80004003 at logonserver and openreport.


    Tuesday, March 13, 2012 9:45 AM
  • Hello,

    I think your issue should be raised in the Legacy SDKs forum. I believe they will know more information of this issue than us, and I will move this one to off-topic, Please open a new thread in that forum.

    Thanks for your understanding,

    Best regards,

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, March 28, 2012 7:52 AM
  • I tried it with CR8.5 and it works.

    So I remain at CR8.5.

    Thursday, March 29, 2012 11:35 AM