Glossary Item Box
The ActiveX Viewer Control allows you to view and print report output in a web browser.
This walkthrough is split up into the following activities:
To complete the walkthrough, you must have access to the NorthWind database (NWind.mdb). You must also have access to Internet Information Services either from your computer or from the server.
Note: Before performing this walkthrough, you must first run "Configure Web Sample" (Start menu > All Programs > Data Dynamics > ActiveReports for .NET 2.0 > Samples > VB or CSharp) or manually configure Internet Information Services.
When you have completed this walkthrough, you will have a report that looks similar to the following.
Important: If you are using Visual Studio.NET 2005, please see the Visual Studio.NET 2005 Web Changes topic.
To add an ActiveReport to your project
To connect the report to a data source
To add controls to the report
| Control | Name | Text/Caption | Location |
|---|---|---|---|
| Label | lblProductName | Product Name | 0, 0 |
| Label | lblUnitsInStock | Units in Stock | 2, 0 |
| Label | lblUnitsOnOrder | Units on Order | 3, 0 |
| Label | lblUnitPrice | Unit Price | 4, 0 |
| Control | DataField | Name | Text/Caption | Location | Output Format |
|---|---|---|---|---|---|
| TextBox | ProductName | txtProductName | Product Name | 0, 0 | (Empty string) |
| TextBox | UnitsInStock | txtUnitsInStock | Units in Stock | 2, 0 | (Empty string) |
| TextBox | UnitsOnOrder | txtUnitsOnOrder | Units on Order | 3, 0 | (Empty string) |
| TextBox | UnitPrice | txtUnitPrice | Unit Price | 4, 0 | Currency |
To add the ActiveX .cab file
To add a folder to the project

To add Object tags to the Web Form
<OBJECT id="arv" codeBase="arview2.cab" height="100%" width="100%" classid="clsid:8569D715-FF88-44BA-8D1D-AD3E59543DDE" VIEWASTEXT> <PARAM NAME="_ExtentX" VALUE="11218"> <PARAM NAME="_ExtentY" VALUE="7329"></OBJECT>
To add code to the window_onload event
var arv = document.getElementById("arv");
arv.datapath = "ReportOutput/axreport.rdf";To write the code in Visual Basic
To write the code in C#
The following example shows what the code for the method looks like.
' Visual Basic
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
MyBase.Load
Dim rpt As New rptActiveX()
rpt.Run()
rpt.Document.Save(Server.MapPath("") + "\ReportOutput\axreport.rdf", _
DataDynamics.ActiveReports.Document.RdfFormat.AR20)
End Sub//C#
private void Page_Load(object sender, System.EventArgs e)
{
rptActiveX rpt = new rptActiveX();
rpt.Run();
rpt.Document.Save(Server.MapPath("") + "\\ReportOutput\\axreport.rdf",
DataDynamics.ActiveReports.Document.RdfFormat.AR20);
}
Also in design view, resize arv to
| See Also |
ASP.NET Web Sample | Samples | Walkthroughs | ActiveX Viewer Control
Tasks: Visual Studio.NET 2005 Web Changes
Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.