Hi Johnson,
Correct, but mostly it works without having to set the viewer to the RAS Report Object but just in case you do then I use a flag id RAS has modified the report and set the viewer accordingly:
You still need to open the report by the Engine but then assign it to the RAS client Doc:
add these assemblies:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportAppServer;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.ReportDefModel;
using CrystalDecisions.ReportAppServer.CommonControls;
using CrystalDecisions.ReportAppServer.CommLayer;
using CrystalDecisions.ReportAppServer.CommonObjectModel;
using CrystalDecisions.ReportAppServer.ObjectFactory;
using CrystalDecisions.ReportAppServer.Prompting;
using CrystalDecisions.ReportAppServer.DataSetConversion;
using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.ReportSource;
Global flag:
bool IsRpt = true;
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
In the routine to you update the values add IsRpt = false;
In your open method use this:
rptClientDoc = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument();
rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
rptClientDoc = rpt.ReportClientDocument;
Then in the view report button use this:
try
{
if (!IsRpt)
{
crystalReportViewer1.ReportSource = rptClientDoc.ReportSource;
}
else
{
crystalReportViewer1.ReportSource = rpt;
}
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
}
Don