Print Page | Close Window

Adding Dynamic fields

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1193
Printed Date: 28 Apr 2024 at 5:30am


Topic: Adding Dynamic fields
Posted By: netcrguy
Subject: Adding Dynamic fields
Date Posted: 17 Aug 2007 at 10:47am
Hi Brian,
 
Do you have any samples on how to add a new field to a report from the code. I would really appreciate your help on this. I'm stuck with this problem for few days now and need to resolve it asap. I'm using crystal reports.net 2003.


-------------
Thanks.



Replies:
Posted By: BrianBischof
Date Posted: 20 Aug 2007 at 11:12pm
You can't add new fields. However, you can use a SQL statement which uses the ALIAS keyword to create a list of generic field names. That allows you to create dynamic SQL which swaps out the fields and change their order. If you want to drop a field, just replace it with an empty string. it's still not perfect, but it gets most people what they want.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: netcrguy
Date Posted: 21 Aug 2007 at 8:04am

Thanks Brian for the reply. I also read somewhere that we can do this with Crystal Reports X! Developer. Is this true.



-------------
Thanks.


Posted By: BrianBischof
Date Posted: 21 Aug 2007 at 8:31am
Yes, they added this functionality to the R2 release. I haven't tried it yet, but you do get full CR runtime customization of report objects. This is very exciting b/c people have been wanting this for a long time. It will be a couple months before I can dive into it and write about it for the .NET 2005 book coming out at the end of the year.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: netcrguy
Date Posted: 22 Aug 2007 at 11:19am

Brian,

I have purchased the CR XI developer release 2 and have started playing around with it. If you know some code from somwhere please give me the link. I will also paste my code here after i've figured out how to do this.
 
Thanks


-------------
Thanks.


Posted By: BrianBischof
Date Posted: 22 Aug 2007 at 1:45pm
Unfortunately, I don't have any code yet. I don't have time to dig into it yet. If you find some code, it would be great to give us a heads-up.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window