crystal reports interview questions

32
hi ... i've created one crystal report in windows form and one crystalreportviewer .. the following is my code.. in form1.cs file try { ExportOptions CrExportOptions; DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net- informations.pdf"; CrExportOptions = cryRpt.ExportOptions; { CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; } cryRpt.Export(); } the above code is saving the file into pdf into specified path.. but i dont want to save a file i should get direct print preview and have a option to print .. As we do in web application using crystal report viewer clicking print and report will be opened in pdf.. and the click print.. i want the same function as we do in web application... i'm writing code in c#.net hope the above explaination will be understood clearly.. 0 160 hi... i've two crystal reports one is in D: drive name employee.rpt with 5 textobject and another report is in E: drive name employee.rpt with 15 textobject... now i want to write a program to overwrite the D drives report with E drives reports i.e i want to replace the 5 textobject with 15 textobject.. overwriting the reports while it is executing .. is there any code for it please help me.. its urgent.. 0 81 hi.. i've created one crystal report. and one global resource file .. in crystal 0 137

Upload: netnitin

Post on 29-Nov-2014

1.003 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Crystal Reports Interview Questions

hi ... i've created one crystal report in windows form and one crystalreportviewer .. the following is my code.. in form1.cs file try { ExportOptions CrExportOptions; DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net- informations.pdf"; CrExportOptions = cryRpt.ExportOptions; { CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; } cryRpt.Export(); } the above code is saving the file into pdf into specified path.. but i dont want to save a file i should get direct print preview and have a option to print .. As we do in web application using crystal report viewer clicking print and report will be opened in pdf.. and the click print.. i want the same function as we do in web application... i'm writing code in c#.net hope the above explaination will be understood clearly..

  0   160

hi... i've two crystal reports one is in D: drive name employee.rpt with 5 textobject and another report is in E: drive name employee.rpt with 15 textobject... now i want to write a program to overwrite the D drives report with E drives reports i.e i want to replace the 5 textobject with 15 textobject.. overwriting the reports while it is executing .. is there any code for it please help me.. its urgent..

  0   81

hi.. i've created one crystal report. and one global resource file .. in crystal report there's one text object with id Text1. and i want to take the values of resource file i've got it CrystalDecisions.CrystalReports.Engine.TextObject Dtemp1 = ((CrystalDecisions.CrystalReports.Engine.TextObject)myreport .ReportDefinition.Sections["section1"].ReportObjects["Text1" ]); Dtemp1.Text = Resources.Resource.ResourceManager.GetString("Dsec1"); it is showing the correct value want i want but when i give print it is disappearing.. how to solve this please help me..

  0   137

hi.. i've created a crystal report and one crystal report viewer in windows form. i've two form form1 and form2 in form2 i've kept one button called print. when i press this button it should print the document into .pdf format. without using the crystal report viewers print button.

  0   97

hi.. i've one crystal report. i want the report header as "employee database". i dont want to right click->insert and goto text object and insert. i've one aspx page and aspx.cs page also. now i want the "employee database" header to be printed from .cs file. i dont want to pass by parameter also.. i.e is there any option in .cs file something like ReportDocument myreport = new ReportDocument(); myreport.Load(MapPath("~/" + "emp.rpt")); myReport.Reportheader="Employee database"; i hope u have understood this. only thing is from .cs file i want to print the header as employee database. i dont want by passing parameter also... please help....

  0   96

Page 2: Crystal Reports Interview Questions

how should i highlight a particular column in a report in actuate e designer report? It should be done dynamically while creating report Thanks in advance!!!!!!!!!!

  0   92

HI all, I am developing reports using crystal reports in VS2005 in windows application. I have two crystalreports name called "studentReport" and "familyReport". I have a form with a button. If I click the button I need to show up the two reports in one report like page1, and page2. The page1 consists the "studentReport" and the page2 contains the "familyReport". The "familyReport" contains different header and footer. How to show up the two crystal reports in single crystalreportviewer?

  2   456

hi...to all i want to generate the two crystal reports one is employee and another is project. now i want to display the two reorts in a single crystal report viewer. i've tried using sub-reports but the page header is not avaliable in a sub reports.. so i want to display two separate crystalreports in a single viewer.. can anybody help me.. plz

  0   67

