Crystal Reports single field
-
Hey all. I am new to Crystal Reports and was wondering of someone could give me a hand involving adding single data fields to a report. What I mean by this is, I have a DataSet that contains all the fields I want per row, however, I also want a generic field that does not pertain to the row. For example, I have a DataSet whose Table name is "Person" and contains the entities, Name, Age, Sex, etc... What I want to add to the report, aside from the rows containing Name, Age, and Sex, is a data field at the top that is user-defined. Perhaps I want to put "Goo goo ga ga" at the top of the report. Instead of having to add an entity to the DataSet, can I define a field in the report, place the field on the report somewhere, and edit it via my code? I hope you understand what I mean. Thanks! -Josh
-
Hey all. I am new to Crystal Reports and was wondering of someone could give me a hand involving adding single data fields to a report. What I mean by this is, I have a DataSet that contains all the fields I want per row, however, I also want a generic field that does not pertain to the row. For example, I have a DataSet whose Table name is "Person" and contains the entities, Name, Age, Sex, etc... What I want to add to the report, aside from the rows containing Name, Age, and Sex, is a data field at the top that is user-defined. Perhaps I want to put "Goo goo ga ga" at the top of the report. Instead of having to add an entity to the DataSet, can I define a field in the report, place the field on the report somewhere, and edit it via my code? I hope you understand what I mean. Thanks! -Josh
Figured out how to do this incase anyone is interested. 1) Add a Text object to your report by right-clicking on the report and selecting Insert->Text Object 2) Set the Name of the object in the Properties window 3) Note the Page Header Section the object resides in 4) CrystalDecisions.CrystalReports.Engine.TextObject myObject = (CrystalDecisions.CrystalReports.Engine.TextObject)theReportClassInstance.theSectionNumber.ReportObjects[ "theObjectName" ]; myObject.Text ="whatever i want"; cheers