Saturday, March 30, 2024

Crystal Reports And Its Use In C# for IT Students

 

Introduction

Crystal reports allow the user to generate reports by summarizing the data. It also allows the user to present data in a graphical format. The crystal reports enterprise reporting consists of,

  • Powerful Report Design - Visual report designer allows user to design interactive reports, they can develop reports by using the .NET tools.

  • Application Development Flexibility - Crystal Reports allow the user to generate HTML pages directly without wasting time on coding the pages. This facilitates the user in focusing on other application logic. Crystal Reports simplifies the process by separating the application development and report design task.

  • Management and Delivery of Reports - Crystal Reports can be easily published on the web. The user can export reports to different file formats like PDF or DOC. The other features of Crystal Reports are printing and exporting report using minimal efforts, and high-quality reports.

  • Features

    Crystal Reports incorporate various new features for easy report generation. Some of the features are,

    • Customizable Templates
      The user can design customized templates and use them while generating new reports. These templates can specify the formatting and design logic and the different data access operations to maintain consistency across multiple reports. This prevents the user from spending more time formatting every single report.

    • Powerful Formula Language
      Crystareports provide over 160 built-in and user-defined functions and operators. This allows the user to control report formatting and complex logic. It also includes a call-stack to easily debug the generated errors.
       
    • Crystal reports allow the user to display only relevant and required data by hiding unnecessary data.

    • Alerting
      Crystal reports allow the user to highlight certain information to the user by generating messages.

    • Hyperlinks
      Crystal reports allow the user to create interactive reports by using hyperlinks. The reports are provided with hyperlinks that link to various web documents.

    • Data Access
      Crystal reports allow the user to easily access databases, files, application systems, and so on. Crystal reports have more than 35 data drivers that help in easy access of data from various data sources. It provides flexibility in connecting to the database by using query generation feature of Crystal Reports.

    • Data Designing and Formatting
      Crystal reports provide various options for designing and formatting data. It provides various wizards to simplify the process of connecting to the database, sorting, or selecting data. It allows the user to provide graphical impact to the reports by using various maps and charts such as bar, pie, and so on.
  • Crystal Report Creation Wizard

    Crystal Reports provides wizards for easy generation of reports. The report Wizard is used for creating and adding new reports to the existing report server. The steps for creating a report using the Report Wizard feature are as follows:

    Step 1

    From the file menu, click New and click Project

    Step 2

    In the Project Types list, select Business Intelligence Projects.

    Step 3

    In the Template list, select Report Server Project Wizard. The Welcome to the Report Wizard page appears.

    Step 4

    Click the Next Button.

    Step 5

    In Select the Data Source Page, click New Data Source and enter a data source name, select data type and the connection string. After building the connection click Next.

    Step 6

    In Design the Query page, type the query string and click Next.

    Step 7

    In the select the Report Type page, select Tabular or Matrix to arrange the reports in table format or matrix format respectively. Click Next.

    Step 8

    Depending on the choice made in the Select the Report Type page, the Design the Table page or Design the Matrix page is displayed. If the Design the Table page is displayed, click the appropriate field and click the Page, Group or Details button. If the Design the Matrix page is displayed, click the appropriate field and click the Page, Columns, Rows or Details button.

    Step 9

    From Choose the Tab Style or choose the Matrix Style page, select the appropriate option to apply styles to the reports, and click Next.

    Step  10

    In the Choose the Deployment Location Page, enter the report server and folder to publish the report

    Step 11

    In the Completing the Report Wizard, enter the name of the report, Click finish.

Customizing Reports

The Process of designing report in Crystal Reports can be optimized in many ways. Information can be summarized so that the user can navigate through the report quickly and also access the information within the reports. The benefits of creating user-driven reports are,

  • Provide interactive control over the data existing in the report.
  • Allows creation of reports as per user requirement to make the reports more useful.

Data Presentation

Crystal Reports allow the user to customize reports at runtime by accessing them. The user can customize the report in various ways. One of the methods is to group fields of a report at the runtime. The group field can be used to group data in the report as per the specified condition.

Consider a scenario where a report is generated in an application containing two fields (Employee Name), (Employee Age). A group is created in the report on the (Employee Name) field. The groups in the report can be changed by changing the selection in a combo box.

ReportViewer Controls

Report viewer controls are used for processing and displaying records that may contains data in tabular , aggregated or multidimensional form. Windows Forms provides the CrystalReportViewer control that allows the user to view and customize the reports. By using the properties, methods and events of CrystalReportViewer class, the appearance and functions of the reports can be customized.

