This project is read-only.

SP2 Reporting - FullJustified proposal

Topics: General, Attention VFPX Admins
Mar 10, 2008 at 6:08 PM
Another cool thing we could add is the possibility to print full justified strings.
I'd like to edit the "Field Properties" form from the report designer, adding a new option to the Alignment Option Group, "FullJustified".

This way, people, without using Report Listeners will be able to print in FullJustified alignment.

IMO, the most difficult part is ready, that is to create the code in GDI+ to draw in fulljustified.
I can convert it to be compatible with the FFC class, _gdiplus.vcx, that is embedded in the Reporting APP, so that GdiPlusX will not be required.

In the FRX file, VFP has a field called "OFFSET" - the currently allowed values are: 0 - Left ; 1 - Right ; 2 - Center
So, we can just add a new possibility, to store the value "3 - FULLJUSTIFIED"

And would control the "Render" event to handle this.

Of course, I did this already using Report Listeners.
http://weblogs.foxite.com/cesarchalom/archive/2007/04/05/3641.aspx

What I really want is to bring this possibility for people without using them.

What do you think ?
Mar 11, 2008 at 12:50 AM
I think this would be a nice addition. I would even like to have a top, middle and bottom alignment. Maybe even a "full justified" option, though I hardly ever use that myself

I don't know what all the ramifications would be to adding it to the format tab. It may have to go into the advanced tab. And I'm pretty sure you can't change the currently allowed values of "OFFSET" in the FRX. These extra alignment settings would have to be stored in the MemberData.

Something else to consider is how the output is generated. If we just draw to the ReportListener's gpGraphics handle, other 3rd party output tools will not know about this format unless they write code to look at the memberdata. Of course that is no different than the rotation feature we have now.

Lets go ahead and create a work item for it and we can see what to do about supporting it. Lets start with creating a gfxhandler for it.
Jun 10, 2008 at 3:31 AM
Hi Guys:

Is this in works ? I like the idea and see this option very useful.


Regards

Nasib Kalsi
Jun 11, 2008 at 3:25 PM
Hi Nasib,

In fact, there is a small bug in that report listener that appears when the full justified text needs to be divided in two or more pages. For single page reports, it works nice.

I've already fixed it and hope to post a modified version of this reportlistener very soon in my blog.
http://weblogs.foxite.com/vfpimaging

But for a more complete solution, the xfcGraphics.DrawStringJustified function will need some few tweaks too, specially for dealing with this case.
I hope to upload the fixed "System.Drawing.prg" ASAP too.
Jun 12, 2008 at 3:38 PM

VfpImaging,

What are the tweaks that are needed to the DrawStringJustified method to make this work? I'm just trying to get a sense of what you're running into here.

 

binarybo,

I really like the idea of a middle alignment. I'm trying to get my head around the top and bottom and how those would differ from what is provided by the relative band position we have now. They would certainly be more intuitive, but am I missing something else?

Jun 12, 2008 at 5:26 PM


craigsboyd wrote:

VfpImaging,

What are the tweaks that are needed to the DrawStringJustified method to make this work? I'm just trying to get a sense of what you're running into here.

craigsboyd,

In fact there is a small bug in that function, that makes it draw the text outside the predefined rectangle. Very simple fix, I have it already.
For the report case, in the situation when a text does not fit entirely in one page, and needs to be cut in 2 pieces, the 1st part of the text that will be drawn needs to be FullJustified as well, in order to appear correctly. This is very easy too. I'll add to this function a flag parameter that will define if the last sentence of the string will be justified or not. The adjustments in the report listener are already finished. All I need is to upload the fixes... I hope to do later tonight.
Jun 12, 2008 at 6:35 PM

I really like the idea of a middle alignment. I'm trying to get my head around the top and bottom and how those would differ from what is provided by the relative band position we have now. They would certainly be more intuitive, but am I missing something else

CraigSBoyd,

This alignment would be relative to the text box, not the band. Currently all text boxes are Top aligned. This enhancement would add "middle" and "bottom" aligned. This would work similar to the Top, Middle, Bottom alignment in Excel.
Jun 12, 2008 at 7:56 PM


binarybo wrote:

This alignment would be relative to the text box, not the band. Currently all text boxes are Top aligned. This enhancement would add "middle" and "bottom" aligned. This would work similar to the Top, Middle, Bottom alignment in Excel.

Hi Bo,
Can you provide a kind of skeleton of a tab that could be added to the report designer ?
Once we have it, it will be easy for people to add functionalities...
Jun 15, 2008 at 2:21 PM

craigsboyd wrote:

What are the tweaks that are needed to the DrawStringJustified method to make this work? I'm just trying to get a sense of what you're running into here.
craigsboyd,

Now we are ready to go :-)
More info here:
FULL JUSTIFIED TEXTS IN REPORTS REVISITED
http://weblogs.foxite.com/vfpimaging/archive/2008/06/15/6268.aspx
Jun 15, 2008 at 10:08 PM
That is quite the blog post! Great to see you got it worked out. Has it been decided that there will be a second branch (special build) of the GDIPlusX here on CodePlex?