Crystal Reports is a widely used tool for designing and generating reports from diverse data sources, and it has gained significant popularity in different industries for its ability to extract valuable insights from data. When preparing for a Crystal Reports Interview, candidates should expect questions that test their proficiency in working with the application's features, integration with different databases, report design and formatting, data visualization, and other related topics. This article provides an overview of some common Crystal Reports Interview Questions to help candidates prepare for their interviews.
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.
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 multi-line, 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’.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Ans: Yes, we can use stored procedure.
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.
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.
Ans: 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.
Ans: There are four major components in crystal reports Report designer, Reports engine, Report viewer and object models.
Ans: To understand this sample let display a simple report using crystal.
Step 1:- Create a web application project.
Step 2:- Add new item and select crystal report from the template. This adds a new RPT file in your solution explorer.
Step 3 :- Double click on the RPT file click on Crystal reports
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.
Step 5:- 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
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.
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
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.
Ans: Right click on the ‘RPT’ file and click ‘Publish as web service’
Ans: 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.
Ans: 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.
Ans: 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
Ans: 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.
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”)
Ans: 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.
Ans: When we go for creating a new report you can see the cross –tab option.
Ans: For grouping in crystal you need to use the group expert wizard.
Ans: 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.
You liked the article?
Like : 4
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox
Related Blogs