Properties of CrystalReportViewer class

  1. DisplayStatusBar
    Specifies or retrieves a value that indicates whether the status bar is visible.
  2. DisplayToolBar
    Specifies or retrieves a value that indicates whether the toolbar is visible.
  3. ShowCloseButtton
    Specifies or retrieves a value that indicates whether a button for closing a report page exists in CrystalReportViewer control’s toolbar.
  4. ShowPageNavigateButtons
    Specifies or retrieves a value that indicates whether a button for navigating in a page exists in CrystalReportViewer control’s toolbar.
  5. ShowPrintButton
    Specifies or retrieves a value that indicates whether the print button on the toolbar is visible.
  6. ShowTextSearchButton
    Specifies or retrieves whether the search button on the toolbar is visible.
  7. ShowZoomButton
    Specifies or retrieves whether the zoom button on the toolbar is visible.
  8. ViewTimeSelectionFormula
    Specifies or retrieves the selection formulae that are used to filter data in the report.

Methods of CrystalReportViewer class

  1. CloseView
    Closes the view tab present in the control.
  2. ShowGroupTree
    Displays the group tree present in the control.
  3. ShowNextPage
    Displays the next page of the report.
  4. ShowPreviousPage
  5. Displays the previous page of the report.

Events of CrystalReportViewer class

  1. Drill
    Occurs when user goes deeper down in a report.
  2. HandleException
    Occurs when an exception occurs in the CrystalReportViewer control.
  3. ViewZoom
    Occurs when the zoom level of the control changes.

Monday, March 18, 2024

Privacy Policy For UDCode

Privacy Policy

Last updated: May 08, 2024

This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You.

We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy. This Privacy Policy has been created with the help of the Free Privacy Policy Generator.

Interpretation and Definitions

Interpretation

The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.

Definitions

For the purposes of this Privacy Policy:

  • Account means a unique account created for You to access our Service or parts of our Service.

  • Affiliate means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.

  • Application refers to UDCode, the software program provided by the Company.

  • Company (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to UDCode.

  • Country refers to: Gujarat, India

  • Device means any device that can access the Service such as a computer, a cellphone or a digital tablet.

  • Personal Data is any information that relates to an identified or identifiable individual.

  • Service refers to the Application.

  • Service Provider means any natural or legal person who processes the data on behalf of the Company. It refers to third-party companies or individuals employed by the Company to facilitate the Service, to provide the Service on behalf of the Company, to perform services related to the Service or to assist the Company in analyzing how the Service is used.

  • Usage Data refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration of a page visit).

  • You means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable.

Collecting and Using Your Personal Data

Types of Data Collected

Personal Data

While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You. Personally identifiable information may include, but is not limited to:

  • First name and last name

  • Usage Data

Usage Data

Usage Data is collected automatically when using the Service.

Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, unique device identifiers and other diagnostic data.

When You access the Service by or through a mobile device, We may collect certain information automatically, including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device identifiers and other diagnostic data.

We may also collect information that Your browser sends whenever You visit our Service or when You access the Service by or through a mobile device.

Use of Your Personal Data

The Company may use Personal Data for the following purposes:

  • To provide and maintain our Service, including to monitor the usage of our Service.

  • To manage Your Account: to manage Your registration as a user of the Service. The Personal Data You provide can give You access to different functionalities of the Service that are available to You as a registered user.

  • For the performance of a contract: the development, compliance and undertaking of the purchase contract for the products, items or services You have purchased or of any other contract with Us through the Service.

  • To contact You: To contact You by email, telephone calls, SMS, or other equivalent forms of electronic communication, such as a mobile application's push notifications regarding updates or informative communications related to the functionalities, products or contracted services, including the security updates, when necessary or reasonable for their implementation.

  • To provide You with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless You have opted not to receive such information.

  • To manage Your requests: To attend and manage Your requests to Us.

  • For business transfers: We may use Your information to evaluate or conduct a merger, divestiture, restructuring, reorganization, dissolution, or other sale or transfer of some or all of Our assets, whether as a going concern or as part of bankruptcy, liquidation, or similar proceeding, in which Personal Data held by Us about our Service users is among the assets transferred.

  • For other purposes: We may use Your information for other purposes, such as data analysis, identifying usage trends, determining the effectiveness of our promotional campaigns and to evaluate and improve our Service, products, services, marketing and your experience.

