.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Display Crystal Report title -- Programmatically in VB.net

Posted By:Narayanan       Posted Date: April 15, 2013    Points: 40    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Today , we will see the Display Crystal Report title -- Programmatically in VB.net

Here is a Code:

Create a Text Object in the Design View.
Call this code in the Crystal report viewer Load event.

   Dim cry As CrystalReport1 = New CrystalReport1()
        Dim txtHeader As CrystalDecisions.CrystalReports.Engine.TextObject = cry.Section1.ReportObjects("txtHeader")
        Dim txtAddress1 As CrystalDecisions.CrystalReports.Engine.TextObject = cry.Section1.ReportObjects("txtAddress1")
        Dim txtAddress2 As CrystalDecisions.CrystalReports.Engine.TextObject = cry.Section1.ReportObjects("txtAddress2")
        Dim txtAddress3 As CrystalDecisions.CrystalReports.Engine.TextObject = cry.Section1.ReportObjects("txtAddress3")
        txtHeader.Text = "IBM"
        txtAddress1.Text = "OMR Road"
        txtAddress2.Text = "Chennai"
        Me.CrystalReportViewer1.ReportSource = cry


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend