Re: Reports designers comparison
Posted: Tue Jul 09, 2013 4:18 pm
This is just a very early draft, I appreciate if you comment about something really missing that may be uncompatible with this design:
I think MDI is the way to go as we can work with x reports simultaneously.

The header and footer are RichEdit controls so we can do there what we want related to fonts, colors, pictures, etc.
In the center a xbrowse to define the report columns.
How to show the groups and subgroups ? (I think inside the xbrowse somehow)
Here you have full source code in case you want to try it
FiveReps.prg
I think MDI is the way to go as we can work with x reports simultaneously.

The header and footer are RichEdit controls so we can do there what we want related to fonts, colors, pictures, etc.
In the center a xbrowse to define the report columns.
How to show the groups and subgroups ? (I think inside the xbrowse somehow)
Here you have full source code in case you want to try it

FiveReps.prg
Code: Select all | Expand
#include "FiveWin.ch"
#include "RichEdit.ch"
#include "xbrowse.ch"
#include "splitter.ch"
static oWndMain
function Main()
local oBmpTiled , oBar
local hDLL := LoadLibrary( "Riched20.dll" )
SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )
DEFINE BITMAP oBmpTiled RESOURCE "background"
DEFINE WINDOW oWndMain TITLE "Reports Builder" MDI ;
MENU BuildMenu()
DEFINE BUTTONBAR oBar OF oWndMain 2010 SIZE 70, 70
DEFINE BUTTON OF oBar PROMPT "New" RESOURCE "new" ACTION ReportNew()
DEFINE BUTTON OF oBar PROMPT "Open" RESOURCE "open" ACTION ReportOpen()
DEFINE BUTTON OF oBar PROMPT "Exit" RESOURCE "exit" ;
ACTION oWndMain:End() GROUP
ReportNew()
ACTIVATE WINDOW oWndMain MAXIMIZED ;
VALID MsgYesNo( "Want to end ?" ) ;
ON PAINT DrawTiled( hDC, oWndMain, oBmpTiled )
oBmpTiled:End()
FreeLibrary( hDLL )
return nil
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "Reports"
MENU
MENUITEM "New" ACTION ReportNew()
ENDMENU
ENDMENU
return oMenu
function ReportNew()
local oWndChild, cHeader := "Header", oHeader, oSplit1, oBrw
local cFooter := "Footer", oFooter, oSplit2
DEFINE WINDOW oWndChild TITLE "New report" MDICHILD
@ 0, 0 RICHEDIT oHeader VAR cHeader SIZE oWndChild:nWidth, 70 OF oWndChild
@ 5.3, 0 XBROWSE oBrw OF oWndChild SIZE oWndChild:nWidth, 150
oBrw:CreateFromCode()
@ 15.2, 0 RICHEDIT oFooter VAR cFooter SIZE oWndChild:nWidth, 130 OF oWndChild
@ 70,0 SPLITTER oSplit1 ;
HORIZONTAL ;
PREVIOUS CONTROLS oHeader ;
HINDS CONTROLS oBrw ;
TOP MARGIN 30 ;
BOTTOM MARGIN oSplit2:nLast + 50 ;
SIZE 500, 4 PIXEL ;
OF oWndChild ;
STYLE
@ 225,0 SPLITTER oSplit2 ;
HORIZONTAL ;
PREVIOUS CONTROLS oBrw NOADJUST ;
HINDS CONTROLS oFooter ;
TOP MARGIN oSplit1:nFirst + 50 ;
BOTTOM MARGIN 80 ;
SIZE 500, 4 PIXEL ;
OF oWndChild ;
STYLE
ACTIVATE WINDOW oWndChild ;
ON RESIZE ( oSplit1:Adjust( .T., .F., .T., .T. ), oSplit2:Adjust( .F., .T., .T., .T. ) )
return nil
function ReportOpen()
return nil