How to use Visual WebGui new ASP.NET integrated rapid wrapper capabilities
In this how to you will learn how to use the new Visual WebGui ASP.Net wrapper capabilities
Categories: Wrapped Controls, Knowledge Base
|
Tags: Architects, Developers, Wrapper, 1. Beginner, 2. Intermediate, 3. Advanced, Wrapping Controls, ASP.NET, v6.3, v6.4 and Later
Revision:
1
Posted:
11/Jan/2008
Updated:
11/Jan/2008
Status:
Publish
Types: Reference
|
In this how to you will learn how to use the new Visual WebGui ASP.Net wrapper capabilities. This ability opens a new way for a Visual WebGui programmer to develop richer and even more customizable applications than before. The wrapper allows you to use third party ASP.Net components or your own ASP.Net components in Visual WebGui as fully integrated controls just like the Visual WebGui out of the box controls. In our demo we will wrap Dundas charts and use them in a Visual WebGui application. First let's create a new Visual WebGui application:  Right click the solution and click "Enable Visual WebGui":  Add the necessary reference to Dundas assembles:  Right click the project and click "Add ASP.NET Wrapper" control:  From the ASP.NET wrapper wizard select the Dundas Chart control and give it a name "DundasChart":  After clicking the OK button you will get a new wrapper class generated: From the ASP.NET wrapper wizard select the Dundas Chart control and give it a name "DundasChart":  Because Dundas chart control renders images it needs a fixed size to relay on, otherwise you will get an error indicating that Dundas chart control does not support non pixel dimensions. To force the wrapper to pass absolute dimensions you need to override the IsFixedSize property in the DundasChart.cs fileas following:
protected override bool IsFixedSize
{
get
{
return true;
}
}
The current wrapper generator does not work out ambiguous properties well and that still is left to be hand fixed, until the next version release. After you compile the project you will get a list of warnings regarding ambiguous properties. Fix those warnings by changing the names of the properties / methods or simply mark out the conflicting code:  After you compile the project and you open the Form1.cs designer, you will get the new wrapper in the toolbox, like this:  Now you can drag the new wrapper control to the form which will put in a place holder like this:  The new wrapper allows you to initialize the control by using a reference to an ASCX file. Add a new WebUserControl1.ascx to the project  And in that ASCX you can add the control code and set his initialization. In this demo we will paste in the current code which will initialize the Dundas chart so we will be able to just insert data from code (This code is taken from a Dundas sample)
<%@ Control Language="C#"%>
<%@ Register TagPrefix="dcwc" Assembly="DundasWebChart" Namespace="Dundas.Charting.WebControl" %>
<dcwc:chart id="hosted_control_id" runat="server" Height="796px" Width="712px"
BackColor="#F3DFC1" Palette="GrayScale" backgradienttype="TopBottom"
borderlinewidth="0" borderlinecolor="181, 64, 1"
imageurl="~/TempImages/ChartPic_#SEQ(300,3)">
<legends>
<dcwc:legend LegendStyle="Row" AutoFitText="False" DockToChartArea="Default" Docking="Bottom" DockInsideChartArea="False" Name="Default" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold'></dcwc:legend>
</legends>
<chartareas>
<dcwc:chartarea Name="Default" BorderColor="64, 64, 64, 64" BackGradientEndColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientType="TopBottom">
<area3dstyle yangle="10" perspective="10" xangle="15" rightangleaxes="False" wallwidth="0" clustered="True"></area3dstyle>
<axisy linecolor="64, 64, 64, 64" labelsautofit="False">
<labelstyle font="Trebuchet MS, 8.25pt, style=Bold'></labelstyle>
<majorgrid linecolor="64, 64, 64, 64"></majorgrid>
</axisy>
<axisx linecolor="64, 64, 64, 64" labelsautofit="False">
<labelstyle font="Trebuchet MS, 8.25pt, style=Bold'></labelstyle>
<majorgrid linecolor="64, 64, 64, 64"></majorgrid>
</axisx>
</dcwc:chartarea>
</chartareas>
</dcwc:chart>
Now we can add a Visual WebGui button to the form and attach its click event to the following code (This code is taken from a Dundas sample)
string[] charts = { "Column", "Spline", "StepLine", "Spline" };
Random rnd = new Random();
private void button1_Click(object sender, EventArgs e)
{
// Add a series to the chart
Series series = myChart1.Series.Add("Series " (myChart1.Series.Count 1).ToString());
series.ChartArea = "Default";
series.ChartType = charts[myChart1.Series.Count - 1];
series.BorderWidth = 2;
int j = 0;
int MaxPoints = 10;
while (j < MaxPoints)
series.Points.Add(rnd.Next(5, 20));
myChart1.Update();
}
Open your web.config and add to it the Dundas http handler as following:
<add path="ChartAxd.axd" verb="*" type="Dundas.Charting.WebControl.ChartHttpHandler" validate="false"/>
Set Form1 to be the startup form using the right click as following:  Run the application and you will get the following screen:  After you click the button our code will refresh the chart and display the following view: After you click the button our code will refresh the chart and display the following view:  As you can see it is very simple to create a wrapper using the new ASP.NET wrapper feature. This is the first version (6.2.1) of Visual WebGui which has this capability and we intend to simplify the procedure even more. -- Eyal Albert @ Eyal.Albert (at) Gizmox.com
About the author
Related Articles
|
Wrapped Controls
|
|
|
Hello Everyone,
I've successfully wrapped the Crystal Reports Viewer for VisualWebGUI.
In addition to the wrapper, I demonstrate the use of 2 other approaches using a Server Control and an AspPageBox/AspPageBase.
I hope this helps you! Thank you -
Ryan D. Hatch
ryan [.] hatch [at] konect [com]
Tags:
Developers, Wrapper, 1. Beginner, 2. Intermediate, Wrapping Controls, Pre v6.3, v6.3, 3. Advanced
|
|
|
Hi Guys -
Here is the Crystal Reports Viewer for .NET 3.5. Some people requested this.
Enjoy!
Ryan
Tags:
Developers, Wrapper, 1. Beginner, 2. Intermediate, Wrapping Controls, Pre v6.3, v6.3, 3. Advanced
|
|
|
Tags:
Architects, Developers, Wrapper, 2. Intermediate, 3. Advanced, Wrapping Controls, ASP.NET, v6.3, v6.4 and Later
|
|
|
This code snippet will demonstrate how to use the new VWG wrapping capabilities with Dundas charts.
Tags:
Architects, Developers, Wrapper, 2. Intermediate, 3. Advanced, Wrapping Controls, ASP.NET, v6.3, v6.4 and Later
|
|
|
Large organizations that make use of SQL server may well also use Reporting Services to create a corporate reporting solution that is accessible across the corporate LAN / WAN.
This article shows how to access such a server using the report viewer control.
Tags:
Architects, Developers, Wrapper, C#, 2. Intermediate, 3. Advanced, Wrapping Controls, v6.3, v6.4 and Later
|
|
|
Tags:
Architects, Developers, Wrapper, 2. Intermediate, 3. Advanced, Wrapping Controls, ASP.NET, v6.3, v6.4 and Later
|
|
|
|