How to add database field dynamically into Crystal report in C#?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saifulhaque
    New Member
    • Aug 2010
    • 16

    #1

    How to add database field dynamically into Crystal report in C#?

    Dear

    How can add database field dynamically into Crystal report using C#.

    I want to get change crystal report with respect to

    Database field.
  • Sandeep M

    #2
    Currently there is no way to do this directly in crystal report. You can achive this facility by doing it anotherway.

    if your report is haiving fixed no. of columns. then you just design the report this way.

    1. give the caption of column with parameters (not fixed label)
    e.g: filed1, field2,field3 ...etc.
    and your query(Strored procedure) must be like
    e.g: select emp_name as field1, age as field2,...etc

    at design time use any dummy sp having number of fields same as your report.

    at run time you can assign column caption by passing parameters ...


    it will work.

    I 've done this way variable number of columns too. for variable number of columns you need to keep multiple templates with different number of columns report.

    Comment

    Working...