I am using Crystal Reports in the .NET 2005 environment. Let's say I want to create a simple one page report (like a memo) and I want one field on the report (this is not exactly what I need to do but this example addresses the concept I am looking for). Let's say I have no database and my data is in a string variable. how the heck can I dynamically set the value of the field on the report to that variable without implementing some crazy pseudo-binding strategy?
To me, it seems as though this is the most basic report possible and yet from all of my reading and searching it seems that this cannot be done with some simple syntax such as:
ReportSource.ReportObjects("Field1").Text = stringVariable;
Did Crystal leave that most basic and fundamental property out of their data model for a reason?
Should I look at alternative reporting products that are less database centric?
I used to use DataDynamics ActiveReports and it worked just like that above, however I would prefer to use Crystal as it is more industry standard.
Any help would be appeciated. Thanks.
-KevinI always love it when people answer their own questions! Well here is the answer to mine. I found it indirectly on another thread! Go dev-archive!
JournalMemo journal = new JournalMemo();
journal.DataDefinition.FormulaFields["UnboundString1"].Text = "\"It Worked\"";
That is easy enough although it would have been more intuitive if I could have done that from the ReportObjects collection.
JournalMemo is a Crystal Report that I created with the designer in the IDE. The actual JournalMemo.cs class is created by Crystal Reports when creating an embedded report in the designer and it inherits the ReportClass class.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment