473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

question about CRI in reporting service

i have question please and need your help

i have developed Custom Reporting item , i have make simple user control and sure it is done in win form , and then i took this control and have made design time component and run time component and i deploy me item,and it appear in report item toolbox , but when i tried to drag this control in the report there is an error appear : the method or operation is not implemented

please can any one tell me what is the cause of this error

best regards,
Jun 7 '10 #1
9 2194
tlhintoq
3,525 Expert 2GB
Sounds like something in the in the Constructor trying to do it's job before the item is loaded.

Can you move code from the constructor to the Load event?

If you have custom/override on the On_Paint event, that could also be a source of the problem.
Jun 7 '10 #2
Dear tlhintoq :

thanks for your fast reply , actually my constructor dont' do job excpet intilze varabile , and about on paint event could you please explain in more detial what do you mean by this cause

this is my design time class


Expand|Select|Wrap|Line Numbers
  1.     public class mapDesigner : CustomReportItemDesigner
  2.     {
  3.         private mapControl map_control;
  4.         private DesignerVerbCollection _verbs;
  5.  
  6.         public mapDesigner()
  7.         {
  8.             map_control = new mapControl();
  9.         }
  10.  
  11.         public override void InitializeNewComponent()
  12.         {
  13.             SetDefaults();
  14.         }
  15.  
  16.        public void SetDefaults()
  17.         {
  18.            // intial values 
  19.             Microsoft.ReportDesigner.Drawing.ReportColor outlineColor = new Microsoft.ReportDesigner.Drawing.ReportColor();
  20.             outlineColor.ColorRgb = Color.Black;
  21.             this.Style.BorderColor.Default = outlineColor; 
  22.            Microsoft.ReportDesigner.Drawing.ReportColor barColor = new Microsoft.ReportDesigner.Drawing.ReportColor();
  23.            barColor.ColorRgb = Color.Green;
  24.            this.Style.Color = barColor;
  25.            IComponentChangeService changeSvc = (IComponentChangeService)this.Site.GetService(typeof(IComponentChangeService));
  26.            changeSvc.OnComponentChanged(this, null, null, null);
  27.         }
  28.  
  29.          // OVERIDE METHODS
  30.          // override onpaint 
  31.        public override void OnPaint(PaintEventArgs e)
  32.        {
  33.             // give control some values
  34.            map_control.FillColor= this.Style.BorderColor.Default.ColorRgb;
  35.            map_control.Height = this.Height.Pixels;
  36.            map_control.Width = this.Width.Pixels;
  37.            map_control.DrawControl(e.Graphics);
  38.        }
  39.  
  40.          // override default size
  41.        public override Microsoft.ReportDesigner.Drawing.DesignSize DefaultSize
  42.        {
  43.            get
  44.            {
  45.                return new Microsoft.ReportDesigner.Drawing.DesignSize(new RSDrawing.Unit(150),new RSDrawing.Unit(30));
  46.            }
  47.        }
  48.  
  49.        public override Adornment Adornment { get { throw new NotImplementedException(); } }
  50.        public override DesignerVerbCollection Verbs
  51.        {
  52.            get
  53.            {
  54.                if (_verbs == null)
  55.                {
  56.                    _verbs = new DesignerVerbCollection();
  57.                    _verbs.Add(new DesignerVerb("Reset Defaults", new EventHandler(OnCustomAction)));
  58.                }
  59.  
  60.                return _verbs;
  61.            }
  62.        }
  63.  
  64.        private void OnCustomAction(object sender, EventArgs e)
  65.        {
  66.            switch (((System.ComponentModel.Design.DesignerVerb)sender).Text)
  67.            {
  68.                case "Reset Defaults": SetDefaults(); Invalidate(); break;
  69.                default: MessageBox.Show("Not supported"); break;
  70.  
  71.            }
  72.        }
  73.  
  74.  
  75.         //
  76.        public override void BeginEdit() { }
  77.        public override void Dispose() { }
  78.        protected override void Dispose(bool disposing) { }
  79.        public override void DoDefaultAction() { }
  80.        public override void EndEdit() { }
  81.        public override void OnBackgroundColorChanged() { }
  82.        public override void OnColorChanged() { }
  83.        public override void OnDragDrop(DragEventArgs e) { }
  84.        public override void OnDragEnter(DragEventArgs e) { }
  85.        public override void OnDragLeave(EventArgs e) { }
  86.        public override void OnDragOver(DragEventArgs e) { }
  87.        public override void OnFontChanged() { }
  88.        public override void OnLocationChanged() { }
  89.        public override void OnPaddingChanged() { }
  90.  
  91.        public override void OnSizeChanged() { }
  92.        public override void OnTextAlignChanged() { }
  93.        public override void OnTextDecorationChanged() { }
  94.        public override bool ShowContextMenu(int x, int y) 
  95.        {
  96.            return true;
  97.        }
  98.     }
  99.  
