Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Help Creating a Dynamic Table Post Reply Post New Topic
Author Message
tmbranch
Newbie
Newbie
Avatar

Joined: 18 Feb 2010
Online Status: Offline
Posts: 2
Quote tmbranch Replybullet Topic: Help Creating a Dynamic Table
    Posted: 18 Feb 2010 at 9:59am
First let me say that I am a novice programmer and this is the first time I have tried to use Crystal Reports.
 
My problem.  I have a datatable with up to 20 columns of data and several hundred rows.  What I need to do is create a report that will allow the user to select which columns of data they want to report, ranging from 1 to 20 and anywhere inbetween.
 
I can create the report with all the columns but can not figure out how to hide the columns that are not wanted.  These columns could be created to have null values if that is helpful...
 
Any suggestions would be greatly helpful.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 24 Feb 2010 at 7:11am
This is tricky, as there a several ways to accomplish this.  I would pass a delimited string into the report, from the application and then have the report suppress the columns that don't match (or suppress all columns and only display the ones that match)...but this will leave gaps in the report. 
 
Rather, what I would do is get the data from a stored proc.  Name all the columns something generic, like col1...col20.  Then in the stored proc, fill the data for these columns correctly based on the delimited string (allowing not only user selected fields, but user selected order) and then display only the fields desired, giving a clean look to the report.  The sp will be a monster do accommodate the variable columns, but the end result should look nice.  The only hitch is if the aggregate functions used are specific to the column...like you are suppressing some rows, or some fields are always COUNT and others are SUM, this will require more coding.
 
My hope is to plant a seed of what are some of the options, not give a solution as there isn't a easy one.
 
HTH
IP IP Logged
tmbranch
Newbie
Newbie
Avatar

Joined: 18 Feb 2010
Online Status: Offline
Posts: 2
Quote tmbranch Replybullet Posted: 24 Feb 2010 at 10:40am
HTH
 
thanks
 
I was on to that track myself, I was hoping for somethng a little easier..  Such is life..
 
Thanks for the response..
 
t
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.