C # Processing TextObject in a crystal report

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.