hint : i override all these methods cause they are virtual in parent class (do i have to do so???)

and this is my run time class :

Expand|Select|Wrap|Line Numbers
  1. public class mapRender : ICustomReportItem 
  2.     {
  3.  
  4.        private CustomReportItem _cri;
  5.         private Microsoft.ReportingServices.ReportRendering.Image _image;
  6.         private mapControl _progress = null;
  7.  
  8.  
  9.         public mapRender()
  10.         {
  11.             _progress = new mapControl();
  12.         }
  13.  
  14.        // Initialize
  15.  
  16.        private void Initialize()
  17.        {
  18.            if (null == _progress)
  19.            {
  20.                _progress = new mapControl();
  21.            }
  22.            _progress.FillColor=Color.Red;
  23.            _progress.Height = 100;
  24.            _progress.Width = 200;
  25.        }
  26.  
  27.  
  28.      public  Action Action_public
  29.                {
  30.                    get
  31.                    {
  32.                        return null;
  33.                    }
  34.                }
  35.       public ReportItem RenderItem_public
  36.       {
  37.           get
  38.           {
  39.               if (_image == null)
  40.               {
  41.                  Process_public();
  42.               }
  43.               return _image;
  44.           }
  45.       }
  46.  
  47.     public ChangeType Process_public()
  48.        {
  49.            // initialize CRI from properies in RDL
  50.            Initialize();
  51.  
  52.            // create a memory stream to save the image
  53.            MemoryStream stream = new MemoryStream();
  54.            Drawing.Bitmap bmp = new Drawing.Bitmap(_progress.Width, _progress.Height, PixelFormat.Format32bppArgb);
  55.            System.Drawing.Graphics graphics = Drawing.Graphics.FromImage(bmp);
  56.            Drawing.Color backgroundColor = ((ReportColor)_cri.Style["BackgroundColor"]).ToColor();
  57.            if (backgroundColor == Drawing.Color.Transparent)
  58.                backgroundColor = Drawing.Color.White;
  59.            graphics.Clear(backgroundColor);
  60.            _progress.DrawControl(graphics);
  61.            bmp.Save(stream, ImageFormat.Bmp);
  62.  
  63.            // Rewind image stream
  64.            stream.Position = 0;
  65.  
  66.            // Create a new RS image object
  67.            _image = new Microsoft.ReportingServices.ReportRendering.Image(_cri.Name, _cri.ID);
  68.            _image.MIMEType = "image/bmp";
  69.  
  70.            // serialize the image stream into the RS image
  71.            _image.ImageData = stream.ToArray();
  72.  
  73.            _image.Sizing = Microsoft.ReportingServices.ReportRendering.Image.Sizings.AutoSize;
  74.  
  75.            return ChangeType.None;
  76.        }
  77.  
  78.     Action ICustomReportItem.Action
  79.     {
  80.         get { return Action_public; }
  81.     }
  82.  
  83.     CustomReportItem ICustomReportItem.CustomItem
  84.     {
  85.         set
  86.         {
  87.             _cri = value;
  88.         }
  89.     }
  90.  
  91.     ChangeType ICustomReportItem.Process()
  92.     {
  93.         return Process_public();
  94.     }
  95.  
  96.     ReportItem ICustomReportItem.RenderItem
  97.     {
  98.         get { return RenderItem_public; }
  99.     }
  100.  
  101.     }
  102.  