How can we improve the performance of a crystal report? OR What all performance improvement techniques used in crystal reports? (particularly CR XI)

CSC    9   3020

How to add Crystal Reports(Standalone) to my VB.NET project   1   1567

How many Sub Reports added in One MainReport? Aviva    4   3618

Is it possible to export crystal report with linked subreports in one excel sheet?If yes,then how?

IBM   3   2827

How to print two details fields at the bottom of the page   5   3940

One more interview question If I have the data where some columns have multiple values in a given row of data returned from the database. The stored procedure returns data as it is that is blanks values and non blank values. However, I need to suppress the blank values not by showing 0 values but by shifting the cells up. Is there a way using a formula to shift the blank cell one row up based on a selection critieria? In the example below, I want to get rid of the blank values under Exposure column without replacing with 0. example: Company Margin Exposure AB 500 3 10 7 8 ABC 200 4 2 5 10 Thanks Anita

Barclays   5   3015

I had an Interview yesterday for a Crystal Reports Developer position. Some of these I have not done in my reporting experience and I had just a half day's notice for the interview, hence no prep time :-( 1) Is there a way to be able to change an image(company logo) dynamically in a report? Example if you have 100 reports, and with the market uncertainity if you anticipate that the company logo might change, how can you change the image just in one place and have this reflected in all teh reports at run time? 2) What is a SQL expression? 3) What are field expressions and what are the diff types? (I looked this up in the internet and never found anything with regards to types of field expressions) The interviewer really got me confused as I felt he was not clearly setting forth his questions but it could be that I was unable to understand his wording of the questions. I expect a big zero from his feedback but I am hoping this is an experience for future interviews that I face in crystal reports when I do get some more lined up. Thanks in

Page 3: Crystal Reports Interview Questions

advance! Anita New Jersey, USA.

If we create reports in Crystal Reports using the UCAR Data Warehouse database, which tables should be used?

372 IBM

how can we convert crystal dictionary dc5 file to another datasource format like mdb or xml schema

660 CSC

hi...to all i want to generate the two crystal reports one is employee and another is project. now i want to display the two reorts in a single crystal report viewer. i've tried using sub-reports but the page header is not avaliable in a sub reports.. so i want to display two separate crystalreports in a single viewer.. can anybody help me.. plz

67  

how should i highlight a particular column in a report in actuate e designer report? It should be done dynamically while creating report Thanks in advance!!!!!!!!!!

92  

hi.. i've one crystal report. i want the report header as "employee database". i dont want to right click->insert and goto text object and insert. i've one aspx page and aspx.cs page also. now i want the "employee database" header to be printed from .cs file. i dont want to pass by parameter also.. i.e is there any option in .cs file something like ReportDocument myreport = new ReportDocument(); myreport.Load(MapPath("~/" + "emp.rpt")); myReport.Reportheader="Employee database"; i hope u have understood this. only thing is from .cs file i want to print the header as employee database. i dont want by passing parameter also... please help....

96  

hi.. i've created a crystal report and one crystal report viewer in windows form. i've two form form1 and form2 in form2 i've kept one button called print. when i press this button it should print the document into .pdf format. without using the crystal report viewers print button.

97  

hi.. i've created one crystal report. and one global resource file .. in crystal report there's one text object with id Text1. and i want to take the values of resource file i've got it CrystalDecisions.CrystalReports.Engine.TextObject Dtemp1 = ((CrystalDecisions.CrystalReports.Engine.TextObject)myreport .ReportDefinition.Sections["section1"].ReportObjects["Text1" ]); Dtemp1.Text = Resources.Resource.ResourceManager.GetString("Dsec1"); it is showing the correct value want i want but when i give print it is disappearing.. how to solve this please help me..

137  

hi... i've two crystal reports one is in D: drive name employee.rpt with 5 textobject and another report is in E: drive name employee.rpt with 15 textobject... now i want to write a program to overwrite the D drives report with E drives reports i.e i want to replace the 5 textobject with 15 textobject.. overwriting the reports while it is executing .. is there any code for it please help me.. its urgent..

81  

hi ... i've created one crystal report in windows form and one crystalreportviewer .. the following is my code.. in form1.cs file try { ExportOptions CrExportOptions; DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions(); PdfRtfWordFormatOptions

160

Page 4: Crystal Reports Interview Questions

