[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
http://img3.imageshack.us/img3/60/reportse.jpg
And perhaps the rest of the textfields on the report.
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
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
http://www.vbforums.com/
And perhaps the rest of the textfields on the report.
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.
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!
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
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.