on 06-12-2013 12:49 PM
Hello,
I have a requirement of generating dynamic columns on the crystal report.
like A customer had 10 columns then dat 10 columns shud be visible, B customer has 24 columns den dat many shud be visible on the report.
There might be possibility of columns getting increased or decreased for A or B customer, in short the columns are treated as rows in the database
so there is huge possibility of column getting increased.
I 'm confused how to achieve it, there are certain things available on the net but there is no specific code.
Plz help !
Message was edited by: Ludek Uher
hi Harshad, as the columns you need are stored as rows in the database (from your initial post) your data may look something like this (i'm using csv though)
UserName,StationName,Value
"ABC","Station 1",1
"ABC","Station 2",1
"ABC","Station 3",3
"DEF","Station 1",2
"DEF","Station 2",2
"DEF","Station 3",1
"DEF","Station 4",1
"GHI","Station 2",3
"GHI","Station 5",2
and the cross tab would then look something like this
the column field in the Cross tab expert would be the stationname field, the row field would be the username field, and the summary field would be the value field.
the report based on the above csv is also attached. please unzip and change the file extension from .txt to .rpt.
jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Harshad,
you mentioned that the number of columns is based on the number of rows in the database for a certain field. the easiest way to create a report where the number of columns based on the number of values for a database field is to Insert a Cross-tab and use that field as the Column field in the cross-tab.
the other option if you don't like the formatting limitations is to create a multi-column report. to do this,
i'm attaching two examples of multi column reports...a very simple one, and one with lots of formatting etc. after you unzip the files, change the extension to .rpt to open in crystal.
cheers,
jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jamie,
The attachment is not clear to me, could you please tell something about cross tab n how could I achieve dat .. my requirement.
Username | Station 1 | Station2 | Station3
ABC | 1 | 2 | 3
The station are my dynamic columns which I don't know at design, I just want to run my query and bind it to the report
You may want to post to this forum: http://scn.sap.com/community/crystal-reports also. And search first, others have posted the same question.
Simplest way is to create a template report with all of the fields you will allow in them. The fields are simply text boxes, at runtime simply replace the text boxes with fields and delete the ones not required.
I believe what you are wanting to do is create a report designer, look at the RAS RCAPI samples on this page:
http://wiki.sdn.sap.com/wiki/display/BOBJ/NET+RAS+SDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Harshad
Are you trying to do this at runtime, or in the CR Designer?
What version of CR?
If you are looking to do this at runtime, what version of .NET?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.