CrFormatTypeOptions = new PdfRtfWordFormatOptions(); CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net- informations.pdf"; CrExportOptions = cryRpt.ExportOptions; { CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions; CrExportOptions.FormatOptions = CrFormatTypeOptions; } cryRpt.Export(); } the above code is saving the file into pdf into specified path.. but i dont want to save a file i should get direct print preview and have a option to print .. As we do in web application using crystal report viewer clicking print and report will be opened in pdf.. and the click print.. i want the same function as we do in web application... i'm writing code in c#.net hope the above explaination will be understood clearly..

1. What is Crystal Report?

Ans: Crystal report is a report generation tool. Generally have interface with VB6. Crystal report basically generates dynamic data. You can format the data in whichever way you feel like.

2. Can we use Crystal report as a stand-alone application?

Ans: Generally we use Crystal Reports with VB6. However we can make crystal report stand-alone application also. But for that limitation is for viewing the report user should have crystal reports installed on his/her PC.

3. How do we connect to the database?

Ans: There are two ways of creating the report: -

1. Use crystal report built in query. 2. Use the tool ‘ Crystal SQL Designer’ provided by crystal report.

When you create report using crystal report built in query then it asks for the data source name that you have created. When you run the report, then for the first time it will ask for the user id and password. After that it will store the same.

When you create ‘.qry’ using ‘Crystal SQL’ Designer then at that time it will ask for the user id and password. When you run the report for the first time instead of asking for the user id and password it will ask for the ‘.qry’ file location. You can change the query location also. For that open the report, select ‘Set Location’ option in Database menu item, and set the location.

4. How do we format field?

Ans: For formatting any field just right click on it and you will get many options like ‘Format Field.’ ‘Browse field data’ etc. Click on ‘Format Field.’ You can align data, suppress, make it multiline, change the font size, style, and type, make it hyperlink etc.

If it is an amount field then you can display currency symbol also. Right click on the field select ‘Format Field’.

5. Can we give parameters to the report?

Page 5: Crystal Reports Interview Questions

Ans: We can very well give parameters to the report. For creating parameters select ‘Parameter Field’ in Insert menu item. ‘Create Parameter Field’ dialog box will popped up, it will ask for the name of parameter, prompting text and datatype. Now when you run the report it will prompt for these parameters.

6.Can we create our own formulas in reports?

Ans: We can create our own formulas in reports. Select ‘Formula Field’ in Insert menu item. Write the formula in ‘Formula Editor’. Here you will get ‘Field Tree’, ‘Function Tree’, and ‘Operator Tree’, which will display the report fields, functions that are supported by crystal reports (like CDATE () etc.), operators (arithmetic, strings etc.) respectively.

7. Can we create report using more than one database?

Ans: We can create report using more than one database like Oracle, Access. Create data source name for both the databases. Select tables from them and create the report.

Only restriction is if you use two databases then you cannot see the SQL generated by crystal reports.

8. Can we export data of reports into other format like in world doc etc?

Ans: Generated data can be exported to word doc, or in rich text format. Just click on ‘Export’ icon in the menu. Export dialog box will be popped up. It will ask for the ‘Format’ like comma-separated value (csv) etc and the ‘Destination’ like disk, application etc. After that it will ask for the file name and save the data.

Only restriction is formatting of data will be lost, but crystal report will try to maintain as much formatting as it can.

9. Can we use our own SQL for creating a report?

Ans: We can also make our own query using ‘Crystal SQL Designer’ tool provided by SQL. Here you can insert your SQL statement as such. It will save this file as ‘.qry’ . And when you create a report instead of using ‘Database’ button use ‘Crystal SQL Statement’ button.

10. Can we edit SQL made by Crystal reports?

Ans: We cannot edit the SQL made by crystal reports. However we can view the SQL. For that select ‘Show SQL Query’ in Database menu item. Limitation is if you are using only one database. If you use two databases then you can’t even view the SQL prepared by crystal report.

11. Are there any limitations in crystal reports?

Ans: There are certain limitations in crystal reports. They are: -

1. If database is having field whose length is more than 255 characters, then you cannot make formula using that field.

2. While exporting data formatting is lost.

3. When you browse data just by right clicking on the field then it displays that is there in the database not the data selected by the query.

12. Can we suppress printing in crystal reports if 0 records are fetched?

