![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
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);
}
Última edición por Casimiro Noteví fecha: 20-07-2024 a las 18:52:37. |
|
#2
|
|||
|
|||
|
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.. |
![]() |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| ¿base de datos seguridad con los campos ? | JXJ | Internet | 4 | 13-05-2011 09:17:52 |
| ingresar datos de campos a dbcombobox | pabloloustau | Conexión con bases de datos | 6 | 14-09-2010 09:45:39 |
| copiar campos de base de datos | mariaesde | Conexión con bases de datos | 6 | 11-09-2008 20:19:06 |
| Procedimientos definidos en una dll | madiazg | Varios | 2 | 03-09-2008 13:35:39 |
| Cómo acceder a tipos definidos en otras units | Bauhaus1975 | Varios | 2 | 03-05-2006 10:22:27 |
|