can you please tell me if i have problem on this implementation

Best Regards
Jun 7 '10 #3
tlhintoq
3,525 Expert 2GB
TIP: When you first created your question you were asked to wrap your code with [code] tags.

It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it.

More on tags. They're cool. Check'em out.
Jun 7 '10 #4
tlhintoq
3,525 Expert 2GB
Personally, I wouldn't do this
Expand|Select|Wrap|Line Numbers
  1.  map_control.Height = this.Height.Pixels;
  2.            map_control.Width = this.Width.Pixels;
in the OnPaint. It means you are sizing every time the control is painted. I would put it in the SizeChangeCompleted event. So when your parent control is resized, so is the encapsulated child control... but not every time it is painted.

Things like this can cause a problem with the designer. As soon as the designer tries to paint this control, your OnPaint override is executed. But if 'this' doesn't exist... then you cannot do this.width .. and so on.

See how this trickles down?
Jun 7 '10 #5
thank you for this advice , it really help

Expand|Select|Wrap|Line Numbers
  1.  
  2.  public class mapDesigner : CustomReportItemDesigner
  3.     {
  4.         private mapControl map_control;
  5.         private DesignerVerbCollection _verbs;
  6.  
  7.         public mapDesigner()
  8.         {
  9.             map_control = new mapControl();
  10.         }
  11.  
  12.         public override void InitializeNewComponent()
  13.         {
  14.             SetDefaults();
  15.         }
  16.  
  17.        public void SetDefaults()
  18.         {
  19.            // intial values 
  20.             Microsoft.ReportDesigner.Drawing.ReportColor outlineColor = new Microsoft.ReportDesigner.Drawing.ReportColor();
  21.             outlineColor.ColorRgb = Color.Black;
  22.             this.Style.BorderColor.Default = outlineColor; 
  23.            Microsoft.ReportDesigner.Drawing.ReportColor barColor = new Microsoft.ReportDesigner.Drawing.ReportColor();
  24.            barColor.ColorRgb = Color.Green;
  25.            this.Style.Color = barColor;
  26.            IComponentChangeService changeSvc = (IComponentChangeService)this.Site.GetService(typeof(IComponentChangeService));
  27.            changeSvc.OnComponentChanged(this, null, null, null);
  28.         }
  29.  
  30.          // OVERIDE METHODS
  31.          // override onpaint 
  32.        public override void OnPaint(PaintEventArgs e)
  33.        {
  34.             // give control some values
  35.            map_control.FillColor= this.Style.BorderColor.Default.ColorRgb;
  36.            map_control.Height = this.Height.Pixels;
  37.            map_control.Width = this.Width.Pixels;
  38.            map_control.DrawControl(e.Graphics);
  39.        }
  40.  
  41.          // override default size
  42.        public override Microsoft.ReportDesigner.Drawing.DesignSize DefaultSize
  43.        {
  44.            get
  45.            {
  46.                return new Microsoft.ReportDesigner.Drawing.DesignSize(new RSDrawing.Unit(150),new RSDrawing.Unit(30));
  47.            }
  48.        }
  49.  
  50.        public override Adornment Adornment { get { throw new NotImplementedException(); } }
  51.        public override DesignerVerbCollection Verbs
  52.        {
  53.            get
  54.            {
  55.                if (_verbs == null)
  56.                {
  57.                    _verbs = new DesignerVerbCollection();
  58.                    _verbs.Add(new DesignerVerb("Reset Defaults", new EventHandler(OnCustomAction)));
  59.                }
  60.  
  61.                return _verbs;
  62.            }
  63.        }
  64.  
  65.        private void OnCustomAction(object sender, EventArgs e)
  66.        {
  67.            switch (((System.ComponentModel.Design.DesignerVerb)sender).Text)
  68.            {
  69.                case "Reset Defaults": SetDefaults(); Invalidate(); break;
  70.                default: MessageBox.Show("Not supported"); break;
  71.  
  72.            }
  73.        }
  74.  
  75.  
  76.         //
  77.        public override void BeginEdit() { }
  78.        public override void Dispose() { }
  79.        protected override void Dispose(bool disposing) { }
  80.        public override void DoDefaultAction() { }
  81.        public override void EndEdit() { }
  82.        public override void OnBackgroundColorChanged() { }
  83.        public override void OnColorChanged() { }
  84.        public override void OnDragDrop(DragEventArgs e) { }
  85.        public override void OnDragEnter(DragEventArgs e) { }
  86.        public override void OnDragLeave(EventArgs e) { }
  87.        public override void OnDragOver(DragEventArgs e) { }
  88.        public override void OnFontChanged() { }
  89.        public override void OnLocationChanged() { }
  90.        public override void OnPaddingChanged() { }
  91.  
  92.        public override void OnSizeChanged() { }
  93.        public override void OnTextAlignChanged() { }
  94.        public override void OnTextDecorationChanged() { }
  95.        public override bool ShowContextMenu(int x, int y) 
  96.        {
  97.            return true;
  98.        }
  99.  
  100.     }
  101.  
  102.  
