Blue Theme Orange Theme Green Theme Red Theme
 
Ads by Lake Quincy Media
Home | Forums | Videos | Photos | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » ASP.NET & Web Forms » Crystal and Reporting Services Interview Questions - Part 1

Crystal and Reporting Services Interview Questions - Part 1

This Interview Questions will give you a quick start for two report giant’s crystal and reporting services.

Author Rank:
Total page views :  5998
Total downloads : 
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Become a Sponsor


Introduction

This Interview Questions will give you a quick start for two report giant's crystal and reporting services.  

How do we access crystal reports in .NET?

Crystal reports comes with Visual studio setup itself. Right click the solution explorer a add new item and you can see a crystal report template as shown in figure "Crystal report template". You can add an ".rpt" file using this template.

1.jpg 

Figure 1:- Crystal report template

What are the various components in crystal reports?

There are four major components in crystal reports Report designer, Reports engine, Report viewer and object models.

Report designer gives a graphical interface to create and modify reports. To view the designer add a new crystal report file and double click on it you should see the report designer as shown in figure "Report designer".

2.jpg

Figure 2 :- Report designer

Reports engine does the formatting and conversion part of crystal reports. It helps convert the contents of reports in word, excel, PDF, HTML and other formats. Report viewers are controls which you can see on the visual studio tool box; you can drag and drop those controls on an ASPX page or windows application to view reports made using crystal. Object models help us manage crystal reports objects during design time and run time.

What basic steps are needed to display a simple report in crystal?

To understand this sample let display a simple report using crystal.

Step1:- Create a web application project.

Step2:- Add new item and select crystal report from the template. This adds a new RPT file in your solution explorer.

Step3 :- Double click on the RPT file click on Crystal reports a Field explorer as shown in figure below. You should see the field explorer toolbar.
 

3.jpg

Figure 3:- Field explorer toolbar

Step 4 a Right click on "Database fields" on the field explorer a then click on database expert a Expand create new connection a Expand OLE DB ADO a Select Microsoft OLEDB provider for SQL Server ( this depends on what kind of data you want to connect ) a Give the server credentials a Click finish and done.

Step5 a Right click on "Database fields" on the field explorer a then click on database expert a Expand the server , database and select table which you want to add to the report. Below figure "Table added in reports" shows the right pane showing the table added using database expert.

4.jpg

Figure 4 :- Table added in reports

Step 6 a Expand database fields a table ( in this case it is "FactCurrencyRate" table). Now you can drag and drop the fields on the report.

5.jpg

Figure 5 : - Drag fields on the report

Step 7 a We now need to display the report on the ASPX page. For that we need the ‘CrystalReportViewer’ control. So expand the crystal reports section of the toolbar and drag the component on the ASPX page

6.jpg

Figure 6 : - "Crystalreportviewer" control

Step 8:- Now we need to go to code behind and specify the report source. That's it now compile and run the project you can see your report live in action.

7.jpg

Figure 7 : - Specify the crystal report source

Can crystal reports be published as a web service?

Right click on the "RPT" file and click "Publish as web service" as shown in figure "Publish crystal as web service".

8.jpg

Figure 8 : - Publish Crystal as web service

How do we invoke the crystal report web service?

We can consume the web service as a normal web service in .NET. The easiest way is by using the "ReportViewerControl" and specifying the ASMX URL in the report source property.

How do we add formulas using crystal reports?

To add any formula in crystal report is a three step procedure. Below figure "Add formula in crystal report" shows the three steps in a pictorial format. Step 1 a Go to field explorer and right click and click new formula. Step 2 a Give and name to the formulae and click on "Use Editor". Step 3 a You will be presented with UI which has all the formulas and function.

9.jpg

Figure 9 : - Add formula in crystal report

How do we pass parameters to crystal reports?
 
Some times we want to accept input parameter and the report works according to the parameter. To add a input parameter go to field explorer , go to parameter fields , right click , create parameter and you should be popped with a dialog box as shown in the figure "Parameter field". Give a name to the parameter , type and that's it you are in action.

10.jpg

Figure 10 :- Parameter fields

How do we export from crystal reports?

There are two way of using the export option one is when we display a report using crystal report viewer you can see a export icon as shown in figure "Export" below. You can the select in which format you want to export.

12.jpg
Figure 11 : - Export

Second option is through coding. Below is a simple code snippet which shows how we can export a report. Create a object of the crystal report and call the "ExportToDisk" method specifying in which format you want to export.

Dim Report as New CrystalReport1
Report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows,"c:\my.doc")

How do we print to printer using crystal?

In print we have two ways by which we can print one is when you display the report using crystal report viewer you have a print option and second is by code. Below is a simple code snippet which shows how we have created a object called as report from the rpt file , specified the printer name , paper size and then called the "PrintToPrinter" method.

Report.PrintOptions.PrinterName = "MyPrinter"
Report.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4
Report.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape
Report.PrintToPrinter(1, True, 1, 3)

How do we generate cross tab reports?

When we go for creating a new report you can see the cross tab option.

12.jpg

Figure 12 : - Cross tab reports

How can we do grouping in crystal?

For grouping in crystal you need to use the group expert wizard.

Can you explain three-pass reporting which crystal report uses?

Crystal report uses the three pass method for parsing reports. Before we understand what does it means lets define what is a pass ?. Pass is a process used by crystal reports to read and manipulate data as per the report format. Below figure "Three pass method" shows how the parsing happens. Let's understand the same step by step. In Pre-Pass1 crystal report engine evaluates constants like x=1 and pie=3.14 for a report. Pass 1 does two important things get data from the database and sort records with given conditions. Once this is done it's saved in memory and given to pre-pass2 for further parsing and manipulation. Pre-pass2 is all about grouping and sorting the records according to conditions specified in the crystal report. Pass 2 formats a report, applies condition and groups them. Pass 3 is the final tunnel it just counts the pages and generates reports.

13.jpg
Figure 13 :- Three pass method

Can you explain reporting services architecture?

Reporting services is mainly used to generate reports. Below are the main components of reporting services as shown in figure "Reporting Services Architecture". Reporting services has four major components Client, Web services, report server/manager and reporting services database. Let's understand all the major components and the sub components of the same.

14.jpg

Figure 14 : - Reporting Services Architecture

Client: - These are the consumers of reporting services functionality. It can be the report manager or report server (we will discuss report server and manager in more details further) or ASPX and windows application.

Reporting Web service: - Microsoft chose XML to expose the functionality of reporting services. So all the functionality is exposed through web services. One of the most important gains for a web service is that it can be platform independent.

Report server / manager: - Report server and manager forms the core engine of reporting services. They two important systems one is "Report processor" and the other is

"Scheduling and Delivery processor".
Reporting processor is the main driver to deliver reports. They take request from the end user and process the report and send it to the end client. Figure "Report Processor" shows how the flow moves. We have seven basic steps which can help us understand in more detail how the report processor works. Step 1 a Any client like ASPX or windows application will request to the web service for reports. Step 2 and 3 a Web service will forward the request to the report processor and get the report definition from the report server DB. Step 4 a Reporting services uses the security extensions to authenticate the end user. Step 5 a Data processing extension calls queries the application database to get data. With data processing extension we can connect to standard data sources like SQL Server, ODBC, Oracle etc. You can also extend the data processing extension to adapt it to some custom data processing extension. Step 6 a Rendering extension then renders the report applies format and sends the same to the end client. Using rendering extension you can deliver reports in Excel, PDF, HTML, CSV and XML. You can also extend the rendering extension to deliver in custom formats.

15.jpg
Figure 15 : - Report Processor

The second system is "Scheduling and Delivery processor". Delivery extensions makes reports with the specified format and sends the same to an output target like file, email, FTP etc. Scheduling and delivery processor does two important steps schedules reports and delivers them the same to a output like FTP,Email etc. Schedule and delivery processor using delivery extension to deliver reports to the defined output. So users can subscribe to the reports and depending on these subscriptions the delivery is done by schedule and delivery processor. There are two steps in this one is the subscription process and the other is deliver process. Lets first try to understand the subscription process. There are three steps basically:-

Step 1 a First is the requests a subscription to the report.

Step 2a This subscription is then stored in the report server DB.

Step 3 a A new SQL Server agent is created for this subscription. So we have completed the subscription process.

16.jpg

Figure 16 : - Subscription process

Now that the subscription is created lets see how the delivery process works. Here are five basic steps in delivery process. Step 1 a When the event occurs SQL Server agent makes an entry in the report server DB. Step 2 and 3 a RS windows service keeps polling SQL Server for any events. If a event has occurred it gets the event from the database and sends a message to the "Scheduling and Delivery Processor". Step 4 a The report is then processed by the report processor and sent to the delivery extension who finally delivers it on a output which can be a email address, folder, FTP or any other kind of output.

17.jpg 

Figure 17 : - Delivery process

Reporting Services Database:- When you install reporting services you will see two databases "ReportServer" and "ReportServerTempDB"."ReportServer" database contains report definitions, schedule, subscriptions, security details and snapshots. "ReportServerTempDB" stores temporary information like session state about reports which is needed in between HTTP requests and report cache information. Please note snapshots are stored in reportserver and not in tempDB.

18.jpg

Figure 18 :- Databases of reporting services


Login to add your contents and source code to this article
 About the author
 
Shivprasad
I am currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. You can visit about my organization at www.questpond.com and also enjoy the videos uploaded for Design patter, FPA , UML , Project and lot. I am also actively involved in RFC which is a financial open source madei in C#. It has modules like accounting , invoicing , purchase , stocks etc.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
Clickatell's SMS Gateway
Clickatell's Developer Solutions allow you to SMS enable any website or application via a range of API's. Learn More about our API connections.
Free access to .NET Memory Management video
Everything you need to know about Garbage Collection, Temporary Objects, Fragmentation, Finalization and common causes of memory leaks in .NET. Watch the video here.
Microsoft Visual Studio 2010 Professional
Microsoft Visual Studio 2010 Professional will launch on April 12, but you can beat the rush and secure your copy today by pre-ordering at the affordable estimated retail price of $549 (US). Pre-order now.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Developer-Ready ASP.NET 2.0 Web Hosting with 3 MONTHS FREE
Now supporting .NET 3.0 Framework with Windows Workflow Foundation, Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), windows CardSpace (WCS)! Providing more flexibility for Developers with Web Services Support and a User/Permission Manger. Also supporting MS SQL 2005/2000 with Real-Time Backups, FREE Automated Attach .MDF Tool, FREE SQL Restore and Shrink SQL DB Tools, and SQL
 
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
Click Here for 6 Months Free! Powerful ASP.NET Hosting at your Fingertips!
Become a Sponsor
 Comments
Excellent Article by Basu On July 2, 2009
Thanks Mr. Shivprasad K...
Its a Excellent Article about Crystal Report...
Keep Updating other concepts ..
Really Its a nice...
Reply | Email | Delete | Modify | 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 2010  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.