CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge -> Tips & Solutions

 Part3: XML, AJAX, Office Web Components (OWC) tips and tricks

Print topic Send  topic

Author Message

Posts: 110
Posted: 02/05/2007, 10:40 AM

In part three we will work on the “customer_list” page we created in part 1.

1) Open “customer_list” page and delete the auto generated form, you should now have only the Header and Footer.
2) Using “Forms” tab in the toolbox (upper right hand corner), place a label between the header and footer. Set the following properties on the link
a. Name = LinkToDataIsland
b. Data Type = Text
c. Content = Text
3) Select the customer_list page in the project and add “Before Show” server side event for the page. Place the following code in the event
LinkToDataIsland.Value= “dataislandXML.asp”

dataislandXML is the file we created in part 2 of this tutorial. Down the line, we will extended this server side event to add search capabilities to our data island.

4) Switch to the HTML view and add the following markup
<table width="100%" border="1">
<object id="pivot" width="100%" classid="clsid:0002E552-0000-0000-C000-000000000046">
<param name="AutoFit" value="False">
<object id="chart" width="100%" classid="clsid:0002E556-0000-0000-C000-000000000046">

This markup creates a table with two columns with OWC Pivot table on the left and a chart component on the right.

5) Add the “Page Load” Client side event to configure the OWC components on this page. We will be using javascript to configure the controls.
Add the following code to the Page Load event

======= CODE =====
pivot.ConnectionString = "Provider=MSPersist.1"; pivot.CommandText = "{LinkToDataIsland}"; //pivot.DisplayFieldList = true; var v = pivot.ActiveView; var c = pivot.Constants; v.RowAxis.InsertFieldSet(v.FieldSets("Customer")); v.DataAxis.InsertFieldSet(v.FieldSets("Product")); v.FilterAxis.InsertFieldSet(v.FieldSets("Quantity")); v.FilterAxis.InsertFieldSet(v.FieldSets("Unit Price")); v.ColumnAxis.InsertFieldSet(v.FieldSets("Order Date By Month")); var cf = v.ColumnAxis.FieldSets(0).Fields; cf("Years").IsIncluded = true; cf("Quarters").IsIncluded = false; cf("Months").IsIncluded = false; cf("Days").IsIncluded = false; cf("Hours").IsIncluded = false; cf("Minutes").IsIncluded = false; cf("Seconds").IsIncluded = false; var t1 = v.AddTotal("Total Sales", v.FieldSets("Quantity").Fields("Quantity"), c.plFunctionSum) v.DataAxis.InsertTotal(t1) pivot.ActiveData.HideDetails(); // Format Sheet v.TitleBar.Caption = "Business Intelligence" v.Label.BackColor = 0xDA8100 v.Label.Font.Name= "Verdana" v.Label.Font.Size = 8 // Format chart chart.DataSource = pivot; chart.HasSeriesByRows = true; chart.AllowPropertyToolbox = true; chart.DisplayToolbar = true; chart.Charts(0).HasLegend = true; //chart.ChartWrapCount = 5; //chart.ChartLayout = c.chChartLayoutHorizontal; chart.ChartLayout = c.chChartLayoutVertical; chart.Charts(0).Type = c.chChartTypeColumnStacked3D; chart.Charts(0).ProjectionMode = c.chProjectionModeOrthographic chart.Interior.SetOneColorGradient(c.chGradientDiagonalDown, c.chGradientVariantCenter, 0.8, "Gainsboro");

=====END CODE ===

Save the file, and publish the project. After the login prompt, you should see the pivot table and graph populated with the XML data from our secure island.

Note: If someone wants to put this demo on a public server send me a PM and I will send you the project files.

In the next part, we will add search capability to our dataisland using CCS search builder so we can filter retrieved XML.
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by  and YesSoftware, Inc.