We may share Your personal information in the following situations:

  • With Service Providers: We may share Your personal information with Service Providers to monitor and analyze the use of our Service, to contact You.
  • For business transfers: We may share or transfer Your personal information in connection with, or during negotiations of, any merger, sale of Company assets, financing, or acquisition of all or a portion of Our business to another company.
  • With Affiliates: We may share Your information with Our affiliates, in which case we will require those affiliates to honor this Privacy Policy. Affiliates include Our parent company and any other subsidiaries, joint venture partners or other companies that We control or that are under common control with Us.
  • With business partners: We may share Your information with Our business partners to offer You certain products, services or promotions.
  • With other users: when You share personal information or otherwise interact in the public areas with other users, such information may be viewed by all users and may be publicly distributed outside.
  • With Your consent: We may disclose Your personal information for any other purpose with Your consent.

Retention of Your Personal Data

The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies.

The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period of time, except when this data is used to strengthen the security or to improve the functionality of Our Service, or We are legally obligated to retain this data for longer time periods.

Transfer of Your Personal Data

Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction.

Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that transfer.

The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of Your data and other personal information.

Delete Your Personal Data

You have the right to delete or request that We assist in deleting the Personal Data that We have collected about You.

Our Service may give You the ability to delete certain information about You from within the Service.

You may update, amend, or delete Your information at any time by signing in to Your Account, if you have one, and visiting the account settings section that allows you to manage Your personal information. You may also contact Us to request access to, correct, or delete any personal information that You have provided to Us.

Please note, however, that We may need to retain certain information when we have a legal obligation or lawful basis to do so.

Disclosure of Your Personal Data

Business Transactions

If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.

Law enforcement

Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).

Other legal requirements

The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:

  • Comply with a legal obligation
  • Protect and defend the rights or property of the Company
  • Prevent or investigate possible wrongdoing in connection with the Service
  • Protect the personal safety of Users of the Service or the public
  • Protect against legal liability

Security of Your Personal Data

The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security.

Children's Privacy

Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We take steps to remove that information from Our servers.

If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from a parent, We may require Your parent's consent before We collect and use that information.

Links to Other Websites

Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit.

We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.

Changes to this Privacy Policy

We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page.

We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy.

You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.

Contact Us

If you have any questions about this Privacy Policy, You can contact us:

  • By email: udcode@gmail.com

Saturday, March 2, 2024

ReactJS + MySQL Database Connctivity Complete Code Step by step

ReactJS and MySQL Database Connctivity Complete Code Step by step


Here's a step-by-step guide to connect a ReactJS frontend to a MySQL database:

1. Set up your MySQL database:

   - Install MySQL on your local machine or use a cloud-based MySQL service.

   - Create a database and necessary tables.

2. Set up your ReactJS project:

   - Create a new ReactJS project using Create React App or any other method.

   - Navigate to your project directory and install necessary dependencies:
     
     npx create-react-app my-react-mysql-app
     cd my-react-mysql-app
     npm install mysql
     

3. Create a MySQL connection file:

   - Create a file named  db.js  or any preferred name.

   - Inside  db.js, establish a connection to your MySQL database using the mysql package. Here's a basic example:
     
     const mysql = require('mysql');

     const connection = mysql.createConnection({
       host: 'localhost',
       user: 'your_mysql_username',
       password: 'your_mysql_password',
       database: 'your_database_name'
     });

     connection.connect((err) => {
       if (err) {
         console.error('Error connecting to MySQL database: ', err);
         return;
       }
       console.log('Connected to MySQL database');
     });

     module.exports = connection;
     

4. Create React components:

   - Create React components for your application, including components for fetching data from the MySQL database and displaying it.

5. Fetch data from MySQL in your React components:

   - Import the MySQL connection from db.js into your React component.

   - Use the connection to execute SQL queries to fetch data from your database.

   - Display the fetched data in your React component.

Here's an example of fetching data from MySQL in a React component:


import React, { useEffect, useState } from 'react';
import dbConnection from './db'; // Assuming db.js is in the same directory

function App() {
  const [data, setData] = useState([]);

  useEffect(() => {
    dbConnection.query('SELECT * FROM your_table_name', (err, results) => {
      if (err) {
        console.error('Error fetching data from MySQL: ', err);
        return;
      }
      setData(results);
    });
  }, []);

  return (
    <div>
      <h1>Data from MySQL Database</h1>
      <ul>
        {data.map((item) => (
          <li key={item.id}>{item.name}</li>
        ))}
      </ul>
    </div>
  );
}

export default App;



Remember to replace 'your_mysql_username', 'your_mysql_password', 'your_database_name', and 'your_table_name' with your actual MySQL credentials and table name.

This is a basic example to get you started. Depending on your application's complexity, you might want to implement error handling, input validation, and other features. Additionally, consider using asynchronous functions and modern React practices such as functional components and hooks.