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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
musalmanERP ConsultantCommented:
correct but CROSS TAB SUPPORTS Dynamic cols...otherwise difficult to map the cols on report despite you generate  it with sql...
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.