Ans: Yes, we can suppress printing if no records are fetched. Select ‘Report Options’ in File menu item. ‘Report Options’ dialog box will pop up. In that there is one option ‘ Suppress printing if no records’ Check this option. If no records are found then nothing will be printed on the report.

13. What are the sections that we have in Crystal reports?

Page 6: Crystal Reports Interview Questions

Ans: Report has got standard sections like ‘Page Header’, ‘Page Footer’, ‘Report Header’, ‘Report Footer’, and ‘Details’.

However you can add other sections also. Select ‘Sections’ in the Insert menu item. You can insert group sections also.

If you don’t want to show any section just right click on that section and suppress that.

14. Can we add any database field once we have chosen ‘Close’ button?

Ans: Yes, we can add any database field afterwards also. Select ‘Database Field’ in Insert menu item.

If you are using crystal report built in query then it will display the tables that you have selected. And you can select whichever field you want to display on the report.

But if you are using ‘.qry’ file then it will display Query and you can select only those field, which are there in the query.

15. Does Crystal Report support all the functions that we have in Oracle?

Ans: No, Crystal report does not support all the functions. Like Decode function is there in SQL but not there is crystal report. You need to convert that in crystal report format (in if and else etc.).

However if you use ‘.qry’ files then it take the SQL as such. There is no need of changing any syntax.

16. Can we use stored procedure for creating the report?

Ans: Yes, we can use stored procedure.

17. Is there any feature like summing total in crystal report?

Ans: Crystal reports provide features like grand total, sub-total, running total etc. You can select any of these features in Insert menu item.

You can sum up records on the basis of each record or on change of group using ‘Running Total ‘ option in Insert menu item.

18. I am using two tables one is of access database and other is of oracle database, I am getting an error saying that ‘SQL odbc error’ what should I do?

Ans: If you are getting such an error then click the icon for ‘Report Expert’. It will give a warning saying that formatting will be lost. Ignore this you will get ‘Standard Report Expert’ dialog box. Reverse the links of access database table and it will work.

Threads in Forum : Crystal Reports Forum Tools Search this Forum

  Rating Thread / Thread Starter Last Post Replies

Views

Can we add any database field once we have chosen ? Anjali

02-16-2010 08:16 PMby Hephzibah Israel

1 2,370

Are there any limitations in crystal reports? Anjali

02-16-2010 08:15 PMby Hephzibah Israel

1 2,503

Can we use Crystal report as a stand-alone application? Anjali

02-16-2010 08:13 PMby Hephzibah Israel

1 1,566

Page 7: Crystal Reports Interview Questions

How to write a formula to change a font based upon data ? Anjali

02-05-2010 12:29 AMby KSB

1 2,335

How to refresh the crystal report from the application ? Anjali

02-04-2010 11:11 PMby KSB

1 2,283

How many sub-reports can report can have? Anjali

12-05-2009 08:08 PMby Ravi shanker pandey

2 3,833

How many sections are there in the report ? Anjali

12-05-2009 08:03 PMby Ravi shanker pandey

3 3,405

Where is the "save data with report" option? Anjali

12-05-2009 07:58 PMby Ravi shanker pandey

2 2,052

What does it mean when we get the error message Anjali

10-05-2009 03:11 PMby venkatflower87

1 1,915

Exporting issue svijaykanth

06-22-2009 12:38 PMby svijaykanth

0 1,412

How to pass stored Procedure Parameters to the report? Anjali

05-08-2009 01:19 PMby hariptoleti

1 3,135

Can we use stored procedure for creating the report? Anjali

05-08-2009 01:17 PMby hariptoleti

1 1,743

Can we use our own SQL for creating a report? Anjali

03-12-2009 09:00 AMby pjvlakshmi

1 1,926

How to conditionally suppress a field based on Anjali

03-12-2009 08:56 AMby pjvlakshmi

3 2,084

How do we connect to the database? Anjali

02-20-2009 12:36 PMby naveedksk

1 1,926

Explain object pooling? Anjali

08-07-2008 05:07 AMby MaheshM

2 3,435

Can we create report using more than one database? Anjali

07-26-2008 09:33 PMby parthausa

3 2,736

Can we export data of reports into other format Anjali

05-22-2008 07:21 AMby ramesh007

1 1,702

