none
Grouping In dynamic generated rdlc report RRS feed

  • Question

  • 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"
    Thursday, October 30, 2008 6:26 AM

Answers

  • 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
    Sunday, November 2, 2008 2:38 PM

All replies

  • 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
    Thursday, October 30, 2008 1:44 PM
  • Can u please give me an example.
    Thanks & Regards, Asif Abdulla "The hands that help are holier than the lips that pray"
    Thursday, October 30, 2008 2:42 PM
  • 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
    Thursday, October 30, 2008 2:49 PM
  • 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
    Saturday, November 1, 2008 11:22 AM
  • 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
    Sunday, November 2, 2008 2:38 PM
  • Another choice is to use www.rptgen.com componet.

    Thanks

    Friday, March 2, 2012 8:36 PM