Results 1 to 7 of 7

Thread: [RESOLVED] Can I change crystal report titles with asp.net?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2012
    Posts
    9

    Resolved [RESOLVED] Can I change crystal report titles with asp.net?

    Hey guys,

    Okay I am generating reports from a Questions table and an Answers table. By default the reports that generate - their headings say "Question" and "Answer" which is the tables COLUMN names. I don't want that. Is there a way to programmatically change these titles and headings within of Crystal Report at run-time. Like for instance changing the X and Y titles of a chart. I want to set it to the title of the question which is the data inside the row and not the columns name which just says "question" and "answer" literally.

    I have searched and cant find anything.

    EDIT: I want to change the captions of what I circled with program code before I display the reports on the screen NOT with IDE editor thingy.

    I want to do this(Please note I need to do it programmatic and not within the IDE by right clicking or edit the report there):

    Change the text/titles/captions of the text that i circled in the picture




    And perhaps the rest of the textfields on the report.
    Last edited by skyzaa; Jul 28th, 2012 at 12:51 PM.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Can I change crystal report titles with asp.net?

    Hello,

    Would it be possible for you to show us the code that you are currently using, so that we can try to start helping you out.

    Gary

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2012
    Posts
    9

    Re: Can I change crystal report titles with asp.net?

    I want to do this(Please note I need to do it programmatic and not within the IDE by right clicking or edit the report there):

    Change the text/titles of the text that i circled in the picture




    And perhaps the rest of the textfields on the report.
    Last edited by skyzaa; Jul 28th, 2012 at 10:32 AM.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2012
    Posts
    9

    Re: Can I change crystal report titles with asp.net?

    I found this: http://devlibrary.businessobjects.co...tModel268.html

    It looks like what I want to do but I cant get that code to work.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2012
    Posts
    9

    Re: Can I change crystal report titles with asp.net?

    WORK-AROUND SOLUTION FOR PEOPLE WHO FIND THIS THREAD:

    After spending a ten thousand billion hours trying to change the graph titles I just did this and it works in the end..

    1. Create your Report
    2. In the report editor in your IDE right click on your graph and set the titles to all blank or just a "." if it doesn't want to go blank, mine took very long to actually go blank(I dont know why)
    3. Drag and drop a "Text Object" onto the report and place it where the Titles of the graph previously were
    4. Use the following code to change the text:

    Note: "Text5" was the name of the Text Object that I created, yours should be different.
    Code:
    Imports CrystalDecisions.CrystalReports.Engine
    
    Partial Class _Default
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            '  MsgBox(CrystalReportSource1.ReportDocument.ReportDefinition.ReportObjects.Item("Text5").GetType().ToString)
    
            Dim textArea As TextObject
    
            textArea = CType(CrystalReportSource1.ReportDocument.ReportDefinition.ReportObjects.Item("Text5"), TextObject)
    
            textArea.Text = "PLACE YOUR CUSTOM TITLES HERE"
    
            CrystalReportSource1.ReportDocument.Refresh()
    
    
        End Sub
    
    End Class
    5. Run everything and VOILA!

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Can I change crystal report titles with asp.net?

    Hello,

    Glad to hear that you got this working!

    Can you please remember to mark your thread as resolved?

    Also, I don't seem to be able to see the image that you posted in this thread. It could be a firewall issue for me, but just wanted to check in case it is something that everyone is seeing.

    Gary

  7. #7
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: Can I change crystal report titles with asp.net?

    You could also remove that entiry field from the report, create a parameter "ReportTitle" and put the value from the parameter in a textbox, at the place you now have that field.
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width