Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Refresh() not working in the CCrystalReportViewer11.

Dear All,

I am using CR X1 RDC report viewer. When I click on the Refresh button in the report viewer, the crystal report getting updated with the latest data base values. I have tried to refresh the crystal report through code by using the Refresh() function in the m_Viewer. But it is not working. The code snippet i have given below for your reference.

CCrystalReportViewer11 m_Viewer;

IApplicationPtr m_Application;

IReportPtr m_ReportType;

m_ReportType = m_Application->OpenReport(FilePath);

GroupName = (_bstr_t)csGroupName;

m_ReportType->FormulaFields->GetItemByName("GroupName")->Text = GroupName;

/* To hide the Preview section */

m_Viewer.SetEnableGroupTree(0);

/* To hide the Border */

m_Viewer.SetDisplayBorder(0);

/* To hide the Preview Tab*/

m_Viewer.SetDisplayTabs(0);

m_Viewer.SetReportSource(m_ReportType);

m_Viewer.Refresh();

m_Viewer.ViewReport();

m_Viewer.Refresh();

Please suggest me to make it work.

Regards,

Rahaneef T

Former Member
Not what you were looking for? View more on this topic or Ask a question