Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Report Viewer Control Problem in CMS WebPart View modes: 
User avatar
Member
Member
anji.anjee-gmail - 7/9/2010 12:25:08 PM
   
Report Viewer Control Problem in CMS WebPart
Hi All,

We want to have Reports in our site ,and here is the process how we want to do

1.Design and Develop reports Using SSRS
2.Host the Report to Reports Sever
3.Then Display the report in the Portal page by having ReportViewer webpart which has Microsoft's Report Viewer Control in it.


If i place the Microsoft's Report Viewer in ASPX page it works fine ,but When i used within a Webpart which inherits from CMSABSTRACTWEBPART ,then there comes the problem



Server Error in '/CMS' Application.
--------------------------------------------------------------------------------

Internal error: ClientID reference before OnInit
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Internal error: ClientID reference before OnInit

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[Exception: Internal error: ClientID reference before OnInit]
Microsoft.Reporting.WebForms.ReportViewer.OnInit(EventArgs e) +253
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927


I dont have answer for this ,

please do any one guide me in the right direction.


Thanks in Advance
Anjee

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/22/2010 3:25:39 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Hi Anjee,


could you please try to place the Microsoft's Report Viewer to User control (and do not inherit from CMSAbstractWebpart)? Please see here: Adding custom code to the Portal page template for more details.


Best regards,
Helena Grulichova

User avatar
Member
Member
Orefus - 5/11/2012 7:30:47 PM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,
mam rovnaky problem ....
potrebujem vytvorit webpart/widget (Kentico CMS objekt)
ktory by dokazal zobrazovat reporty pomocou webservices s tym,
ze tieto su na inom servery v DMZ na MS SQL report services vypublikovane
cez web services ....
na to by mal sluzit vo MS VS object report viewer ...
pozeral som si postup pre vytvaranie samotnych webpart/widget
a podarilo sa mi ich zopar vytvorit a funguju v poriadku.
Avsak s tymto objektom mam problem
aj ked je spravne nastaveny tak server odkial ma dane reporty preberat
aj folder odkial ma nacitat samotny report

s podakovanim ....

Vasko

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/14/2012 3:50:35 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,


Na standardni ASPX strance se Vam report zobrazuje dobre, a v Kentico web parte ne?

Zkousel jste tez vyse uvedeny User control web part?


Dekuji predem za odpoved,

Helena Grulichova

User avatar
Member
Member
Orefus - 5/14/2012 4:35:37 PM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den.

Prakticky doteraz som vsetky webparty, ktore mi fungovali vyrabal tak ze som si dal vytvorit/pridat novy web User Control ...
Nasledne som podla najdenych postupov zmenil jeho class na CMSAbstractWebPart
takze na zaklade Vasho odporucania som dnes vytvoril opat novy User Control s Report Viewer-om a nezmenil som class na CMSAbstractWebPart ale ponechal som ten System.Web.UI.UserControl

vysledok :
[Error loading the WebPart 'WEBUserControl']
Unable to cast object of type 'ASP.cmswebparts_mywebparts_reportviwer_uc_webusercontrol_ascx' to type 'CMS.PortalControls.CMSAbstractWebPart'.
vysledok zase negativny !!!

upozornuje ma, ze musi byt class CMSAbstractWebPart
mate este nejaky dalsi typ?

s pozdrawom

Vasko

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/15/2012 6:14:45 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,

kolegyna mala na mysli User Control web partu. Tato zmeni zivotny cyklus kontrolu, tak ze by mal byt kompatibilny s kenticom.

V podstate pouzijete kontrol, ktory Vam funguje na ASPX stranke. A cestu k nemu nastavite v property User Control web party:

User Control web part

S pozdravom,
Ivana Tomanickova

User avatar
Member
Member
Orefus - 5/15/2012 3:37:47 PM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,

dakujem za odpovede ....
Ale naozaj som nerozumel tomu vysvetleniu kedze user control som vnimal inac teda ako objekt vo MS VS a nie ako webpart ....
Nasiel som ten User Control web part vlozil som mu cestu k aspx stranke avsak odpovedal mi ze ta stranka nie je inherit webusercotrol-u.
Tak ma napadlo si v MS VS vytvorit novy vlastny WebUserControl s objektom report Viewera
Tensom potom nalinkoval Web Partu User Control ...
dal som tento webpart na novu stranku a funguje ....
jedna basen ...
dakujem dakujem dakujem ...

Mam eshte dve otazky ci existuje takato cesta aj v pripade vytvorenia widgetu
pripadne ci ma viete usmernit ...

A dalsia je predavanie parametrov medzi webpart/widget do WebUserControlu v MS VS
a nasledne ten aby predal parametre obejktu Report Viewera ktory otvara samotny report ...
Teda Adminsitrator by pre dany Webpart/Widget vyplnil nejake property manualne
jedna property ko je meno alebo skupina zakaznika alebo nejaka jeho profile property by sa vyplnila "sama" cez macro a stymito parametrami zavola WebPart/Widget samotny WebUserControl a preda parametre objektu Rerpot Viewera ...
vedeli by ste ma aj v tomto nasmerovat pripadne odkazat ma na nejaku example v dokumentacii ?

dakujem

Vasko

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/16/2012 4:00:25 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,

1. vyskusajte spravit z user control web party user control widget a nastavit mu cestu ku kontrolu.

2. Priklady kodu, ktory umoznuje zmenit property najdete tu:
How to change property of web part

How to share information between web part and control

S pozdravom,
Ivana Tomanickova

User avatar
Member
Member
Orefus - 5/31/2012 11:57:58 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,
dakujem za rady a usmernenie ...
prakticky som pouzil webpat - User Control ...
v nom mam len jeden button, ktory len otvara v novom okne kentico web stranku,
ktora obsahuje len web control Rerpot Viewer.
Parametre ako su samotne webpart property.
pri otvoreni stranky predavam ako http session property
ktore su na v novootvorenom okne dostupne vramci existujucej session
a tymi to parametrami plnim/predvyplnam potrebne hodnoty
pre otvorenie Rerportu plus predvyplnam dostupne filtre podla potreby ...

Chcel som sa eshte dodatocne spytat nakolko teraz
ak chcem dostat nejaku user profile property napriklad meno aktualne prihlasneho uzivatela musim mat vytvorenu webpart property ktory plnim pomocou makra
honotou z currentuser.username ...
chcel som sa opytat ako priamo v kode mozem ziskat tuto hodnotu
pripadne ako k nej pristupovat nakolko chcem vylucit chybu administratora
ktory bude property danej webparty vyplnat ...
teda chcem "natvrdo" v kode webpartu pristupovat napriklad k premennej
ktore je dostupna aj cez makro napriklad k hodnote currentuser.username

s podakovanim

Vasko

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/3/2012 7:06:29 AM
   
RE:Report Viewer Control Problem in CMS WebPart
Dobry den,

pravdepodobne mate na mysli triedu CMSContext, v ktorej su informacie dostupne:

string userName = CMSContext.CurrentUser.UserName;

S pozdravom,
Ivana Tomanickova