If we create reports in Crystal Reports using the UCAR Data Anjali

03-11-2008 04:19 AMby Anjali

0 980

Is there a way to export the report formulas, like totals to excel? Anjali

03-11-2008 04:19 AMby Anjali

0 1,292

Is there a way to export a report definition without writing code? Anjali

03-11-2008 04:18 AMby Anjali

0 931

What is the "refresh" button suppose to do on the crystal report viewer? Anjali

03-11-2008 04:18 AMby Anjali

0 904

What are Crystal Reports and Crystal Reports Explorer?

03-11-2008 04:16 AMby Anjali

0 1,014

Page 8: Crystal Reports Interview Questions

Anjali

What are the advantages or disadvantages of using Anjali

03-11-2008 04:16 AMby Anjali

0 1,043

How to "Print" in Crystal Reports while using Anjali

03-11-2008 04:15 AMby Anjali

0 884

How do we format field? Anjali

03-11-2008 04:15 AMby Anjali

0 711

What are the sections that we have in Crystal reports? Anjali

03-11-2008 04:14 AMby Anjali

0 596

Does Crystal Report support all the functions Anjali

03-11-2008 04:13 AMby Anjali

0 749

Is there any feature like summing total in crystal report? Anjali

03-11-2008 04:12 AMby Anjali

0 659

How to present data from Crystal Reports on to form? Anjali

03-11-2008 04:12 AMby Anjali

0 649

How to Filter the Crystal reports? Anjali

03-11-2008 04:12 AMby Anjali

0 1,446

How many .rpt files are be there in a main Anjali

03-11-2008 04:12 AMby Anjali

0 1,016

Is it possible to join more than one universe Anjali

03-11-2008 04:11 AMby Anjali

0 755

How do you format your crystal reports s Anjali

03-11-2008 04:11 AMby Anjali

0 979

How many types of reports can be Anjali

03-11-2008 04:11 AMby Anjali

0 1,948

Crystal and Reporting Services Interview Questions - Part 1 

Introduction

How do we access crystal reports in .NET?

What are the various components in crystal reports?

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

Can crystal reports be published as a web service?

How do we invoke the crystal report web service?

How do we add formulas using crystal reports?

How do we pass parameters to crystal reports?

How do we export from crystal reports?

How do we print to printer using crystal?

How do we generate cross tab reports?

How can we do grouping in crystal?

Page 9: Crystal Reports Interview Questions

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

Can you explain reporting services architecture? 

Introduction 

This Interview Questions will give you a quick start for two report giant’s crystal and reporting services. If you find this article useful or you think I need improvements please send me a message at http://www.questpond.com/ . I will definitely consider your suggestions for better improvements. 

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. 

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’. 

Page 10: Crystal Reports Interview Questions

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. 

Page 11: Crystal Reports Interview Questions

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. 

Page 12: Crystal Reports Interview Questions

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. 

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 

Page 13: Crystal Reports Interview Questions

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. 

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’. 

Page 14: Crystal Reports Interview Questions

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.  

Page 15: Crystal Reports Interview Questions

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. 

Page 16: Crystal Reports Interview Questions

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. 

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 CrystalReport1Report.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.PaperA4Report.PrintOptions.PaperOrientation =

Page 17: Crystal Reports Interview Questions

CrystalDecisions.Shared.PaperOrientation.LandscapeReport.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. 

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. 

Page 18: Crystal Reports Interview Questions

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. 

Page 19: Crystal Reports Interview Questions

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. 

Page 20: Crystal Reports Interview Questions

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. 

Page 21: Crystal Reports Interview Questions

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. 

Page 22: Crystal Reports Interview Questions

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. 

Figure 18 :- Databases of reporting services

Let me preface this by stating that I never look for individuals that are pure Crystal Report Writers.  I need individuals that are Business Analysts/SQL Writers/Crystal Writers.  Even though the primary job is to write reports, I expect the incumbant to understand project management methodology, be able to clearly communicate both verbally and in writing to customers, gather requirements, document their work and write SQL to both test and implement their work.  In short, I expect them to be professionals, not amateurs...

That being said, here are the types of plain-English questions that I ask when I interview 'experienced' Crystal Report writers:

