Академический Документы
Профессиональный Документы
Культура Документы
This Interview Questions will give you a quick start for two report giants 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.
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.
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.
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.
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. Thats it now compile and run the project you can see your report live in action.
Right click on the RPT file and click Publish as web service as shown in figure Publish crystal as web service.
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.
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.
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.
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.
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.
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? 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 cant 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?
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 dont 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.