Hi, I created a topic for a question that arose in another topic, is the question of the crystal + delphi + xml
The delphi passed the parameters for the crystal to consult the database
BUT NOW
It created an xml to pass data to the crystal.
NOW
the crystal does not query the database through the SQL senteça, from now on he receives the data file. XML containing all necessary data.
In essence :
- I will indicate the location of the file. rpt, file location. xml, file location. xsd
- the rpt is my base, is the xml that contains the data
The connection was made thus:
// Crpe1.Connect.ServerName := ServerName;
// Crpe1.Connect.UserID := user;
// Crpe1.Connect.Password := password;
talking to Lucker, he informed me that the component Crpe1 (VCL), the connection does not support xml
manually
File-> New-> Standard Report or Ctrl-N
open a window called Standard Report creation wizard
Create new connection -> folder named XML
open a window called XML
in Local XML File : location of my xml file
next Local Schema : location of my schema file
finish
now it is as if connected to a database
But in line of code in Delphi the difficulty increases
in Java and VB solutions I found, but nothing in delphi
CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument reportClientDocument;
CrystalDecisions.ReportAppServer.Controllers.DatabaseController crDatabaseController;
//Load report file
string sampleReportPath = @"C:
eport.rpt";
reportDocument.Load(sampleReportPath);
reportClientDocument = reportDocument.ReportClientDocument;
crDatabaseController = reportClientDocument.DatabaseController;
//Create all Properties
CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag QELogonProperties = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
QELogonProperties.Add("Local Schema File", @"C:Datav101Cdev emp tBillOFLading.xsd");
QELogonProperties.Add("Local XML File", @"C:Datav101Cdev emp tBillOFLading.xml");
CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag QEProperties = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
QEProperties.Add("Database DLL", "crdb_xml.dll");
QEProperties.Add("QE_LogonProperties", QELogonProperties);
//Create Connection info and table
CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo ConnInf = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
ConnInf.Attributes = QEProperties;
ConnInf.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
ConnInf.Password = null;
ConnInf.UserName = null;
//Add Connection Information to a table and add the table to the report
CrystalDecisions.ReportAppServer.DataDefModel.Table TBL = new CrystalDecisions.ReportAppServer.DataDefModel.Table();
TBL.ConnectionInfo = ConnInf;
TBL.Name = XMLName;
//Then set the table to the report
reportDocument.ReportClientDocument.DatabaseController.AddTable(TBL, null);
//And save the report to disk
object RepPath = @"C: estreports";
reportDocument.ReportClientDocument.SaveAs(DateTime.Now.ToFileTime().ToString(), ref RepPath, (int)CrystalDecisions.ReportAppServer.ClientDoc.CdReportClientDocumentSaveAsOptionsEnum.cdReportClientDocumentSaveAsOverwriteExisting);
I noticed one thing, this code is not used the component Crpe1 (VCL), but four dlls:
CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.ReportAppServer.ClientDoc.dll
CrystalDecisions.ReportAppServer.Controllers.dll
CrystalDecisions.ReportAppServer.DataDefModel.dll
It is as if I were doing the hand, only I not know the return of each function
Recalling now the Crystal Reports not access the bank and is not used the component Crpe1 (VCL) in delphi
how this code in Delphi 7?
The dlls are the answer is because they contain the functions, simply notice the similarity of the process done manually and the dlls in the code
I'm not changing anything in the xml and xsd, to this, just want to add .Xml + .Rpt
I need documentation of dlls, to learn how to proceed with each dll
to translate