how to set the value of a ITextObject....

Last post 11-06-2009 10:30 AM by debugmm. 2 replies.

Sort Posts:

  • how to set the value of a ITextObject....

    08-22-2003, 11:05 AM
    • Member
      40 point Member
    • Yu_Matrix
    • Member since 06-15-2003, 12:23 PM
    • Posts 8
    I put a ITextObject on the report templete, I want to change its value dynamicly, but i don't know how to set the value, can anyone tell me how to set the value or give me a better idea, thx!
  • Re: how to set the value of a ITextObject....

    09-15-2003, 2:46 PM
    • Member
      255 point Member
    • renjitk
    • Member since 01-07-2003, 2:18 PM
    • Posts 54
    its something similar to this..

    Dim oRpt As New crPO()
    Dim crReportObject As ReportObject
    Dim crTextObject As TextObject
    For Each crReportObject In oRpt.Section1.ReportObjects

    If crReportObject.Kind = ReportObjectKind.TextObject Then
    crTextObject = CType(ReportObject, TextObject)
    crTextObject.Text = "dfd"
    End If

    Next

    but i am still trying to figure it out.
  • Re: how to set the value of a ITextObject....

    11-06-2009, 10:30 AM
    • Member
      4 point Member
    • debugmm
    • Member since 10-23-2009, 8:23 PM
    • Posts 2

    Here is the c# version: -

    To change the value of ITextObject of Crystal Report (Visual Studio 2008) at run time you have to: -

    1. Create a object of ITextObject
    2. Assign the source object with typecast to new object
    3. Now use the new object and set all the properties (like Text, Font etc…)
    CrystalDecisions.CrystalReports.Engine.TextObject txtReportHeader;
    txtReportHeader = MyReport.ReportDefinition.ReportObjects["txtHeader"] as TextObject;
    txtReportHeader.Text = "All Vouchers Print - Prabhat";

    http://prabhat.me/2009/11/06/change-the-value-of-itextobject-of-crystal-report-at-runtime/

    Filed under:
Page 1 of 1 (3 items)