Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   C++ Builder (https://www.clubdelphi.com/foros/forumdisplay.php?f=13)
-   -   frxReport los datos de los campos definidos (https://www.clubdelphi.com/foros/showthread.php?t=96793)

Randito 20-07-2024 17:48:12

frxReport los datos de los campos definidos
 
Hola, estoy tratando de mostrar un reporte, basado en el componente frxReport de FastReport (Recomplie FAstReport 6 VCL Enterprise) en Embarcadero C++ Builder 10.2 usando el origen de datos de un componente DBGrid.
El problema está después de compilar el formulario y al ejecutar la llamada al frxReport, que no muestra los campos con los datos definidos:
¿Por favor, alguien me pudiera ayudar a resolver este problema u otra solución posible?
Muchas gracias.
Saludos.

Previamente he incluido el uso de las clases necesarias para acceder al origen de datos.
….
Código:

#include "frxClass.hpp"
#include "frxClass.hpp"
#include "frxDBSet.hpp"
#include "DB.hpp"

….
Seguidamente, muestro el código con la llamada al frxReport.

Código:

void __fastcall TForm3::BitBtn2Click(TObject *Sender)
{
TfrxDataPage * DataPage;
TfrxReportPage * Page;
TfrxBand * Band;

TfrxMasterData * DataBand;
TfrxMemoView * Memo;
TfrxDBDataset *frxDataSet=new TfrxDBDataset(this);
 TfrxReportDataSets *frxDBDataset1=new TfrxReportDataSets(frxReport1);
  TfrxDataSet *frxDataset1=new TfrxDataSet(this);

  frxDataSet->DataSet=DBGrid14->DataSource->DataSet;
  frxReport1->DataSet=frxDataSet;
  frxDBDataset1=frxReport1->DataSets;
  frxDataset1=frxReport1->DataSet;
DataPage = new TfrxDataPage(frxReport1);
// add a page
Page = new TfrxReportPage(frxReport1);
// create a unique name
Page->CreateUniqueName();
// set sizes of fields, paper and orientation by default
Page->SetDefaults();
// modify paper’s orientation
Page->Orientation = poLandscape;
// add a report title band
Band = new TfrxReportTitle(Page);
Band->CreateUniqueName();
// it is sufficient to set the «Top» coordinate and height for a band
// both coordinates are in pixels
Band->Top = 0;
Band->Height = 20;
// add an object to the report title band
Memo = new TfrxMemoView(Band);
Memo->CreateUniqueName();
Memo->Font->Size=14;
Memo->Text = "Title of Report";
Memo->Height = 20;
// this object will be stretched according to band’s width
Memo->Align = baWidth;
// add the masterdata band
DataBand = new TfrxMasterData(Page);
DataBand->CreateUniqueName();
DataBand->DataSet = frxDataSet;
// the Top coordinate should be greater than the previously added band’s top + height
DataBand->Top = 100;
DataBand->Height = 20;
// add an object on master data
Memo = new TfrxMemoView(DataBand);
Memo->CreateUniqueName();
// connect to data

Memo->DataSet = frxDataSet;
Memo->DataField = "Equipo";
Memo->SetBounds(0, 0, 100, 20);
Memo->DataField = "NormaDeTiempo";
Memo->SetBounds(105, 0, 100, 20);
Band=new TfrxBand(Band);
Memo->CreateUniqueName();
// adjust the text to the right object’s margin
Memo->HAlign = haRight;
Memo->Color=clBlack;
// show the report
frxReport1->PrepareReport();
frxReport1->ShowReport(true);
}


Galahad 26-07-2024 13:58:37

Hola.
Lo he comparado con un código similar que tengo yo (pero en delphi, no en c++) y lo veo todo bien..
¿ cual es el problema exactamente ?, no muestra los datos (¿ el dataset está abierto en ese momento ? ) o se produce algún error ¿?.
Danos más datos y seguro que encontramos solución, un saludo..


La franja horaria es GMT +2. Ahora son las 17:30:49.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi