Crystal Report Dynamic Columns

I want a report with dynamically growing column.
I wont be able to know the columns , their name or value at design time.
Eg:- The DataTable might contain columns user1, user2, user2
with values

USER1, USER2, USER3  ...
1            34            2
23          20            4
3            10            26
GRChandrashekarAsked:
Who is Participating?
 
musalmanERP ConsultantCommented:
As You told that "dynamically growing column"
It seems that You don't know the Number of Cols also...

IF No of Cols is Fixed as You written (10 Cols) then OK. You can design this report...

In SQL, You need to create a Temp Table with all Required Cols with Col Heading as Required.
e.g
USER1, USER2, USER3 .., USER 10

Now You need to Populate the Data at SQL Level. You need to put some If Conditions in your Script.

Here, As your Script will return always Fixed Cols, despite the values , You can map the Cols on Crystal report...
0
 
musalmanERP ConsultantCommented:
You can generate cols from Sql Server and then display on report using Cross Tab Report.
Read Cross Tab Help in Crystal Report.

0
 
GRChandrashekarAuthor Commented:
It is not cross tab
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
musalmanERP ConsultantCommented:
correct but CROSS TAB SUPPORTS Dynamic cols...otherwise difficult to map the cols on report despite you generate  it with sql...
0
 
GRChandrashekarAuthor Commented:
but my report format is not like cross tab
0
 
musalmanERP ConsultantCommented:
Ok ...
0
 
mlmccCommented:
Are you saying you won't know the column names or that you don't know the number of columns?

Crystal doesn't support the idea of dynamically adding columns based on the query.

mlmcc
0
 
GRChandrashekarAuthor Commented:
I dont know the column names.

I want to design report with 10 columns

If out put has 5 columns ( in between 1 column may be empty). then it should appear in such a way that blank column is not visible and rest of columns should be repositioned
0
 
mlmccCommented:
How is the data to be selected for the report?

mlmcc
0
 
GRChandrashekarAuthor Commented:
Like this
USER1, USER2, USER3  ...
1            34            2
23          20            4
3            10            26

If USER2 is null then it is like
USER1,  USER2  ...
1            34            
23          20            
3            10            
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.