Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 4 Jul 2008 17:53:21 +0300,    group: microsoft.public.dotnet.framework.aspnet.buildingcontrols        back       


challenging dynamic reporting portal using webparts.   
hello,
I am trying to create n controls, modify each controls' properties then add 
them to the catalog zone.

Then the user will select and add each webpart to the approciate 
webpartzone.

why n?
each control is a different report the user has generated before and each 
query of them is saved in the database.
the purpose of this is, when the user logs in, I will find the querries of 
the user, populate each report item (control) in the catalog zone,
then the user will be able to select what report she wants to see in her 
welcome page....

need a lot help on this (referral, sample, advice.....)

rifat
date: Fri, 4 Jul 2008 17:53:21 +0300   author:   rifat yavuz

Re: challenging dynamic reporting portal using webparts.   
Hi Rifat,

DeclarativeCatalogZone has a property called "WebPartsTemplate" which has 
the type of ITemplate.

So; the idea how to use it is just like below.



<asp:CatalogZone ID="mainCatalogZone" runat="Server">
	<ZoneTemplate>
		<asp:DeclarativeCatalogPart ID="mainCatalogPart" runat="server" 
Title="Available WebParts">
		</asp:DeclarativeCatalogPart>
	</ZoneTemplate>
</asp:CatalogZone>



In code behind:



DeclarativeCatalogPart m_MainCatalogPart = 
mainCatalogZone.FindControl("mainCatalogPart") as DeclarativeCatalogPart;

if (m_MainCatalogPart == null)
	return;

WebPartsList m_WebPartsList = new WebPartsList();

m_MainCatalogPart.WebPartsTemplate = m_WebPartsList;



And "WebPartsList" class and its logic looks like the following:



    public class WebPartsList : ITemplate
    {
        #region ITemplate Members

        public void InstantiateIn(Control owner)
        {
		// Add WebParts here, in a foreach or a for or any other applicable circle

		WebPart m_WebPart = new WebPart(); // You must set the correct type here

		m_WebPart.ID = "wp123";
		m_WebPart.Title = "Title";
		m_WebPart.Description = "Description";

		owner.Controls.Add(m_WebPart);
        }

        #endregion
    }

-- 
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk

"rifat yavuz"  wrote in message 
news:uknjzWe3IHA.5088@TK2MSFTNGP03.phx.gbl...
> hello,
> I am trying to create n controls, modify each controls' properties then 
> add them to the catalog zone.
>
> Then the user will select and add each webpart to the approciate 
> webpartzone.
>
> why n?
> each control is a different report the user has generated before and each 
> query of them is saved in the database.
> the purpose of this is, when the user logs in, I will find the querries of 
> the user, populate each report item (control) in the catalog zone,
> then the user will be able to select what report she wants to see in her 
> welcome page....
>
> need a lot help on this (referral, sample, advice.....)
>
> rifat
>
>
date: Wed, 9 Jul 2008 14:34:16 +0300   author:   Coskun SUNALI [MVP]

Re: challenging dynamic reporting portal using webparts.   
Thanks for the idea,
I will try the idea

tsk :)

"Coskun SUNALI [MVP]"  wrote in message 
news:u1gr8eb4IHA.4908@TK2MSFTNGP04.phx.gbl...
> Hi Rifat,
>
> DeclarativeCatalogZone has a property called "WebPartsTemplate" which has 
> the type of ITemplate.
>
> So; the idea how to use it is just like below.
>
>
>
> <asp:CatalogZone ID="mainCatalogZone" runat="Server">
> <ZoneTemplate>
> <asp:DeclarativeCatalogPart ID="mainCatalogPart" runat="server" 
> Title="Available WebParts">
> </asp:DeclarativeCatalogPart>
> </ZoneTemplate>
> </asp:CatalogZone>
>
>
>
> In code behind:
>
>
>
> DeclarativeCatalogPart m_MainCatalogPart = 
> mainCatalogZone.FindControl("mainCatalogPart") as DeclarativeCatalogPart;
>
> if (m_MainCatalogPart == null)
> return;
>
> WebPartsList m_WebPartsList = new WebPartsList();
>
> m_MainCatalogPart.WebPartsTemplate = m_WebPartsList;
>
>
>
> And "WebPartsList" class and its logic looks like the following:
>
>
>
>    public class WebPartsList : ITemplate
>    {
>        #region ITemplate Members
>
>        public void InstantiateIn(Control owner)
>        {
> // Add WebParts here, in a foreach or a for or any other applicable circle
>
> WebPart m_WebPart = new WebPart(); // You must set the correct type here
>
> m_WebPart.ID = "wp123";
> m_WebPart.Title = "Title";
> m_WebPart.Description = "Description";
>
> owner.Controls.Add(m_WebPart);
>        }
>
>        #endregion
>    }
>
> -- 
> All the best,
> Coskun SUNALI
> MVP ASP/ASP.NET
> http://sunali.com
> http://www.propeople.dk
>
> "rifat yavuz"  wrote in message 
> news:uknjzWe3IHA.5088@TK2MSFTNGP03.phx.gbl...
>> hello,
>> I am trying to create n controls, modify each controls' properties then 
>> add them to the catalog zone.
>>
>> Then the user will select and add each webpart to the approciate 
>> webpartzone.
>>
>> why n?
>> each control is a different report the user has generated before and each 
>> query of them is saved in the database.
>> the purpose of this is, when the user logs in, I will find the querries 
>> of the user, populate each report item (control) in the catalog zone,
>> then the user will be able to select what report she wants to see in her 
>> welcome page....
>>
>> need a lot help on this (referral, sample, advice.....)
>>
>> rifat
>>
>>
date: Thu, 10 Jul 2008 11:04:53 +0300   author:   rifat yavuz

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us