1)  What versions have you used and can you describe differences between the versions? - speaks to familiarity and experience with the tool. Also tells me whether the person is a programmer that's dabbled with CR in .net, but may not know the actual tool, which is different, or vice versa - depending on my needs.  In my experience, most (but not all) .net CR writers don't really know Crystal Reports and don't understand the most basic functionality of the tool.  Of course, most (but not all) die-hard experienced CR writers don't know anything about .net, it depends what you're looking for - the skills tend to be very different even though the tools share the same name of 'crystal'

2)  What is 'Set Location' and when would you use it? - speaks to knowledge of very basic functionality

Page 23: Crystal Reports Interview Questions

3)  Explain the pros and cons of basing a report off tables, Views and Stored Procedures - speaks to knowledge of performance and optimization techniques, as well as understanding of SQL concepts.  If an incumbant has only ever report from stored procedures (which he/she may or may not have written), then the interviewee probably doesn't understand basic Crystal Reports Functionality and/or performance and optimization.  Likewise, if the interviewee has only every built reports from tables, then he/she probably doesn't understand performance and optimization and my not understand SQL.

4)  Describe subreports - when would you use them and when would you avoid them - speaks to knowledge of performance and optimization techniques, data access techniques and functionality

5)  What is 'Show SQL Query' and what is it good for?  speaks to knowledge of performance and optimization techniques, as well as understanding of SQL concepts

6)  What is a 'SQL Expression' field and what are the pros and cons of using one?  Nobody knows - seriously - speaks to experience and advanced knowledge (in many cases), as well as understanding of SQL

7)  What is a 'SQL Command Object' and what are the pros and cons of using one - speaks to experience and SQL understanding

8)  Have you ever built a parameterized report?  If so, describe the function of parameters and ways that they can be used to enhance a report's performance or look?  How can they be used to optimize report maintenance  and reduce redundancy?  Speaks to knowledge and experience in true production environments.

9)  If a user were to ask you to build a report for them, what types of questions would you ask the user in order to ascertain the true requirements?  Speaks to experience and analytic skills

10)  What would you do if a user wanted a report that could be exported to excel in spreadsheet format, but the user wanted it to look graphically presentable in Crystal Reports and why?  Speaks to experience and creativity

11)  Describe the most difficult or complicated report you've ever created.  What made it either difficult, complicated or both?  Speaks to overall knowledge, experience, creativity, etc...

etc....

I'm a tough interview and these are samples of the types of questions I ask, but not all the questions.  I ask questions that allow the interviewees to explain themselves in their own manner so that I can see if they understand both the question and the concept, whether or not they explain it perfectly.  I also have years of experience and I can filter out the bs very quickly...  I don't believe in yes/no, mutliple choice technical interview questions because I don't believe they are reliable.

~Kurt

1. What is Crystal Report?

Ans: Crystal report is a report generation tool. Generally have interface with VB6. Crystal report basically generates

dynamic data. You can format the data in whichever way you feel like.

2. Can we use Crystal report as a stand-alone application?

Ans: Generally we use Crystal Reports with VB6. However we can make crystal report stand-alone application also.

But for that limitation is for viewing the report user should have crystal reports installed on his/her PC.

3. How do we connect to the database?

Ans: There are two ways of creating the report: -

1. Use crystal report built in query.

2. Use the tool ‘ Crystal SQL Designer’ provided by crystal report.

When you create report using crystal report built in query then it asks for the data source name that you have

Page 24: Crystal Reports Interview Questions

created. When you run the report, then for the first time it will ask for the user id and password. After that it will store

the same.

When you create ‘.qry’ using ‘Crystal SQL’ Designer then at that time it will ask for the user id and password. When

you run the report for the first time instead of asking for the user id and password it will ask for the ‘.qry’ file location.

You can change the query location also. For that open the report, select ‘Set Location’ option in Database menu item,

and set the location.

4. How do we format field?

Ans:For formatting any field just right click on it and you will get many options like ‘Format Field.’ ‘Browse field data’

etc. Click on ‘Format Field.’ You can align data, suppress, make it multiline, change the font size, style, and type,

make it hyperlink etc.

If it is an amount field then you can display currency symbol also. Right click on the field select ‘Format Field’.

5. Can we give parameters to the report?

Ans:We can very well give parameters to the report. For creating parameters select ‘Parameter Field’ in Insert menu

item. ‘Create Parameter Field’ dialog box will popped up, it will ask for the name of parameter, prompting text and

