Using System;
Using System. Data;
Using System. Configuration;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web. UI. WebControls. WebParts;
Using System. Web. UI. HtmlControls;
Using CrystalDecisions. CrystalReports. Engine;
Using CrystalDecisions. ReportAppServer. ClientDoc;
Using CrystalDecisions. ReportAppServer. DataDefModel;
Public partial class _ Default: System. Web. UI. Page
{
Protected ReportDocument boReportDocument;
Protected void Page_Load (object sender, EventArgs e)
{
If (! This. IsPostBack)
{
ConfigureCrystalReports ();
}
CrystalReportViewer1.ReportSource = Session ["Report"];
}
Protected void ConfigureCrystalReports ()
{
ISCDReportClientDocument boReportClientDocument;
CrystalDecisions. ReportAppServer. Controllers. ReportObjectController boReportObjectController;
CrystalDecisions. ReportAppServer. ReportDefModel. TextObject boOldTextObject, boNewTextObject;
CrystalDecisions. ReportAppServer. ReportDefModel. Paragraph boParagraph;
CrystalDecisions. ReportAppServer. ReportDefModel. ParagraphFieldElement boParagraphFieldElement;
CrystalDecisions. ReportAppServer. ReportDefModel. ParagraphTextElement boParagraphTextElement;
BoReportDocument = new ReportDocument ();
BoReportDocument. Load (Server. MapPath ("CrystalReport. rpt "));
BoReportClientDocument = boReportDocument. ReportClientDocument;
BoReportObjectController = boReportClientDocument. ReportDefController. ReportObjectController;
// Get a handle on the ReportObjectController so we can manipulate the TextObject
Foreach (CrystalDecisions. ReportAppServer. ReportDefModel. ReportObject boReportObject in boReportObjectController. GetAllReportObjects ())
{
If (boReportObject. Kind = CrystalDecisions. ReportAppServer. ReportDefModel. CrReportObjectKindEnum. crReportObjectKindText)
{
BoOldTextObject = (CrystalDecisions. ReportAppServer. ReportDefModel. TextObject) boReportObject;
BoNewTextObject = (CrystalDecisions. ReportAppServer. ReportDefModel. TextObject) boOldTextObject. Clone (true );
// Clear out all paragraphs from the current text object
& Nbs