Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Databinding for SSRS CustomReportItem

Databinding for SSRS CustomReportItem

Scheduled Pinned Locked Moved Database
sql-servercomhelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark J Miller
    wrote on last edited by
    #1

    I am trying tie a reporting services data source with a custom report item and can't seem to find any helpful samples/documentation anywhere. This task is taking much longer than it should have at this point and I could really use some help if there's anyone who has done this before. What I want to do is create a series designer properties which allow me to : 1) select a data source from a list of available sources which have been defined for the report 2) select fields from the data source and assign them to designer properties 3) navigate the CustomReportItem.CustomData (is that the correct object?) object using the field names which were selected in step 2 (above) to retrieve the runtime values and bind them to my custom report item.

    Mark's blog: developMENTALmadness.blogspot.com

    M 1 Reply Last reply
    0
    • M Mark J Miller

      I am trying tie a reporting services data source with a custom report item and can't seem to find any helpful samples/documentation anywhere. This task is taking much longer than it should have at this point and I could really use some help if there's anyone who has done this before. What I want to do is create a series designer properties which allow me to : 1) select a data source from a list of available sources which have been defined for the report 2) select fields from the data source and assign them to designer properties 3) navigate the CustomReportItem.CustomData (is that the correct object?) object using the field names which were selected in step 2 (above) to retrieve the runtime values and bind them to my custom report item.

      Mark's blog: developMENTALmadness.blogspot.com

      M Offline
      M Offline
      Mark J Miller
      wrote on last edited by
      #2

      Well, I found the solution to the problem. The requirements for using the CustomData property are this: A) In the CustomReportItemDesigner class (your custom class which inherits from it as a base), override the InitializeNewComponent() method like this: public override void InitializeNewComponent() { base.InitializeNewComponent(); CustomData = new CustomData(); //at least one grouping is required for both rows and columns //initialize a static row grouping CustomData.DataRowGroupings = new DataRowGroupings(); CustomData.DataRowGroupings.DataGroupings = new List<DataGrouping>(1); CustomData.DataRowGroupings.DataGroupings.Add(new DataGrouping()); CustomData.DataRowGroupings.DataGroupings[0].Static = true; // initialize a Static column grouping CustomData.DataColumnGroupings = new DataColumnGroupings(); CustomData.DataColumnGroupings.DataGroupings = new List<DataGrouping>(1); CustomData.DataColumnGroupings.DataGroupings.Add(new DataGrouping()); CustomData.DataColumnGroupings.DataGroupings[0].Static = true; //initialize data row with empty values for designer CustomData.DataRows = new List<DataRow>(1); CustomData.DataRows.Add(new DataRow()); CustomData.DataRows[0].Add(new DataCell()); //define the fields you will store (these will be populated with expressions by custom designer properties you define) CustomData.DataRows[0][0].Add(new DataValue("Label", String.Empty)); CustomData.DataRows[0][0].Add(new DataValue("X", String.Empty)); CustomData.DataRows[0][0].Add(new DataValue("Y", String.Empty)); } B) Define custom designer properties to set the expressions for the DataValuesCollection (only showing one property here to keep things shorter) [Browsable(true), Category("Data")] public string XValue { get { if (CustomData.DataRows.Count > 0 && CustomData.DataRows[0].Count > 0) return GetDataValue(CustomData.DataRows[0][0], "X"); else return "X Coordinate"; } set { SetDataValue(CustomData.DataRows[0][0], "X", value); } } private string GetDataValue(DataCell cell, string name) { foreach (DataValue value in cell) if (value.Name == name) return value.Value; return null; } private void SetDataValue(DataCell cell, string name, string expression) { foreach (DataValue value in cell) if (value.Name == name) { value.Value = expression; return; } DataValue datavalue = new DataValue(name, expression); cell.Add(dat

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups