Sign in Join
Wiki copytemporary

FPReport Designer: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: FPReport Designer

OldNewLine
1+## The FPReport Visual report designer
2+
3+The FPReport visual report designer has the following features:
4+
5+- Design a report from scratch using a visual editor.
6+- Define variables
7+- Load/Save report to/from a JSON file
8+- Connect data to the report
9+
10+:* CSV data
11+
12+:* JSON data
13+
14+:* SQLDB data
15+
16+:* DBF Data
17+
18+- Preview data
19+- Export data to known exporters (PDF, Image, HTML)
20+
21+The following is how it will look when working on a report:
22+
23+<figure>
24+<img src="fpreport_designer_main.png" title="fpreport_designer_main.png" />
25+<figcaption>fpreport_designer_main.png</figcaption>
26+</figure>
27+
28+## usage
29+
30+The Visual report designer is intended to be intuitive, and as such does not require a lot of explanation
31+
32+- To add a data field to a band: drag and drop ot from the data tree view no the right.
33+- Same for functions
34+- ctrl-drag will create a selection rectangle
35+- shift-click can be used to select multiple elements
36+- Move the selection using arrow keys (shift to use bigger step)
37+- Resize the selection using ctrl-arrow keys (shift to use bigger step)
38+
39+Quick explanation of the menu
40+
41+### File
42+
43+The file menu starts a new report or loads/saves a report from disk.
44+
45+- New - speaks for itself
46+- Open report - load a JSON file with a report from disk.
47+- Save Report - save report to a JSON file.
48+- Quit - exit the report designer
49+
50+### Edit
51+
52+- Delete - delete the selection
53+
54+Copy & Paste are in the works.
55+
56+### Report
57+
58+- Add Page : Add a new page to the report.
59+- Properties: set author, 2-pass, title.
60+- Report data : To manage data sources.
61+- Variables: define variables which can be used in expressions
62+
63+### Bands
64+
65+This can be used to add various types of bands to the report.
66+
67+### Elements
68+
69+The elements menu can be used to add various types of elements to the report. Currently the following types are supported:
70+
71+- Memo
72+- Shape
73+- Image
74+- Checkbox
75+
76+### Align objects
77+
78+When multiple objects are selected, this menu can be used to align them:
79+
80+- Align will show the align dialog
81+- All other elements just perform the requested alignment on the selection
82+
83+### Resize objects
84+
85+When multiple objects are selected, this menu can be used to resize them:
86+
87+- Resize dialog will show the resize dialog
88+- All other elements just perform the requested resize operation on the selection.
89+
90+## Data
91+
92+The Report - report data menu can be used to define data sources for the report
93+
94+<figure>
95+<img src="fpreport_design_data.png" title="fpreport_design_data.png" />
96+<figcaption>fpreport_design_data.png</figcaption>
97+</figure>
98+
99+The left side shows a list of available data sources.
100+
101+The buttons above the list will (from left to right):
102+
103+- Clone the currently selected data source.
104+- Add a new data source.
105+- Delete the currently selected data source.
106+
107+At the right, the configuration details of the data source are shown. This means the name, and type of data.
108+
109+Depending on the type, more details can be configured.
110+
111+The "preview" button at the top right can be used to show the dataset in a grid:
112+
113+<figure>
114+<img src="fpreport_design_data_preview.png" title="fpreport_design_data_preview.png" />
115+<figcaption>fpreport_design_data_preview.png</figcaption>
116+</figure>
117+
118+### DBF
119+
120+Only the filename can be set for a DBF data source.
121+
122+<figure>
123+<img src="fpreport_design_data.png" title="fpreport_design_data.png" />
124+<figcaption>fpreport_design_data.png</figcaption>
125+</figure>
126+
127+### CSV
128+
129+For CSV data, some more details can be set:
130+
131+- FileName
132+- Quote character for string fields
133+- separator character between fields
134+- First line contanins fieldsnames:
135+
136+
137+if checked, the first line of the CSV file is expected to contain the field names.
138+
139+- Use the following field names:
140+
141+
142+If checked, the first line is expected to contain data, and the names of the fields must be entered, one per line, in the memo below the radiobutton.
143+
144+<figure>
145+<img src="fpreport_design_data_csv.png" title="fpreport_design_data_csv.png" />
146+<figcaption>fpreport_design_data_csv.png</figcaption>
147+</figure>
148+
149+### JSON
150+
151+For JSON data, there are 2 possibilities for the data source:
152+
153+- A file on disk
154+- A URL
155+
156+Depending on what is chosen, the dialog will load the file from the indicated file or download it from the URL.
157+
158+The following options are still possible:
159+
160+- Path to data array.
161+
162+
163+If the data is not an array, but the actuall data is in some sub-element of the data, then here a path can be entered.
164+
165+The designer will make an intelligent guess at where the data is, when the file/url is opened
166+
167+- Array based records
168+
169+
170+By default, the JSON support expects an array of objects. An array of arrays is also supported.
171+
172+The grid below allows to enter the data type for each of the fields.
173+
174+
175+The designer will make an intelligent guess based on the first row in the array, but e.g. null fields will not be detected correctly.
176+
177+valid types are string, integer, float and boolean
178+
179+<figure>
180+<img src="fpreport_design_data_json.png" title="fpreport_design_data_json.png" />
181+<figcaption>fpreport_design_data_json.png</figcaption>
182+</figure>
183+
184+### SQLDB
185+
186+Any database reachable by SQLDB can be used as a data source for a report. The configuration needs 2 things:
187+
188+- Connection details. These must be entered using the button, which opens the connection editor dialog
189+- SQL Command. Here an SQL Select command can be entered.
190+- The "Test connection" button can be used to verify that the connection is reachable.
191+
192+<figure>
193+<img src="fpreport_design_data_sqldb.png" title="fpreport_design_data_sqldb.png" />
194+<figcaption>fpreport_design_data_sqldb.png</figcaption>
195+</figure>
196+
197+The connection editor allows to edit the connection settings as they exist in SQLDB:
198+
199+- Type: the list depends on the compiled-in SQLDB connections
200+- Hostname: SQL server hostname
201+- Database: DatabaseName
202+- user: username for connection
203+- Password: password of the user
204+- Role: user role
205+- chr.set: character set (UTF8 is recommended)
206+- Additional parameters:
207+
208+
209+here, additional connection-specific parameters can be entered (port no. etc)
210+
211+Again, there is a button to test the connection.
212+
213+<figure>
214+<img src="fpreport_design_sqldb_connection.png" title="fpreport_design_sqldb_connection.png" />
215+<figcaption>fpreport_design_sqldb_connection.png</figcaption>
216+</figure>
217+
218+---
219+*From the Free Pascal wiki, page "FPReport Designer", as it stood on 2018-03-08 after a change by Djzepi, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history