Click here to Skip to main content
16,020,377 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all

i am new user here. i want to know that is possible to make crystal reports without making dataset schema. only by mysql select query.

thanks in advance
Posted

Sounds like you want to connect to MySQL to get data directly. If so, have a look at the following thread conversation: Can crystal report access MySQL database[^]

This would help too: Using Connector/ODBC with Crystal Reports[^]
 
Share this answer
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using System.IO;
using System.Drawing.Imaging;
using System.Data.Odbc;

namespace Mortgage_ERP_1
{
public partial class DR_Bill : Form
{
DataSet1 dataset = new DataSet1();
string bill, id,name,add,date;
string cmdstring;
OdbcDataAdapter da;
Conncation cc = new Conncation();
CrystalReport1 myReport = new CrystalReport1();
FirmClass fc = new FirmClass();
public DR_Bill(int Bill_No, string C_Name, string C_address, string Date, int ID, string ex_date)
{
InitializeComponent();
bill = Bill_No.ToString();
id = ID.ToString();
name = C_Name;
add = C_address;
date = Date;

}
private void DR_Bill_Load(object sender, EventArgs e)
{
cmdstring = "select `ID`,`Discription`,`Girvi Amount`,`GW`,`NW`,`Bill Date` from `girvi a/c` where `Bill No` = " + bill + "";
da = cc.Report(cmdstring);
dataset.Clear();
da.Fill(dataset, "DR Bill");
myReport.SetDataSource(dataset);
crystalReportViewer1.ReportSource = myReport;
myReport.SetParameterValue("Name", name);
myReport.SetParameterValue("Address", add);
myReport.SetParameterValue("Bill No", bill);
myReport.SetParameterValue("Date", date);
myReport.SetParameterValue("C_Id", id);
myReport.SetParameterValue("F_Name", fc.F_Name);
myReport.SetParameterValue("F_Address", fc.F_Address);
myReport.SetParameterValue("F_Phone", fc.F_Phone);
myReport.SetParameterValue("F_Mobile", fc.F_Mobile);
myReport.SetParameterValue("F_Email", fc.F_email);
}


}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900