Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing textfield's text of crystal report thru vb.net

Status
Not open for further replies.

arunglobal

Programmer
Sep 8, 2003
40
IN

How can i change the Textobjects text of crystal report thru vb.net

objsfa_act_rpt_SQL.SetDataSource(m_datset)
objsfa_act_rpt_SQL.Section2.ReportObjects.Item(0)----> iam having text objec names TEXT2 in section2--> how can i changethe text of that here.....
CrystalReportViewer1.ReportSource = objsfa_act_rpt_SQL

CrystalReportViewer1.Refresh()
CrystalReportViewer1.Show()
 
I have a report that contains an ITextObject called TextReportTitle in the Report Header to hold the name of the report. I set this in code using c# but should be fairly similar in VB.Net. Heres the code I used:

ReportDocument report = new ProgramReport();

TextObject textObject = report.ReportDefinition.ReportObjects[ "TextReportTitle" ] as TextObject;
textObject.Text = "Report Title Goes Here";
 
Thank u matty.

To use text objects which namaspace i shoud import?....
 
Yes. I got it...

we can change the value of textobjecs dynamically by this way..

Imports CrystalDecisions.CrystalReports.Engine

Dim textObject1 As TextObject = objsfa_act_rpt_ORA.ReportDefinition.ReportObjects("Text5")
textObject1.Text = "User defined Text"

Text5 is the Textobject in the report.
objsfa_act_rpt is my report object.

gswetha we can change...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top