.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

Describe how to use crystal reports in java.

Posted By :Ghanashyam Nayak     Posted Date :September 28, 2010    Points :10   Category :JavaScript/VBScript 
nstall and run crystl32.cox file in \WINNT\System32 folder and specify the sub directory as 'crystal' as the output directory.

- Create an object of CrystalReport class.
- Invoke aboutBox() method - for confirmation whether it is loaded properly
- Establish the connection by using setConnect() method.
- Specify the output file format by using setReportFileName() method.
- Execute the query by using setSqlQuery() method.
- Set the number of copies of the report and the printer collation.
- Set the destination file using setDestination() method.
- Specify the file type using setPrintFileType () method.
- Invoke the method pritReport()

The following is the code example:

public class CrystalReportExample
{
private static final String CONNECT_STRING = "DSN=YourDsn";
private static final String REPORT_FILE_NAME = "FileName.rpt";
private static final String SQL_QUERY = "select * from YourTable";
private static final String PRINT_FILE = "YourNewReport.doc";

public static void main(String args[]) throws Exception
{
try {
crystal.CrystalReport report = new crystal.CrystalReport();
report.aboutBox();
report.setConnect(CONNECT_STRING); // database connection
report.setReportFileName(REPORT_FILE_NAME); // name of the report file
report.setSQLQuery(SQL_QUERY); // query to get the data from the table
report.setPrinterCopies((short) 1); // number of copies of the report

// specifying the printer collating sequence

report.setPrinterCollation(crystal.PrinterCollationConstants.crptDefault);
report.setDestination(crystal.DestinationConstants.crptToFile); // destination of the report
report.setPrintFileName(PRINT_FILE); // writing the report into the file
report.setPrintFileType(crystal.PrintFileTypeConstants.crptWinWord); // the type of the report file
report.printReport(); // printing the report onto the destination with the specified requirements
}
finally
{
com.linar.jintegra.Cleaner.releaseAll(); // releasing all report resources.
}
}
}.

You can also find related Interview Question to Describe how to use crystal reports in java.  below: 

Advantages of Crystal Reports ?

  
Advantages of Crystal Reports :
-------------------------------

Some of the major advantages of using Crystal Reports are:

1. Rapid report development since the designer interface would ease the coding work for the programmer.

2. Can extend it to complicated reports with interactive charts and enhance the understanding of the business model

3. Exposes a report object model, can interact with other controls on the ASP.NET Web form

4. Can programmatically export the reports into widely used formats like .pdf, .doc, .xls, .html and .rtf (More...)

Describe the three levels of data abstraction?

  
The are three levels of abstraction:
1.Physical level: The lowest level of abstraction describes how data are stored.

2.Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.

3.View level: The highest level of abstraction describes only part of entire database. (More...)

Describe ways of cleaning up objects.

  
The run time will maintain a service called as garbage collector.
this service will take care of deallocating memory corresponding to
objects.it works as a thread with least priority.when application
demenads for memory the runtime will take care of setting the high
priority for the garbage collector,so that it will be called for execution
and memory will be released.the programmer can make a call
to garbage colector by using GC class in system name space. (More...)

Describe the techniques for optimising your application?

  
. Avoid round-trips to server. Perform validation on client.
. Save viewstate only when necessary.
. Employ caching.
. Leave buffering on unless there is a dire need to disable it.
. Use connection pooling.
. Use stored procedures instead of in-line SQL or dynamic SQL. (More...)

Can you describe IUKNOWN interface in short ?

  
Every COM object supports at least one interface, the IUnknown interface. All interfaces are classes derived from the base class IUnknown. Each interface supports methods access data and perform operations transparently to the programmer. For example, IUnknown supports three methods, AddRef, Release(), and QueryInterface(). Suppose that pinterf is a pointer to an IUnknown. pinterf->AddRef() increments the reference count. pinterf->Release() decrements the reference count, deleting the object when the reference count reaches zero. pinterf->QueryInterface( IDesired, pDesired) checks to see if the current interface (IUnknown) supports another interface, IDesired, creates an instance (via a call to CoCreateInstance()) of the object if the reference count is zero (the object does not yet exist), and then calls pDesired->AddRef() to increment the reference count (where pDesired is a pointer to IDesired) and returns the pointer to the caller. (More...)

What is transact-SQL? Describe its types?

  
Types of Transact-SQL:
----------------------
SQL Server Provides three types of Transact-SQL statements namely DDL, DCL, and DML.

Data Definition Language (DDL):
--------------------------------
It allows creating, altering and dropping database objects.

Data Control Language (DCL):
----------------------------
It is used to control access to data in the database.
It controls permission on the database objects using grant, revoke or deny statement.

Data Manipulation Language (DML):
--------------------------------
It involves retrieval, insertion, deletion, modification in the database.
It includes select, insert, update, and delete command. (More...)

Can a .NET web application consume Java web service?

  
Yes Offcourse.Actually Webservices are independent to language. it depends on WSDL and SOAP. so any one can develope the Webservices anddisclose the wsdl and users can consume the webservices.wsdl and soap both are xml based.. and all languages having xml parsing
capability and access to http protocol will be able to work with Webservices. (More...)

Can you describe WCF ?

  
In Simple words, WPF stands for Windows Presentation Foundation.

In detailed view WPF is a new library to create the UI for smart client applications. Most noteable point is : application does not use Window handles. It is easy to resize the UI and supports sound video.


Definition of WPF is : Windows Presentation Foundation (WPF) is Microsoft's development tool for Web applications and rich client applications.With WPF, developers can use XAML, the Extensible Application Markup Language, to create custom controls, graphics, 3D images and animations that are not available in traditional HTML implementations. (More...)

Can you describe WPF?

  
In Simple words, WPF stands for Windows Presentation Foundation.

In detailed view WPF is a new library to create the UI for smart client applications. Most noteable point is : application does not use Window handles. It is easy to resize the UI and supports sound video.


Definition of WPF is : Windows Presentation Foundation (WPF) is Microsoft's development tool for Web applications and rich client applications.With WPF, developers can use XAML, the Extensible Application Markup Language, to create custom controls, graphics, 3D images and animations that are not available in traditional HTML implementations. (More...)

How to add a combo box dynamically at run time in Java script?

  
document.forms[0]..options[index] new Option("Add text Value") (More...)

Describe the accessibility modifier protected internal.

  
It's available to derived classes and classes within the same Assembly. (More...)

Describe the difference between a list and a library in sharepoint?

  
Lists are collections of metadata or columns, that can have attached documents. Libraries are collections of documents (Excel, InfoPath, Word, etc.) plus optional metadata. (More...)

Java is "distributed" what does this means ?

  
Java is designed for the distributed environment of the internet, because it handles TCP/IP protocols. In fact accessing a resource using a URL is not much different from accessing a file.The original version of Java (Oak) included features for intraddress-spaces messaging.This allowed objects on two different computers to execute procedure remotely.Java has recently revived these interfaces in a package called ~Remote Method Invocation (RMI)~. This feature brings an unparalleled level of abstraction to client/server programming.

Thanks !!! (More...)

Different between java and cpp?

  
Java is purely object oriented language , cpp is not purely object oriented language. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend