Welcome Guest.   Make a donation to an author on the site September 18, 2014, 02:48:47 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Crystal Reports  (Read 3457 times)
shaik akbar
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« on: July 01, 2006, 11:48:14 AM »

Hello all,

I am new to C++ builder 6.0
I want to generate the crystal reports dynamically with c++ builder. Can
anybody give me idea how can i start.

Anyone help me greatly appreciated.

Thanks
SA
Logged
Shed
Honorary Member
**
Posts: 26

View Profile Give some DonationCredits to this forum member
« Reply #1 on: July 03, 2006, 09:52:08 AM »

Hello, ...well i just use the "default" components called QReport on Pallete component, in c++ builder environment
and this is for "design" time....not dinamically....

1) drop a Qreport1 component on the desired form that ACT as Report preview

2) configure the properties accordly to your preferences (link to DataSources etc)

3) first, add the HEADER of the Report (this can be totally void (or empty))

4) once you add the Header band, you can ADD the other QRBand's that for example, related to a certain registers on a Table, will be repeated until the End of File (EOF) (in this case, the registers of the table will be repeated on diferent lines)
For this DATA VISUALIZATION, we'll use the TQRDBText component (text from a database or table) or if the text is always the same....use TQRLabel......also for Table listings (called SubDetail Band), you must link the BAND property called DataSet to the Table we're using....

5) add the FOOTER section for print the Page footer....

6) Eventually, if you need "listings" of registers, you must LINK the DataSet property of QRSubDetail Band to the specified table

for example, this is a example QReport Page, as you can see, have the header, one QRSubDetailBand and the Footer





And this is (like example only) a supposed Events and code lines "behind" the Report Page

[copy or print]
void __fastcall TForm24::QRSubDetail1BeforePrint(TQRCustomBand *Sender,
      bool &PrintBand)
{
  int encontrado = 0;
  TLocateOptions opciones;
  opciones.Clear();


   DataModule1->Tabla_envases->First();
        encontrado = DataModule1->Tabla_envases->Locate("TIPO_ENV", DataModule1->MyTable_STOCK_SALIDAS->FieldByName("TIPO_ENV")->AsString, opciones);
        if(!encontrado) {   }
        else {

                     //Product found on table
                     //we take the value from table, and assign to PAK_TYPE
              PAK_TYPE->Caption = DataModule1->Tabla_envases->FieldByName("PAK_TYPE")->AsString;
              PAK_TYPE->Refresh();

              }

   ///////////////////if TIPO_ENV == "GRANEL" we print the Liters, else ...we print the units//////////////////////////////
   if(DataModule1->MyTable_STOCK_SALIDAS->FieldByName("TIPO_ENV")->AsString == "GRANEL")
    {
      QRLabel_num_litros->Caption = FormatFloat("##,###", DataModule1->MyTable_STOCK_SALIDAS->FieldByName("LTS_TOTAL")->AsFloat);
      QRLabel_num_litros->Refresh();
      Label_unidades->Caption = "";
      Label_unidades->Refresh();
      contador_productos++;
     }
   else { QRLabel_num_litros->Caption = ""; QRLabel_num_litros->Refresh();
          Label_unidades->Caption = DataModule1->MyTable_STOCK_SALIDAS->FieldByName("UNIDADES")->AsInteger;
          Label_unidades->Refresh();
          contador_productos++;
            }
}
//---------------------------------------------------------------------------



void __fastcall TForm24::QuickRep1BeforePrint(TCustomQuickRep *Sender,
      bool &PrintReport)
{

 //////////here we assign to Label_PUERTO, the value from a editbox located on Form30////////////////////////
 Label_PUERTO->Caption = Form30->Edit_PUERTO->Text;
 Label_PUERTO->Refresh();

}
//---------------------------------------------------------------------------

void __fastcall TForm24::FormShow(TObject *Sender)
{
 contador_productos = 0;
}
//---------------------------------------------------------------------------


« Last Edit: July 09, 2006, 11:51:26 PM by Shed » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.03s | Server load: 0.07 ]