Expand|Select|Wrap|Line Numbers
  1.  
  2. public class mapRender : ICustomReportItem 
  3.     {
  4.  
  5.        private CustomReportItem _cri;
  6.         private Microsoft.ReportingServices.ReportRendering.Image _image;
  7.         private mapControl _progress = null;
  8.  
  9.  
  10.         public mapRender()
  11.         {
  12.             _progress = new mapControl();
  13.         }
  14.  
  15.        // Initialize
  16.  
  17.        private void Initialize()
  18.        {
  19.            if (null == _progress)
  20.            {
  21.                _progress = new mapControl();
  22.            }
  23.            _progress.FillColor=Color.Red;
  24.            _progress.Height = 100;
  25.            _progress.Width = 200;
  26.        }
  27.  
  28.  
  29.      public  Action Action_public
  30.                {
  31.                    get
  32.                    {
  33.                        return null;
  34.                    }
  35.                }
  36.       public ReportItem RenderItem_public
  37.       {
  38.           get
  39.           {
  40.               if (_image == null)
  41.               {
  42.                  Process_public();
  43.               }
  44.               return _image;
  45.           }
  46.       }
  47.  
  48.     public ChangeType Process_public()
  49.        {
  50.            // initialize CRI from properies in RDL
  51.            Initialize();
  52.  
  53.            // create a memory stream to save the image
  54.            MemoryStream stream = new MemoryStream();
  55.            Drawing.Bitmap bmp = new Drawing.Bitmap(_progress.Width, _progress.Height, PixelFormat.Format32bppArgb);
  56.            System.Drawing.Graphics graphics = Drawing.Graphics.FromImage(bmp);
  57.            Drawing.Color backgroundColor = ((ReportColor)_cri.Style["BackgroundColor"]).ToColor();
  58.            if (backgroundColor == Drawing.Color.Transparent)
  59.                backgroundColor = Drawing.Color.White;
  60.            graphics.Clear(backgroundColor);
  61.            _progress.DrawControl(graphics);
  62.            bmp.Save(stream, ImageFormat.Bmp);
  63.  
  64.            // Rewind image stream
  65.            stream.Position = 0;
  66.  
  67.            // Create a new RS image object
  68.            _image = new Microsoft.ReportingServices.ReportRendering.Image(_cri.Name, _cri.ID);
  69.            _image.MIMEType = "image/bmp";
  70.  
  71.            // serialize the image stream into the RS image
  72.            _image.ImageData = stream.ToArray();
  73.  
  74.            _image.Sizing = Microsoft.ReportingServices.ReportRendering.Image.Sizings.AutoSize;
  75.  
  76.            return ChangeType.None;
  77.        }
  78.  
  79.     Action ICustomReportItem.Action
  80.     {
  81.         get { return Action_public; }
  82.     }
  83.  
  84.     CustomReportItem ICustomReportItem.CustomItem
  85.     {
  86.         set
  87.         {
  88.             _cri = value;
  89.         }
  90.     }
  91.  
  92.     ChangeType ICustomReportItem.Process()
  93.     {
  94.         return Process_public();
  95.     }
  96.  
  97.     ReportItem ICustomReportItem.RenderItem
  98.     {
  99.         get { return RenderItem_public; }
  100.     }
  101.  
  102.     }
  103.  
  104.  
