Print Page | Close Window

Dynamic crystal report

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
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=15651
Printed Date: 19 Apr 2025 at 12:57pm


Topic: Dynamic crystal report
Posted By: Vishalvl
Subject: Dynamic crystal report
Date Posted: 16 Feb 2012 at 11:18am
Hi,

I have a procedure where the number of columns and column name both are dynamic . i need to populate the output of the procedure in a crystal report , i am using VS 2005 .

Can some one help me ASAP as the delivery date in very much near and from last one week i am struggling on this..



Replies:
Posted By: lockwelle
Date Posted: 20 Feb 2012 at 3:27am
you can't.  CR doesn't like a dynamic schema...ok you could probably build the entire report in code, but that seems like too much work to me, and maintenance would be an utter nightmare.
 
Instead of dynamic column names, put all the names to a standard, say col1, col2, col3...
 
then create a table of what the verbiage you want displayed is and display that instead.  The table doesn't have to be linked to any other, and CR will only read the first line of the table...but that is enough.  I use this table to pass back the parameters for my reports.  You could also embed this table in your main return.
 
Is there a max # of columns?  If so, create that many columns in your output, whether or not they are populated and then dynamically suppress the columns if their title is null or blank (use it as a flag).
 
If there is truly limit to the number of columns, perhaps a crosstabs style report is a better option as it is dynamic in the number and name of the columns



Print Page | Close Window