Crystal ActiveX Report Viewer Control – put_SelectionFormula Doesn’t Work
SAP Consultant needs help regarding “Crystal ActiveX Report Viewer Control – 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:
try
{
m_pApp.CreateInstance(“CrystalRuntime.Application.11″);
_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_CRViewer.put_ReportSource(m_pReport);
m_pReport->EnableParameterPrompting = false;
m_pReport->DiscardSavedData();
m_CRViewer.put_SelectionFormula((_bstr_t)m_sReportFilter); // “{keszlet.datum} = 20120131″
m_CRViewer.ViewReport();
}
}
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?
Consultant, needs help regarding Crystal ActiveX Report Viewer Control – put_SelectionFormula doesn’t work Help!
Related search terms:
Browse more questions like this in module: BI