Jun 7 '10 #6
@tlhintoq
i have done that
Jun 7 '10 #7
@saraMoghazy
but stil the same error appear
Jun 7 '10 #8
tlhintoq
3,525 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. public mapDesigner()
  2.         {
  3.             map_control = new mapControl();
  4.         }
Just as a test, comment out this part. Don't make the mapControl when you make the Designer.

I've had this be a problem in a few cases when I nested one control inside another. The constructor for the nested control had some issue because it couldn't find a DLL it was dependent on in the new parent project and so on.
Jun 7 '10 #9
@tlhintoq
i have done it , the same error appear when i drag the control to report layout , do you think this may be problem in deployment , let me say my steps in deploy :

1- i have copy the CRI dll to 2 folders

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

&&

C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin

2- i have copy in the RSReportDesigner this

Expand|Select|Wrap|Line Numbers
  1.  <ReportItems>
  2.           <ReportItem Name="mapControl" Type="MapCRI.mapRender,MapCRI"/>
  3.       </ReportItems>
  4.  
  5.  
  6.       <ReportItemDesigner>
  7.           <ReportItem Name="mapControl" Type="MapCRI.mapDesigner,MapCRI"/>
  8.  
  9.  
where MapCRI is the namespace and mapDesigner , mapRender classes inside this solution

3- copy in rsreportserver this :

Expand|Select|Wrap|Line Numbers
  1.  
  2. <ReportItem Name="mapControl" Type="MapCRI.mapRender,MapCRI"/>
  3.  
  4.  
in
in rssrvpolicy

<CodeGroup class="UnionCodeGroup" version="1" Name="CRICodeGroup" Description="Code group for the ProgressTracker CRI" PermissionSetName="FullTrust">
<IMembershipCondition class="UrlMembershipCondition" version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS10.SQLSERVER2008\Reporting Services\ReportServer\bin\MapCRI.dll"/>

is that the compelete deploy
Jun 7 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: flecki | last post by:
I have the following Question: Is it possible to install a Reporting Service at IIS Webserver without SQL Server 2000 on the same machine. We have a Enterprise SQL Server at another machine...
2
by: ferit meftun harmankaya | last post by:
I have some report which are designed in "Crystal Report". I want to run these reports in "Reporting Service" My aim is to convert from extension of Crystal Report (rpt) to extension of reporting...
1
by: Krish | last post by:
Hi, I tried to Develop one Report in SQL Reporting Service. I have installed SQL Reporting Serivice in Windows 2003 machine. SQL Server Database is in another machine, running on Windows 2000. I...
1
by: hotice3100 | last post by:
I have created an interface for a SQL Reporting Service report. SQL Reporting Service makes a virutal directly in IIS called ReportServer. There are various buttons on the form I created and one...
7
by: ad | last post by:
I found that there is reporting service bundle with SQLSever 2005 express. Can VS2005 express can use the reporting service in SQLSever 2005 express?
1
by: holly | last post by:
Does anyone know a good newsgroup that I can ask question about sql reporting service? Thanks
2
by: RdS | last post by:
Hello, I use sourcesafe and vb 2003 for my dev environment. on the sourcesafe server I also have sql2005 and reporting services installed. The web app references this sql server for db. When...
0
by: refv8 | last post by:
Hi im working on aplications with Form authentication where the users is from a Active Directory in one server inside the Domain, i want to see using the ReportViewer to see the report hosted in...
2
by: jack | last post by:
Hi Our team is developing reports using sql reporting service 2005. We all are new in this area. I would be glad if any one suggest me the integration of asp.net and sql reporting service. ...
2
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I am using reporting service with asp.net. I want to save a report snapshot in some time. How do I do this in asp.net? Is there any web service to do this? Thanks in advance! -Billy
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.