Home > Back-end >  The function of the Delphi runtime create reports
The function of the Delphi runtime create reports

Time:09-22

Want to implement a program at run time, add statements () function, at present haven't a clue

Function: the program Settings report query interface during operation (just preach to participate, the function of query conditions))

Custom interface: can put date controls, drop-down list, label, text box, select box


Can give more control initialization assignment,
Then write the SQL query, can pass interface of query conditions to the query can

Please bring some opinions and related source can also

CodePudding user response:

His item once!

CodePudding user response:

Copy to dynamically create component control
Dynamically generated in the program control methods are divided into three steps, first of all, define the generated control types, and then using the Create function to generate control, finally, the related control attribute assignment, TButton controls, for example, steps are as follows:

(1) define the type of control

Var
For: TButton;

(2) to generate control
For the:=TButton. Create (self);
For the Parent:=the Self;
Generally set the Parent controls to the Self, if you don't set the value of the Parent,
Would control not displayed on the screen (Self is the current Form)//set the TOP LEFT WIDTH HEIGHT, etc.

(3) set the other properties, and define related incident response functions, such as the Caption, Left, Top, Height, Width, the Visible and Enabled, Hint and onClick event response function, etc.

Is that what you mean? The component is a drag?

CodePudding user response:

One is all statements, concentrated printing:

;

CodePudding user response:

One is setting up the relevant parameters, the condition, and then print out the report accordingly:
1, set parameters, select fields, field sorting, data, the conditions of generating SQL statements:

2, SQL data set, in the DBGrid, display:

3, data in the DBGrid, print form directly, or generate EXCEL spreadsheet:


For reference only, you have a good experience can communicate,

CodePudding user response:

Actually QUERY object can be passed directly in the past, you set the QUERY window QUERY condition, and then the report directly to the data source is set to QUERY can the premise is you have to design your report, well this is static statements, dynamic report, if you want to do like the upstairs, you should now have a ready-made, have a good look for example

CodePudding user response:

Build a master-slave table
The main table to save the query name query number
From the table query need to dynamically generate control name and the corresponding fields and data manipulation (& gt; <=)

Cycle from table records and generate statements,
Ok, no,

CodePudding user response:

Building Lord table
The main table query name and number
From table query used in the control and the corresponding fields, data manipulation notation is greater than or equal to less than fuzzy
Cycle from the table to generate statements
Query
Didn't the

CodePudding user response:

If the report is also outside the program to add, the main table will join the report file name, combined with the generated statements can finish,

CodePudding user response:

Using FastReport now,,,

CodePudding user response:

Your side, add a statement need to recompile the program, can be realized, what I want is without recompiling application, query condition of dynamic increase a report
In the window menu to add a query condition
As shown in figure:


  • Related