Forum  General Visual ...  Visual WebGui v...  VWG 6.4C - ReportViewer 10 - hosted_control_id problem *Resolved*
Previous Previous
 
Next Next
New Post 11/28/2011 10:54 PM
Resolved
  toooml
14 posts
No Ranking


VWG 6.4C - ReportViewer 10 - hosted_control_id problem *Resolved* 
Modified By toooml  on 11/30/2011 2:56:35 AM)

 Hello everyone,

I am currently facing with a problem in my wrapped reportviewer 10 control.

This is the error i got:
Cannot convert hosted control found using 'hosted_control_id' control ID to 'Microsoft.Reporting.WebForms.ReportViewer' type.

This is the way, i add the control to my project:

* I reference the needed assemblies to my project

* Then i add the ReportViewer with the asp.net wrapper to my project

After that I modify the code of the class like I read in other articles to prevent the error with the scriptmanager and to set the asyncpostbacktimeout:

extern alias ReportViewer10;

using System;

using System.ComponentModel;

using System.Linq;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using Gizmox.WebGUI.Common.Interfaces;

using Gizmox.WebGUI.Forms.Hosts;


namespace TIP.HCe.Common.GUI.WrappedControls

{

    /// <summary>

    /// Provides a Visual WebGui callable wrapper for Microsoft.Reporting.WebForms.ReportViewer.

    /// </summary>

    [ToolboxItem(true)]

    public partial class ReportViewer2010Wrapper : AspControlBoxBase

    {

        public ReportViewer2010Wrapper()

        {

            InitializeComponent();

        }


        protected override void OnHostedPageLoadComplete(object sender, EventArgs e)

        {

            base.OnHostedPageLoadComplete(sender, e);

        }


        protected override void OnHostedControlLoad(object sender, EventArgs e)

        {

            base.OnHostedControlLoad(sender, e);

        }


        protected override void OnHostedControlPreRender(object sender, EventArgs e)

        {

            base.OnHostedControlPreRender(sender, e);

        }


        protected override void FireEvent(IEvent objEvent)

        {

            base.FireEvent(objEvent);

        }


        protected override HtmlForm CreateHostPageForm()

        {

            HtmlForm objForm = base.CreateHostPageForm();

            ScriptManager objSm = objForm.Controls.OfType<ScriptManager>().FirstOrDefault();


            //Wurde kein ScriptManager gefunden, wird ein neuer eingefügt.

            if (objSm == null)

            {

                objSm = new ScriptManager();

                objForm.Controls.Add(objSm);

            }


            //Gets or sets a value that indicates the time, in seconds, before asynchronous postbacks time out if no response is received.

            objSm.AsyncPostBackTimeout = 100000;


            return objForm;

        }

    }

}

Maybe someone had the problem before?

I also read in an other article that i have to add some asp code from a ascx file to my resx but my reportviewer class has no resx file. So i don't know to solve this problem.

Thanks,

Tom

 

EDIT:

This was the problem:
this.rv.ControlCode = resources.GetString("rv.ControlID");

I changed it to this and it worked.
this.rv.ControlCode = resources.GetString("rv.ID");

 

 
New Post 11/29/2011 8:09 AM
  Ewans
600 posts
1st Level Poster




Re: VWG 6.4C - ReportViewer 10 - hosted_control_id problem 
Modified By Ewans  on 11/29/2011 12:11:26 PM)

Hi Tom

I actually use the with sources version so that I can edit the out of the box controls.

I have edited the Report Viewer wrapper to include the asyncronous timeout and various other features that are not in the out of the box wrapper, which works for me.

Regards

Ewan

 
New Post 11/29/2011 10:05 AM
  toooml
14 posts
No Ranking


Re: VWG 6.4C - ReportViewer 10 - hosted_control_id problem 

 Hmm.

Actually I do the same. And you don't have the problem with the hosted_control_id?

Is this maybe only available in a report which is created with visual studio 2008 or above?

The reports I use are made with visual studio 2005.

greetings

 
New Post 11/30/2011 12:11 AM
  Ewans
600 posts
1st Level Poster




Re: VWG 6.4C - ReportViewer 10 - hosted_control_id problem 
Modified By Ewans  on 11/30/2011 4:12:30 AM)

Hi Tom

You are correct you need to convert your reports to 2008 format.

Create a 2008 reporting services project and import the reports to quickly convert them.

NB there is no need to create RDLC reports for embedded use in an application as RDL reports will work just the same as long as you provide the datasources. This has the advantage that you can use MS  BIDS to develop and test your reports

Regards

Ewan

 
New Post 11/30/2011 1:22 AM
  toooml
14 posts
No Ranking


Re: VWG 6.4C - ReportViewer 10 - hosted_control_id problem 

 Thanks for the info ewans.

But I solved the problem. I updated the first post and added the solution.

 

 
Previous Previous
 
Next Next
  Forum  General Visual ...  Visual WebGui v...  VWG 6.4C - ReportViewer 10 - hosted_control_id problem *Resolved*
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS