How to create a fixed width report?
I am trying to create a report where the columns are fixed width in a text file.
Here is what I tried:
1) Write my SQL with no string manipulation and format the column using the memoview object's Format property and using the Format function specifying the width in the format string, like %125s. This failed on both counts. I tried with AutoWidth set to true and false.
2) Pad strings using SQL. Example: select cast(FName as char(40)) FName ... I know for sure the data is padded to the width I want. I then put one field right after another in a memo object. I set the font to Courier New. This looks great in preview. It even exports to PDF correctly. I can copy the PDF text to clipboard and examine in a text editor. All the spaces used for padding are there.
This solution fails because the text export comes up with its own interpretation of the data. A column 25 wide ends up being 13 characters wide. The last 2 records don't even look like they do in the preview window.
So, is it possible to create a tabular report in FR4 with fixed width columns which exports to text correctly? How do you do it?
Here is what I tried:
1) Write my SQL with no string manipulation and format the column using the memoview object's Format property and using the Format function specifying the width in the format string, like %125s. This failed on both counts. I tried with AutoWidth set to true and false.
2) Pad strings using SQL. Example: select cast(FName as char(40)) FName ... I know for sure the data is padded to the width I want. I then put one field right after another in a memo object. I set the font to Courier New. This looks great in preview. It even exports to PDF correctly. I can copy the PDF text to clipboard and examine in a text editor. All the spaces used for padding are there.
This solution fails because the text export comes up with its own interpretation of the data. A column 25 wide ends up being 13 characters wide. The last 2 records don't even look like they do in the preview window.
So, is it possible to create a tabular report in FR4 with fixed width columns which exports to text correctly? How do you do it?
Comments
Looks like there are bugs in the text export filters. I have similar issues as well, both in FastReports4 and still in the updated FastReports5 [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Checking the forum I found some other people are also strugging with these text export filters (eg:[/img] https://www.fast-report.com/en/forum/index....hl=text+export).
There are 3 filters, simpleText, dotMatrix and Text... I did not find any clear explanation what is exactly the diference between them, and looks some features of them are broken for a long time already. For people who have also de sources, trying to understand the code that is doing the export is very hard because the code is far from easily readable for the ones not in the project).
I still dont have a solution for my problem as well... hopping FR staff come to the help.
It seems FR's export filters to TXT doesn't have such feature