Home > Articles > Data > SQL Server

  • Print
  • + Share This
This chapter is from the book

The Report Server

After you've used the Report Designer to design and build a report definition or report project (which might contain any number of report definitions, shared Data Sources, and resources such as graphic files), you deploy it by sending its RDL (or RDS if a shared Data Source, or the resource file if a graphic) to the ASP.NET-based Report Server. Before attempting to deploy a report, it's crucial to configure two properties on each report project in Visual Studio .NET 2003: the target URL of the Report Server, and the notional folder to which you wish to deploy. You'll also want to reference an appropriate StartItem report, as shown in Figure 1.15.

01fig15.jpgFigure 1.15 The Project Properties Page—Ready for Deployment

To deploy a project or a single report within a project, right-click the project or report name and choose Deploy. Once a report definition is complete and deployed to the Report Server, it becomes a managed report.

The Report Server exposes Reporting Services' SOAP endpoint, and Visual Studio .NET deploys the report and shared Data Sources and resource files by simply making calls to SOAP methods. All these report definitions, shared Data Sources, and resource files are organized in the Report Server in a logical folder hierarchy, over which is an extensive role-based security system integrated with Computer/Domain Users and Groups.

I say "XML-like" because although some of these files look like XML, if you try to put in XML comments—for example, <!--A Comment-->— this can choke SQL Server, and the exception messages can be pretty cryptic. We'll discuss these configuration files later in this chapter.

Peter

If you're developing your own tools or being paid by the hour and you want to build your own .NET application to deploy reports, you can call the SOAP interface from your own programs. We'll show you how in Chapter 9¾.

The Report Server uses a SQL Server 2000 database to retain almost all of its metadata. In fact, the only modifiable metadata retained outside SQL Server are any custom assemblies and supporting files you may have written that the report references, along with a handful of XML-like configuration files for the web and Windows services and security policies.

SQL Server and SOAP

Although Reporting Services uses SQL Server as its own data store and you can get at the Reporting Services' own tables and stored procedures, we should warn you that the only officially supported interface is SOAP. The reason is that as the product progresses, Microsoft might (is likely to) change/tune/alter/repair/enhance/refine the underlying schema of the Reporting Services database and the definitions of the stored procedures. Microsoft has confirmed that the SOAP interfaces will be backwardly supported but says that the use of SQL Server by Reporting Services for its data store is a (publicly undocumented) implementation detail subject to change. So if you feel inclined to fiddle directly within the Reporting Services ReportServer database with T-SQL, be warned that a next version or Service Pack could (and probably will) break your code. This is a little frustrating because calling out to a SOAP interface from T-SQL in SQL Server 2000 is not as trivial as it will be in the next version of SQL Server (SQL Server 2005).

Rendering Extensions

In addition to SOAP-type HTTP and HTTPS calls, the Report Server's ASP.NET web server component dutifully responds to specially formatted URL Request Strings by streaming requested reports over HTTP or HTTPS in an amazing number of rendering formats. The rendering formats that a Report Server can generate are governed by the Rendering extension assemblies installed and registered on the system. Out of the box there are six Rendering extensions: HTML (3.2, 4.0, MHTML), XML, CSV, IMAGE (BMP, EMF, GIF, JPEG, PNG, TIFF), EXCEL, and PDF.[14]

Stop and think for a moment about where we are. At this point, we have the ability to design and render a report in a variety of formats, which can target a number of potential platforms and devices. We should also emphasize that there is no additional separate license fee to pay to Adobe for the PDF report generation, and there is a way to extract an HTML table fragment stream, which you can incorporate directly into one of your own web pages without having to use an IFrame control. [15]

But as if that were not enough, in true TV shopping style—"Wait! There's more!"—you also get the ability to create and register any of your own custom Rendering extensions. So, for example, if you have a commercial requirement that your reports be rendered on Wireless Application Protocol (WAP)-enabled phones, you can write a .NET Rendering extension assembly for Reporting Services to do so. But be warned—developing Rendering extensions is hard, at least in our opinion. Configuring the Report Server to use a new Rendering extension is as simple as placing your custom rendering assembly in the right folder and delicately editing a few XML configuration files. We suggest you investigate the existing Rendering extensions, such as using Extensible Stylesheet Language Transformations (XSLT) with an XML-rendered report. This might satisfy your requirements without the need to write a new extension.

Does anyone still have a WAP phone? Do yourself a favor and get a Smartphone or PocketPC phone. I was one of the first to use WAP technology and blew a load of dough writing WML servers and translators. Thanks, Nokia, for nothing!

Peter

Delivery Extensions

So far we've talked about being able to extract a rendered report stream in response to a specially formatted URL, but the Report Server need not always be shy and passive. Reporting Services does have the ability to break out of its box and start spamming preconfigured and presumably consenting recipients over SMTP [16] at preset scheduled times or only when the data changes.

And if benevolent spam is not enough, the Report Server can even proactively save rendered reports onto a UNC [17] file share on a certain schedule or when data changes. Yes, it even takes care of any credentials it might need to use to access that share, and it can set access credentials on the saved file to restrict access to a certain computer or domain user or group. It can also be configured to overwrite any previous file or to incrementally number files so as not to overwrite any previous file.

Both delivery features are provided through what are called Delivery extensions, and yes, you can write your own .NET Delivery extension assembly to proactively deliver reports elsewhere. For example, you can send to an FTP [18] service, post it using NNTP [19] to a newsgroup, or dispatch an SMS message to a WAP-enabled phone, with the embedded link pointing to where you use your WAP Rendering extension. The extensible delivery possibilities are endless, and they are, for the most part, much easier to develop than Rendering extension assemblies.

What About Printing Delivery Extensions?

We have, however, discovered a small fly in the ointment. In the initial release version there isn't an out-of-the-box Delivery extension to send reports directly to a printer. Thankfully, the Microsoft development team has not left us completely high and dry; they provide project code samples in C# and Visual Basic .NET that show how to make a Delivery extension that targets a printer.

If you stop to think for a moment about how many printers there are in the world and how many different printer drivers there are to take advantage of the plethora of hardware-specific configurable options—such as duplex printing, paper size selection, input and output trays, color printing, margin settings, collation, stapling, binding, faxing, scaling, even the number of copies that should be printed—it would have been a mammoth undertaking for the development team to have created a generic printer Delivery extension that would cater to every possible option, and time constraints pushed this part of the development out to the next version. Our guess is that printer manufacturers and third-party ISVs [20] will write their own printer Delivery extensions that take advantage of their hardware's features to make them fully available to Reporting Services. The Delivery extension sample provided by the Reporting Services developers works by rendering the report as an image and sending that to the printer. This is certainly not the most efficient way to solve the problem—being more "crude but effective," as Seven of Nine might say. [21] All of this said, we are working on a server-side printing extension that can be called directly from the Report Manager when viewing a report, so be sure to check our website www.SQLReportingServices.NET for news.

The SQL Server Agent and ReportingServicesService.exe Windows Service

The Report Server is not alone when it comes to its ability to push report content through Delivery extensions. It's aided and abetted by two friends: the SQL Server Agent and another Windows system service that you'll see in your task manager as the tautological ReportingServicesService.exe, which is a .NET Windows system service. These provide an infrastructure that enables possible load balancing in a web farm environment when you're pushing scheduled content out via Delivery extensions. (For more on web farms, see Chapter 2.)

While the SQL Server Agent creates entries in the ReportServer database's Event table at scheduled times, it's the ReportingServicesService.exe Windows system service that polls the database every 10 seconds to see if there are any entries in this table and takes appropriate action. Chapter 2 tells you how you can configure the polling interval.

The Report Processor

The Report Processor is the thoroughbred workhorse [22] of the Reporting Services team (see Figure 1.16). It's only used to process managed (deployed) reports. It's responsible for querying data, assembling the report into the Intermediate Format (IF) Binary Large Object (BLOB), and extruding the report to the client. This is where the various extensions come into play. For example, a Data Processing extension is used during report processing to query the report's Data Sources. Data and layout are combined by the Report Processor and saved to the database in the IF. Only at this stage does the Rendering extension come into play. The benefit of this approach is that all the querying and processing work is done once, after which different renderers can be called—all of which can work from the same IF BLOB. This Intermediate Format can be persisted behind the scenes in the ReportServer database to enable reports to be rendered from cached versions, historic versions, or Snapshots. The fundamental difference between immediate in-demand, cached Snapshots and history is simply where and how long a generated report is stored and managed. (You'll learn more about report history and Snapshots shortly.) The key to the Intermediate Format is that all the heavy lifting is done once, and that it's device (renderer) independent.

01fig16.jpgFigure 1.16 The Report Processor

Caching Intermediate Format

To obtain some performance gains and scalability, the Report Server can cache the generated report IF in a SQL table within the Report Server database—assuming that the credentials used in the report's Data Sources are not derived from Windows Authentication security (SSPI) or by prompting the user. If caching is enabled on a managed report, the report can be delivered much more quickly after it has been requested the first time because the Report Server doesn't have to query all the Data Sources again; it need only render the IF into the requested stream type. Reports can be cached for a configurable number of integer minutes to a maximum of 2,147,483,647—approximately 4,083 years, by which stage we doubt you'll still be bothered (assuming your system stays up that long). For a higher degree of control, the cache can be expired on a report-specific schedule or on a schedule shared with other objects.

For parameterized cache-enabled reports, the Report Server creates IF images and caches the report each time it's requested by means of parameter values that have not already been used, compiled, and cached. In other words, the cache is uniquely indexed on a report and on the parameter values with which it was executed. Reports remain in the cache until they expire or are explicitly flushed from the cache.

Caching Snapshots

The first time a report is executed, it can take a very long time, especially if a lot of number crunching is required in the report's queries or if you asked for all 50,000 customers. Microsoft has provided an alternative to deal with this contingency: the ability to populate the cache with an Intermediate Format Snapshot from a report executed at a scheduled time. Again, the schedule can be specific to a report or can be shared with other objects and must use hard-coded credentials. This approach is designed to support preparation of reports in off-peak hours.

Caching History

The Report Server can maintain a historic archive of Intermediate Format report Snapshots that can be repeatedly rendered at any time in the future—assuming that the system is still up when it's time to render the report. This history can be unlimited—or, more accurately, limited—by what SQL Server can provide in storage space. The Report Server can generate Snapshot reports on shared schedules or on a report-specific schedule.

The Report Execution Timeout Governor

Preparing the Intermediate Format for reports can take considerable time, especially if there is a lot of data to collect or if complex processing is required. Fortunately, the Report Server provides the option to time out the execution of a report and cancels it with a polite [23] message to the user. This Report Execution Timeout setting is set in seconds, and there is a default for the whole Report Server; this default can be overridden on a report-by-report basis.

The default timeout is close to 60 seconds. The Report Server evaluates running jobs at 60-second intervals. Every 60 seconds, the server compares actual process time against the report execution timeout value. If the processing time for a report exceeds the report execution timeout value, report processing stops. If you specify a timeout value that is less than 60 seconds, the report may execute in full if processing starts and ends during the quiet part of the cycle when the Report Server is not evaluating running jobs. For example, if you set a timeout value of 10 seconds for a report that takes 20 seconds to run, the report will process in full if report execution starts early in the 60-second cycle. You can set the RunningRequestsDbCycle setting in the RSReportServer.config file to change how often running jobs are evaluated.

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020