URL ACCESS IN ACTION in Visual Basic .NET

Maker ECC200 in Visual Basic .NET URL ACCESS IN ACTION

URL ACCESS IN ACTION
Encode Data Matrix ECC200 In Visual Basic .NET
Using Barcode generator for .NET framework Control to generate, create Data Matrix ECC200 image in .NET framework applications.
www.OnBarcode.com
Recognizing Data Matrix ECC200 In Visual Basic .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
To demonstrate how both a WinForm-based report consumer and a Web-based report consumer can leverage the URL access option to request reports, let s look at a couple of sample applications from the source code available with this book.
Paint Matrix 2D Barcode In Visual Basic .NET
Using Barcode drawer for .NET Control to generate, create Matrix image in VS .NET applications.
www.OnBarcode.com
Make Barcode In VB.NET
Using Barcode maker for Visual Studio .NET Control to generate, create Barcode image in VS .NET applications.
www.OnBarcode.com
ON-DEMAND REPORT DELIVERY
PDF-417 2d Barcode Generation In VB.NET
Using Barcode creator for Visual Studio .NET Control to generate, create PDF 417 image in .NET applications.
www.OnBarcode.com
Draw Barcode In Visual Basic .NET
Using Barcode generator for Visual Studio .NET Control to generate, create Barcode image in .NET framework applications.
www.OnBarcode.com
URL Access with WinForms: AccessOptions The code sample for this section can be launched from the chapter 10 menu in the AWReporterWin project. This one-form sample application actually uses both access options (URL and SOAP), but for the purposes of our discussion in this section, we describe only the URL access option. We cover the SOAP access methods that this sample code uses later in section 10.5. This code sample demonstrates two possible implementation approaches to integrate a WinForm-based report consumer with Reporting Services by URL: Using the Microsoft WebBrowser ActiveX control Shelling out to the browser We kept the code simple on purpose. For now, the design goals for the AccessOptions application are to show you the minimum steps needed to access reports using the URL access option. Figure 10.4 shows the AccessOptions form. To run a report by URL, the user has to specify the Report Server URL, the report path, and the export format. In the case of parameterized reports, the user must also enter all parameters (name and value) in the Parameters grid, that do not have default values specified.
Generating EAN128 In VB.NET
Using Barcode encoder for .NET Control to generate, create USS-128 image in .NET applications.
www.OnBarcode.com
Paint MSI Plessey In Visual Basic .NET
Using Barcode printer for VS .NET Control to generate, create MSI Plessey image in .NET applications.
www.OnBarcode.com
Figure 10.4 The AccessOptions application demonstrates how a WinForm application can request reports via URL or the RS Web service (SOAP).
Data Matrix 2d Barcode Creator In None
Using Barcode printer for Online Control to generate, create Data Matrix 2d barcode image in Online applications.
www.OnBarcode.com
Create Data Matrix 2d Barcode In Objective-C
Using Barcode generation for iPhone Control to generate, create ECC200 image in iPhone applications.
www.OnBarcode.com
URL ACCESS IN ACTION
Drawing Code 3 Of 9 In None
Using Barcode drawer for Online Control to generate, create Code 39 Full ASCII image in Online applications.
www.OnBarcode.com
Recognizing Barcode In .NET Framework
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
Let s first see how this code sample integrates with the Report Server by URL. Then in section 10.5 you ll learn how to do this by using the RS Web service. Using the Microsoft WebBrowser ActiveX control To request reports by URL, a WinForm application can leverage the Microsoft Web Browser ActiveX control to embed the report inside a form. One possibility where embedding the report can be useful is when your requirements call for implementing a Report Search form. Once the user selects a report, you may want to display the report inside the search form instead of navigating to a new form. If you haven t used the Microsoft WebBrowser control in the past, you will be happy to find that it allows you to add browsing, document viewing, and data downloading capabilities to your applications. Because the WebBrowser control is COMbased, this approach is also suitable for classic Windows-based applications, for example, Visual Basic 6 clients. The WebBrowser control is found in the Common Controls section of the Windows Application Project toolbox in Visual Studio 2005. If you need more information about this control, check the Resources section at the end of this book. Loading the export formats When the AccessOptions form is loaded, the Format drop-down is populated with the rendering formats that the Report Server supports. Rather than hardcoding the drop-down items, the AccessOptions application calls the ListExtensions method of the RS Web service. Although the method call incurs a performance hit, the advantage of not hardcoding the list is flexibility, because you don t have to redistribute the application if new rendering extensions have been added. Listing 10.1 shows how the LoadFormats function calls ListExtensions.
UCC - 12 Creation In Java
Using Barcode creation for Java Control to generate, create EAN / UCC - 13 image in Java applications.
www.OnBarcode.com
GTIN - 13 Encoder In None
Using Barcode creator for Software Control to generate, create EAN-13 Supplement 5 image in Software applications.
www.OnBarcode.com
Listing 10.1 Using the ListExtensions SOAP API to populate the drop-down list with export formats
Print Code39 In C#.NET
Using Barcode encoder for VS .NET Control to generate, create ANSI/AIM Code 39 image in Visual Studio .NET applications.
www.OnBarcode.com
Paint Barcode In None
Using Barcode printer for Online Control to generate, create Barcode image in Online applications.
www.OnBarcode.com
private void LoadFormats() { Calls the ReportingService2005 rs = RsHelpers.Proxy; ListExtensions API Extension[] extensions = null; extensions = rs.ListExtensions(ExtensionTypeEnum.Render); foreach (Extension extension in extensions) { if (extension.Name.ToLower()!="null") cmbFormat.Items.Add(extension.Name); } cmbFormat.SelectedText = "HTML4.0"; }
Create UPC-A In Java
Using Barcode printer for Java Control to generate, create UPC Symbol image in Java applications.
www.OnBarcode.com
ANSI/AIM Code 39 Generation In None
Using Barcode encoder for Font Control to generate, create Code 39 Full ASCII image in Font applications.
www.OnBarcode.com
Loads the export formats in the drop-down Skips the NULL rendering extension
UPC Code Drawer In Java
Using Barcode maker for Android Control to generate, create UPC Symbol image in Android applications.
www.OnBarcode.com
Code39 Drawer In Java
Using Barcode generation for Eclipse BIRT Control to generate, create Code 3/9 image in Eclipse BIRT applications.
www.OnBarcode.com
ON-DEMAND REPORT DELIVERY
Because this method is executed when the form loads, be sure to update the Report Server URL, which defaults to localhost, before running the sample. The ListExtension method returns an array of all supported rendering extensions as specified in the RSReportServer.config file. Each rendering extension is exposed as of type Extension. Note that the code specifically ignores the NULL rendering extension b. This extension is not a rendering extension per se because it doesn t render reports in any specific format. Instead, it is useful for prepopulating the report session cache for subscribed report delivery, as we explain in more detail in chapter 12. Because this is a dummy extension and cannot be used for report rendering, we skip it. For the sake of simplicity, we don t retrieve the list of report parameters from the RS Web service, nor do we validate the parameters in any way. For the purposes of this example, the user is responsible for setting up the parameters correctly. To show the parameters in the grid, we use a typed dataset, EntityParameter, which we bind to the grid. Requesting the report Once the user has filled in the report parameters (if any), we are ready to request the report by calling the RunByURL function, whose abbreviated code is shown in listing 10.2.
Listing 10.2 The Microsoft WebBrowser control, which WinForm clients can use to place the report inside a form
private void RunByURL() Constructs the { report URL StringBuilder urlBuilder = new StringBuilder(); urlBuilder.Append(txtServer.Text); urlBuilder.Append (" "); Appends the report urlBuilder.Append (txtReportPath.Text); parameters EntityParameter.ParametersDataTable table = EntityParameter.ParametersDataTable)grdParams.DataSource; foreach (EntityParameter.ParametersRow row in table.Rows){ urlBuilder.Append (String.Format("&{0}={1}", row.Name, row.Value)); } urlBuilder.Append (@"&rs:Format=" + cmbFormat.Text); urlBuilder.Append (@"&rs:Command=Render"); ReportBrowser reportBrowser = new ReportBrowser(); reportBrowser.RenderReport(urlBuilder.ToString()); reportBrowser.Show(); }
Copyright © OnBarcode.com . All rights reserved.