Datawindow Print Multiple  Example
-------------------------
Requirements
--------------------------
Windows NT4 and later
PB 9.03 ( convertable to PB 8 / PB 7 /PB 6.5  using Export/Import
Most Datawindows are Release 6, so no source edit is necessary
------------------------------------
Purpose
------------------------------------
- print multiple datawindows ( and text ) with preview
- print text with preview
- print a datawinodow with preview

Try:

load psr files into the datawindow and click picturebutton

"Print checked Text and checked Datawindows with Preview"

watch Tooltips for Picturebuttons to get an idea, what to do


-------------------------------------------
General
-------------------------------------------
Most of the objetcts are necessary, because they are
referenced by basic classes that I use.

The main window in focus is    w_dwprintmultiple

using w_printcomposite to print multiple Datawindows an Text with Preview.
There are also Examples for printing Text or one single Datawindow

-----------------------------------------
Implementation Details
-----------------------------------------
The basic idea is, to use a composite datawindow and build dynamicly
Child Reports and then fill each Reports with the content of a datawindow.

Of course the implementation leads to a lot of detail problems and solutions.
One of the main problems is, that you cannot call datawindowchild.Create(ls_dwsyntax)
The solution is, to assign a empty datawindowobject to the report and then modify it,
calling datawindowchild.Modify(ls_modstring).
The implementation shows, how datawindow syntax can be transformed to a ModString

                n_fbusiness.of_synmodcreate(as_syntax)

If you understand the basic task to create one Report for each Datawindow to print,
you will get to some questions about the data for the report.

I implemented ways to share data,  copy data , or retrieve the report.

The different ways have there own advantages an demands.
Think of Retrieval Arguments, Datawindowchild Data, Current Layout of the source
and so on.

You will find a Solution for the most Problems.

But a few restrictions for Printing multiple Datawindows
- Datawindow must be set to PowerbuilderUnits during design.
- Only Tabular, Freeform, Grid without Groups possible.  

An other function within w_printcomposite is to print only one datawindow 
in this case there is no composite used, but the datawindow itself will be displayed
therefore some mor functions are available
(switch preview off, sort, filter, search text)

-------------------------------------------
Other Function within w_printcomposite
----------------------------------------
w_printcomposite offers a lot of functions beside printing multiple Datawindows
- printing one datawindow or datastore
   wf_createreport (datawindow adw_dw, integer ai_mode,   string as_dataobject,  string as_modstring);
	wf_createreport (string as_dataobject, string as_addwhere, string as_arguments, transaction atr_transaction);
	wf_createreport (string as_dataobject, string as_addwhereunion[],  string as_arguments, transaction atr_transaction);
- add a datawindow or a text to a created composite
	wf_adddatawindow (str_dwcomposite astr_dwcomposite)
	wf_addtext (string as_text, str_dwtextfont astr_dwtextfont);
- print treeview //requires u_treeview filled with bitmaps according to treeview items
   wf_printtree (u_treeview atv_treeview);
	wf_printtreenode (u_treeview atv_treeview);


-----------------------------------------------
The Objects in focus
---------------------------------------------
w_printcomposite is the object in focus 
w_printcomposite has the userobject u_printcomposite on it

u_printcomposite has the most functionality for building the Preview Datawindow dw_composite
on itself.

n_dwbusiness  DataWindow Business  and  n_dsbusiness   DataStore Business
are used for the basic datawindow functions

n_fnbusiness  Function Business  takes a lot of the functions necessary both for datwindows and datastores

w_printcomposite takes the functions for displaying and modifying the window layout.
most functioncalls to w_printcomposite are forwarded to u_printcomposite

u_printcomposite calls the necessary functions implemented in business objects
most of them in n_dwbusiness, and n_fbusiness

----------------------------------------------
Other features in the application
----------------------------------------------

You will recognize, that there are some other features in the application.
- Tooltips (using Tag) for Picture and Commandbuttons using u_picturebutton, u_commandbutton, n_dotiming
  just place u_picturebutton on a window and it will work
  Also Tooltip for DW Buttons using u_datawindow
  The Mousemove Event is used 

- Resizeservice for Windows and Userobjects using n_wbusiness   n_ubusiness 
  n_wbusiness.of_resizeaddcontrol(dc_x, dc_y, dc_width, dc_heigt)

- Microhelp (using Tag) for all controls, telling them there Microhelpparent using
   n_fbusiness.of_controlstrigger(windowforcontrolcollect,w_MicrohelpParent,"ue_sethelpparent"
   then capture mousemove of the control and trigger w_MicrohelpParent
	Watch the MicrohelpText while moving over the controls
	Within a Datawindow  Tags of DwObjects are displayed instead of the Datawindow.Tag
	 Works for all controls on the window , no matter if on tabs or userobjects
  	Requires Basic Class Controls i.e. u_statiktext , u_datawindow

- Basic for a lot of reducing complexity, is to get a reference of the next parent window
  in the constructor of every control. So you can use iw_ControlParent within every control
  no matter if it is on a tabpage

- the window w_txt_sh is the general window to display text
  save an read text files
  print text, search within text
  close with return text to multiline controls
  try to open a text from a multiline, modify and Close With Return Text
  
- Resizable Response Windows i.e. w_txt_sh



--------------------------------------------------------------------------
There is a very good third party tool for browsing and analysing existing
PB Applications.
It is called PBBrowse and available at http://www.oowidgets.com/
Costs for a license is more than accetable (49.00 $)
I'm using this for years and it helps me a lot.  
-----------------------------------------------------------------------
Regards
Martin Bremer
E-Mail: m-bremer@wellcom.de (prefered)
or   martinbremer@compuserve.com  
 //EOF