1 (edited by sdpc62 2022-08-23 15:29:04)

Topic: Interchangeable columns

How can I display the columns I choose for printing, they can be interchangeable with my choice of selection.
That is to say, I want to print a column with a name and a number, then I want to print a column with an address and a number, is it possible to change the columns by choices.
Sabine

Post's attachments

Attachment icon Colonnes interchangeables.jpg 11.64 kb, 52 downloads since 2022-08-23 

Re: Interchangeable columns

Hi Sabine

Options
1. If you can highlight the fixed columns of your choice with buttons 1 and 2.
2. selection using checkbox.
3. selection with the mouse. Left click on the column header. While holding pull down.

Printing via excel.

Maybe someone else can advise.

Post's attachments

Attachment icon columns.zip 335.08 kb, 119 downloads since 2022-08-23 

Re: Interchangeable columns

Thanks sparrow, your example works fine, but if the person using the program doesn't have excel, how does he print the table.

Re: Interchangeable columns

Through Report.
For printing through the Report, the project will become more complicated
and even for an example there is not enough information about what and how to print.

Re: Interchangeable columns

Thanks sparrow, that was just a question.
Best wishes.

Re: Interchangeable columns

Hi Sabine, Hi Sparrow,
Attached is one way of perhaps doing what you want (although it doesn't address problems like whether the selected columns will fit the width of the FastReport columns).  But it's not meant to be a finished solution - more an exercise in seeing if what you were after was basically possible.  Maybe if you play around with it, you might get it closer to how you want it.
On Form3 is a list of available fields;  click on any of them and then click in one of the available slots to copy that field.  Do this for as many fields as you want to display on the report (see the screenshot in the attachment).
Then just run the report.
Derek.

Post's attachments

Attachment icon flexible columns.zip 525.05 kb, 115 downloads since 2022-08-24 

Re: Interchangeable columns

Thank you Derek, your idea is good, it really allows you to choose the columns you want. That's great.

Re: Interchangeable columns

Hi Sabine,
You can take the same approach to adding your own headers to the columns you want to display in FastReport (see attached).
Derek.

Post's attachments

Attachment icon flexible columns2.zip 525.89 kb, 102 downloads since 2022-08-25 

9 (edited by sparrow 2022-08-25 11:27:03)

Re: Interchangeable columns

Hi Derek,hi Sabine


You can dynamically generate both headers and a table in the Report. See example
You can change the column alias.
You can wrap words automatically in cells.
You can also transfer the title text and the footer.


But what should be the width of the columns???
To try to be anchored to proportions in the TableGrid MVD?

Post's attachments

Attachment icon flexible columns v3.zip 382.05 kb, 108 downloads since 2022-08-25 

Re: Interchangeable columns

hello sparrow, your example is great with the column names that we can add, I like it.
Thank you and Derek for bringing me a solution.

11 (edited by sparrow 2022-08-26 13:09:22)

Re: Interchangeable columns

Hello everybody.


V4
Dynamic width of each column depending on the content of the column.
Auto-numbering lines in the report.
Footer with page number.
Ability to sort by table fields.
Warning if text is larger than page width.


Sabine I hope you don't end up with very long entries. )

UPD:  and Converting SQL DATETIME fields to DATE format.

Post's attachments

Attachment icon flexible columns v4.zip 384.16 kb, 105 downloads since 2022-08-26 

Re: Interchangeable columns

Hi Sparrow,
This is getting seriously good now - love it!
D.

13 (edited by sparrow 2022-09-01 17:06:16)

Re: Interchangeable columns

Hello Sabine, Derek.


For those who want a simple page to print with a choice of columns and some customization options.


New version of the program New V1


Features (currently):
- the ability to work with any MVD features for the Report: SQL query (Script) for ONE TABLE, Button action Report, Button action Report SQL.
You can send all columns to the Report.
- Select columns for printing (Report).
- Changing the order of columns (Report).
- Change alias of columns for printing in Report. (Report) DblClick on the fields.
- Possibility of auto-numbering lines. Requires column name "Line" in script or via calculated field (in MVD). See example.
- Select page orientation (Report).
- Simplified display of columns on the page in the preview. (Report)
- Out-of-print warning. (Report)
- Changing the size of columns and intervals in FastReport. (Report) Columns words auto wrap.
- Editing the form header in FastReport. Change text, font size and style (Bold).(Report)
- Automatic conversion of Dates in SQLite format to regional format (Report).
- page footer with page number (Report).


! Version under editing. Remarks and comments are accepted. !
Errors are possible.
In the future, it will be placed in the Reports section.


P.S. In the example, both options work (script SQL (old) and MVD Report (new) ) through the new version of the Report.
To showcase the possibilities. The MVD Report version removes duplicates (DISTINCT), the list is shortened.

Post's attachments

Attachment icon flexible columns new v1.zip 388.45 kb, 123 downloads since 2022-09-01 

Re: Interchangeable columns

Thanks sparrow, I'll give it a try