Crystal Solutions for printing reports in a Web environment

Source: Internet
Author: User
Tags dsn odbc access database
<%@ language= "VBSCRIPT"%>
<%
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
' Generate reports directly from the ADO recordset
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
'
Concept
'
' This application is designed to demonstrate how to generate reports from the ADO recordset. We first set up the ADO connection and
' Recordset object, and then generate a recordset from the database with an SQL statement. And then we build a crystal
' Reports object and point this object to the ADO recordset. Finally we will crystal Reports
' Smart Viewer is sent to the client to display this report.
' First step: Create the ADO Connection and Recordset
' An ADO database connection is accessed via an existing ODBC data source (DSN) from an application like ASP
' The connection of the data. To achieve the purpose of this example, we will use a Xtreme named "Sample Data"
' Connect to Access database Xtreme.mdb System DSN
' Create an ADO database connection:
Set oconn = Server.CreateObject ("ADODB. Connection ")
' Here we have an ADO connection called "oconn," which we'll connect to the above DSN with this ADO Connection object
' Use ADO connection must first open it:
oConn.Open ("Xtreme Sample Database")
' Here opens our ODBC data source, which points to an Access database Xtreme.mdb
' Now we have to create a Recordset object:
Set session ("ORs") = Server.CreateObject ("ADODB"). Recordset ")
' On top we set up a session ("ORs"). A Recordset object is stored in this session
' will contain the data returned with the SQL statement
' Define and generate a recordset:
Session ("ORs"). ActiveConnection = oconn
' Define the Connection object that this recordset will use
Session ("ORs"). Open SELECT [Product ID], [Product Name] from product
' Use SQL statements to remove two fields from the ' Product ' table in the Xtreme.mdb library
'===================================================================================
' Establish crystal Reports object
'===================================================================================
' You may notice that the Crystal reports object is set to session, because the requirement is called

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.