Borland C++ builder6 dasturlash tilida:
Dasturiy mahsulotni ishlab chiqish jarayoni quyidagi keltirilgan ketma-ketlik orqali bajarishda o’z ifodasini topadi:
4 ta yangi forma ochamiz va 1-formaga komponentalar palitrasidagi quyidagi komponentalar joylashtiramiz:
ADO->ADO Connection , ADO->ADO Table , Data Access->Data Source , Standard->Main Menu ;ActiveX->ShockwaveFlash ;
ADO Connection tarkibiga Connection String xossasiga db1.mdb ma’lumotlar bazasini biriktiriladi va LiginPromt xossasiga true o’rnatiladi;
Data Source tarkibidan Data Set xossasiga ADO Table1 o’rnatiladi;
DBGrid tarkibidan DataSource xossasiga DataSource1 o’rnatiladi, natijada DBGrid oynasida jadval paydo bo’ladi;
ADOTable tarkibidan Active xossasini true ga o’zgartiriladi;
Main Menu tarkibiga Yuriqnoma, Laboratoriya ishi, Jadval, Jadval PDF, Grafik, Pechat (Yuriqnoma, Jadval), Dasturdan chiqish, Dastur haqida o’rnatiladi;
Fast Report 4.0->frxReport , Fast Report 4.0->frxPreview ; frxReport tarkibidan Name xossasiga frxReport1 o’rnatamiz va frxReport->Fayl->New Page yangi oynasiga yo’riqnomani joylashtiramiz;
3-formaga quyidagi komponenetalarni joylashtiramiz:
Fast Report 4.0->frxReport , Fast Report 4.0->frxDBDataset , Fast Report 4.0->frxPreview , Fast Report 4 export->frxPDFExport ;
FrxDBDataset tarkibidan DataSource xossasiga Form1.DataSource1 o’rnatiladi; frxPreview komponentaga sichqoncha chap tugmasi ikki marta bosilib Fayl->NewReport, Report->Data…o’rnatiladi;
Data Controls tarkibidan DB Edit komponentasini formaga joylashtiriladi va DataSource xossasini Form1.DataSource1 nom bilan, DataField xossasini jadvaldagi tegishli nom bilan belgilanadi;
4-formaga Data Controls tarkibidan TDBChart komponentasi joylashtiriladi va Chart->Add->Fast Line, Series->DataSource->Data Set->Form1.Table1 kabi belgilanadi.
1-forma komponentalari uchun yozilgan dastur kodlari quyidagicha:
#include
#include
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit4.h"
#include "Unit5.h"
//-----------------------------------------
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma link "ShockwaveFlashObjects_OCX"
#pragma resource "*.dfm"
TForm1 *Form1;
//-----------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//-----------------------------------------void__fastcall TForm1::LABORATORIYAISHI1Click(TObject *Sender)
{
ShockwaveFlash1->Movie=ExtractFilePath(Application->ExeName)+"/pendulum-lab.swf";
ShockwaveFlash1->Play();
}
//-----------------------------------------
void __fastcall TForm1::MENYU1Click(TObject *Sender)
{
Form2->Show();
Form2->frxReport1->ShowReport();
}
//-----------------------------------------
void__fastcall TForm1::DASTURDANCHIQISH2Click(TObject *Sender)
{
Form1->Close();
}
//-----------------------------------------
void__fastcall TForm1::JADVAL1Click(TObject *Sender)
{
Form3->Show();
Form3->frxReport1->ShowReport();
}
//-----------------------------------------
void __fastcall TForm1::GRAFIK1Click(TObject *Sender)
{
Form4->Show();
}
//--------------------------------------------
void__fastcall TForm1::YURIQNOMA1Click(TObject *Sender)
{
Form2->frxReport1->ShowReport();
Form2->frxReport1->Print();
}
//--------------------------------------------
void __fastcall TForm1::JADVAL2Click(TObject *Sender)
{
Form3->frxReport1->ShowReport();
Form3->frxReport1->Print();
}
void__fastcall TForm1::JADVALPDF1Click(TObject *Sender)
{
Form3->frxReport1->ShowReport();
Form3->frxReport1->Export(Form3->frxPDFExport1);
}
void__fastcall TForm1::DASTURHAQIDA1Click(TObject *Sender)
{
Form5->Show();
Form5->frxReport1->ShowReport();
}
{
ADOConnection1->ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin; DataSource="+ExtractFilePath(Application->ExeName)+ "db1.mdb;Mode=Share Deny None;Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;";
ADOConnection1->Connected=true;
ADOTable1->Active=true;
}
Kompilyatsiyajarayoniamalga oshirilgach quyidagi natija kelib chiqadi:
Do'stlaringiz bilan baham: |