Answered Grouping In dynamic generated rdlc report

  • 30 octombrie 2008 06:26
     
     
    Hi

    How to group data in a dynamically generated rdlc report?

    Thanks & Regards, Asif Abdulla "The hands that help are holier than the lips that pray"

Toate mesajele

  • 30 octombrie 2008 13:44
     
     
    to provide dynamic grouping, just add a field to your datasource called Group1, and set your table to group on "Group1"

    Then when you get the data for your report, before you hand the datasource to the report, add the column group1 to the datasource and then fill it with the values to be sorted by.   Then hand the modified datasource to your report.
    Living my life at 123mph in 11.15 seconds
  • 30 octombrie 2008 14:42
     
     
    Can u please give me an example.
    Thanks & Regards, Asif Abdulla "The hands that help are holier than the lips that pray"
  • 30 octombrie 2008 14:49
     
     
    kind of hard to do, I can only assume what the structure of your solution is since you haven't supplied any info on how you set things up.


    You say you dynamically build your rdlc?

    Well, then I'd assume you dynamiccally write the xml for the .rdlc file your using.

    And in that case, I'm guessing your dynamically writing the datasource xml.

    If this is true, just make your code always add the field "Group1" or whatever you want to call it, to the datasource area of your xml.

    Then you have to write the xml for the group settings for the table control in your report.   To see an example of this, just create one via the designer, and then look at the .rdlc file and you'll see the xml for it.

    Now, I don't know how you go about getting your datasource from your database, or wherever your getting your datasource, nor do I know what kind of datasource your using.

    I also don't know how you intend on letting the user choose what to group by dynamically.  Which makes it hard to give an example.

    If your using a datatable.

    You could pull the column names from the datatable, and put them in a drop-down.  Let the user choose his column.

    Then take your datatable, add a column to it, name the column group1.   Then loop through the table one row at a time,  and copy the value from the field the user selected, over to the "Group1" column.

    Once you've done that, hand the datasource to the report.
    Living my life at 123mph in 11.15 seconds
  • 1 noiembrie 2008 11:22
     
     
    hi
    i created Report using C# Code. i got this code from GotReportViewer.Com.
    i want to add group to this Code.....
    any one have idea about this?


    Regards
    jouhar
  • 2 noiembrie 2008 14:38
     
     Răspuns
    personally I never used gotreportviewer.com for stuff like that.   I created dynamic reports by just using generic field names like Field1 field2 field 3
    Living my life at 123mph in 11.15 seconds
  • 2 martie 2012 20:36
     
     

    Another choice is to use www.rptgen.com componet.

    Thanks