datatype. Now when you run the report it will prompt for these parameters.

6.Can we create our own formulas in reports?

Ans:We can create our own formulas in reports. Select ‘Formula Field’ in Insert menu item. Write the formula in

‘Formula Editor’. Here you will get ‘Field Tree’, ‘Function Tree’, and ‘Operator Tree’, which will display the report

fields, functions that are supported by crystal reports (like CDATE () etc.), operators (arithmetic, strings etc.)

respectively.

7. Can we create report using more than one database?

Ans: We can create report using more than one database like Oracle, Access. Create data source name for both the

databases. Select tables from them and create the report.

Only restriction is if you use two databases then you cannot see the SQL generated by crystal reports.

Page 25: Crystal Reports Interview Questions

8. Can we export data of reports into other format like in world doc etc?

Ans: Generated data can be exported to word doc, or in rich text format. Just click on ‘Export’ icon in the menu.

Export dialog box will be popped up. It will ask for the ‘Format’ like comma-separated value (csv) etc and the

‘Destination’ like disk, application etc. After that it will ask for the file name and save the data.

Only restriction is formatting of data will be lost, but crystal report will try to maintain as much formatting as it can.

9. Can we use our own SQL for creating a report?

Ans:We can also make our own query using ‘Crystal SQL Designer’ tool provided by SQL. Here you can insert your

SQL statement as such. It will save this file as ‘.qry’ . And when you create a report instead of using ‘Database’ button

use ‘Crystal SQL Statement’ button.

10. Can we edit SQL made by Crystal reports?

Ans:We cannot edit the SQL made by crystal reports. However we can view the SQL. For that select ‘Show SQL Query’

in Database menu item. Limitation is if you are using only one database. If you use two databases then you can’t

even view the SQL prepared by crystal report.

11. Are there any limitations in crystal reports?

Ans: There are certain limitations in crystal reports. They are: -

1. If database is having field whose length is more than 255 characters, then you cannot make formula using that

field.

2. While exporting data formatting is lost.

3. When you browse data just by right clicking on the field then it displays that is there in the database not the data

selected by the query.

12. Can we suppress printing in crystal reports if 0 records are fetched?

Ans:Yes, we can suppress printing if no records are fetched. Select ‘Report Options’ in File menu item. ‘Report

Options’ dialog box will pop up. In that there is one option ‘ Suppress printing if no records’ Check this option. If no

records are found then nothing will be printed on the report.

Page 26: Crystal Reports Interview Questions

13. What are the sections that we have in Crystal reports?

Ans: Report has got standard sections like ‘Page Header’, ‘Page Footer’, ‘Report Header’, ‘Report Footer’, and

‘Details’.

However you can add other sections also. Select ‘Sections’ in the Insert menu item. You can insert group sections

also.

If you don’t want to show any section just right click on that section and suppress that.

14. Can we add any database field once we have chosen ‘Close’ button?

Ans: Yes, we can add any database field afterwards also. Select ‘Database Field’ in Insert menu item.

If you are using crystal report built in query then it will display the tables that you have selected. And you can select

whichever field you want to display on the report.

But if you are using ‘.qry’ file then it will display Query and you can select only those field, which are there in the

query.

15. Does Crystal Report support all the functions that we have in Oracle?

Ans:No, Crystal report does not support all the functions. Like Decode function is there in SQL but not there is crystal

report. You need to convert that in crystal report format (in if and else etc.).

However if you use ‘.qry’ files then it take the SQL as such. There is no need of changing any syntax.

16. Can we use stored procedure for creating the report?

Ans: Yes, we can use stored procedure.

17. Is there any feature like summing total in crystal report?

Ans:Crystal reports provide features like grand total, sub-total, running total etc. You can select any of these features

in Insert menu item.

Page 27: Crystal Reports Interview Questions

You can sum up records on the basis of each record or on change of group using ‘Running Total ‘ option in Insert

menu item.

18. I am using two tables one is of access database and other is of oracle database, I am getting an error saying

that ‘SQL odbc error’ what should I do?

Ans:If you are getting such an error then click the icon for ‘Report Expert’. It will give a warning saying that

formatting will be lost. Ignore this you will get ‘Standard Report Expert’ dialog box. Reverse the links of access

database table and it will work.