<!-- gda-report.dtd
     Copyright (C) 2000-2003 Carlos Perello Marin <carlos@gnome-db.org>
                             Gerhard Dieringer
			     Santi Camps <santi@gnome-db.org>

     Based on the Mutiny Bay Software's
     reportviewer's DTD (http://www.mutinybaysoftware.com)
-->

<!ENTITY % query SYSTEM "/usr/X11R6/share/libgda/xml/gda-xml-query.dtd">
%query;


<!ENTITY % reportelement   "line|label|special|repfield|picture">
<!ENTITY % positionfreq    "first|inside|last|allbutfirst|allbutlast|firstandlast|all">
<!ENTITY % pagefreq        "even|odd|all">
<!ENTITY % linestyle       "none|solid|dash|dot|dashdot|dashdotdot">
<!ENTITY % fontweight      "light|normal|semibold|bold|black">
<!ENTITY % halignment      "standard|left|center|right">
<!ENTITY % valignment      "top|center|bottom">
<!ENTITY % datatype        "string|numeric|date">

<!ELEMENT report (querylist?, reportheader?, pageheaderlist?, dataheader?,  datalist?, 
                  datafooter?,   pagefooterlist?, reportfooter?)>
<!ATTLIST report
  reportstyle     (form|list)       "list"
  pagesize        (A3|A4|A5|A6|B3|B4|B5|B6|letter|legal|executive) "A4"
  orientation     (portrait|landscape) "portrait"
  units           (inch|cm|pt)      "cm"
  topmargin       NMTOKEN           "2.5"
  bottommargin    NMTOKEN           "2.5"
  leftmargin      NMTOKEN           "2.5"
  rightmargin     NMTOKEN           "2.5"
  bgcolor         NMTOKENS          "255 255 255"
  fgcolor         NMTOKENS          "0 0 0"
  bordercolor     NMTOKENS          "0 0 0"
  borderwidth     NMTOKEN           "0.05"
  borderstyle     (%linestyle;)     "none"
  fontfamily      NMTOKEN           "Helvetica"
  fontsize        NMTOKEN           "10"
  fontweight      (%fontweight;)    "normal"
  fontitalic      (yes|no)          "no"
  halignment      (%halignment;)    "standard"
  valignment      (%valignment;)    "center"
  wordwrap        (yes|no)          "no"
  negvaluecolor   NMTOKENS          "255 0 0"
  dateformat      CDATA             "%d.%m.%Y"
  precision       NMTOKEN           "2"
  currency        CDATA             "EUR"
  commaseparator  (yes|no)          "no"
  linewidth       NMTOKEN           "0.05"
  linecolor       NMTOKENS          "0 0 0"
  linestyle       (%linestyle;)     "solid"
>

<!ELEMENT querylist ((query|sqlquery)+)>

<!ELEMENT sqlquery (#PCDATA)>
<!ATTLIST sqlquery
  id		  ID		    #IMPLIED
>

<!ELEMENT reportheader ((%reportelement;)+)>
<!ATTLIST reportheader 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  newpage         (yes|no)          "no"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT reportfooter ((%reportelement;)+)>
<!ATTLIST reportfooter 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  newpage         (yes|no)          "no"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>

<!-- the pageheader/-footer are only printed, if both frequency conditions are true
     If the report has only one page, then first and last are both true
     The combination positionfreq="first" pagefreq="even" is never true
-->

<!ELEMENT pageheaderlist (pageheader+)>

<!ELEMENT pageheader ((%reportelement;)+)>
<!ATTLIST pageheader 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  positionfreq   (%positionfreq;)   "all"
  pagefreq       (%pagefreq;)       "all"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT pagefooterlist (pagefooter+)>

<!ELEMENT pagefooter ((%reportelement;)+)>
<!ATTLIST pagefooter 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  positionfreq   (%positionfreq;)   "all"
  pagefreq       (%pagefreq;)       "all"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!-- the dataheader/-footer ist like a groupheader/-footer for a virtuell group,
     that contains all the data
-->
<!ELEMENT dataheader ((%reportelement;)+)>
<!ATTLIST dataheader 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT datafooter ((%reportelement;)+)>
<!ATTLIST datafooter 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT datalist (reportdata+)>

<!ELEMENT reportdata (detail|(groupheader?,reportdata,groupfooter?))>

<!ELEMENT detail ((%reportelement;)+, reportdata*)>
<!ATTLIST detail 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  query           IDREF             #REQUIRED
  height          NMTOKEN           "2.0"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT groupheader ((%reportelement;)+)>
<!ATTLIST groupheader 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  newpage         (yes|no)          "no"
  groupvar        NMTOKEN           #REQUIRED
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT groupfooter ((%reportelement;)+)>
<!ATTLIST groupfooter 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  height          NMTOKEN           "2.0"
  newpage         (yes|no)          "no"
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT picture EMPTY>
<!ATTLIST picture 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  x               NMTOKEN           #REQUIRED
  y               NMTOKEN           #REQUIRED
  width           NMTOKEN           #REQUIRED
  height          NMTOKEN           #REQUIRED
  size            (cut|scale)       "scale"
  aspectratio     (fixed|float)     "fixed"
  format          NMTOKEN           #REQUIRED
  source          (intern|extern)   #REQUIRED
  data            CDATA             #REQUIRED
>


<!ELEMENT line EMPTY>
<!ATTLIST line 
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  x1              NMTOKEN           #REQUIRED
  y1              NMTOKEN           #REQUIRED
  x2              NMTOKEN           #REQUIRED
  y2              NMTOKEN           #REQUIRED
  linewidth       NMTOKEN           #IMPLIED
  linecolor       NMTOKENS          #IMPLIED
  linestyle       (%linestyle;)     #IMPLIED
>


<!ELEMENT label EMPTY>
<!ATTLIST label 
  id		  ID		    #IMPLIED
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  text            CDATA             #REQUIRED
  x               NMTOKEN           #REQUIRED
  y               NMTOKEN           #REQUIRED
  width           NMTOKEN           #REQUIRED
  height          NMTOKEN           #REQUIRED
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%valignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
>


<!ELEMENT repfield EMPTY>
<!ATTLIST repfield
  id		  ID		    #IMPLIED
  active          (yes|no)          "yes"
  visible         (yes|no)          "yes"
  query           IDREF             #REQUIRED 
  value           NMTOKEN           #REQUIRED 
  x               NMTOKEN           #REQUIRED
  y               NMTOKEN           #REQUIRED
  width           NMTOKEN           #REQUIRED
  height          NMTOKEN           #REQUIRED
  datatype        (%datatype;)      #REQUIRED
  bgcolor         NMTOKENS          #IMPLIED
  fgcolor         NMTOKENS          #IMPLIED
  bordercolor     NMTOKENS          #IMPLIED
  borderwidth     NMTOKEN           #IMPLIED
  borderstyle     (%linestyle;)     #IMPLIED
  fontfamily      NMTOKEN           #IMPLIED
  fontsize        NMTOKEN           #IMPLIED
  fontweight      (%fontweight;)    #IMPLIED
  fontitalic      (yes|no)          #IMPLIED
  halignment      (%halignment;)    #IMPLIED
  valignment      (%halignment;)    #IMPLIED
  wordwrap        (yes|no)          #IMPLIED
  dateformat      CDATA             #IMPLIED
  precision       NMTOKEN           #IMPLIED
  currency        CDATA             #IMPLIED
  negvaluecolor   NMTOKENS          #IMPLIED
  commaseparator  (yes|no)          #IMPLIED
>


<!--
  The text attribute of element special is a format string which may contain some
  of the following functions:
  %D  date in format dateformat
  %d  day
  %m  month
  %y  year (yy)
  %Y  year (yyyy)
  %p  page number
  %t  total number of pages

  The date related options could be used to specify the format of dateformat
-->

<!ELEMENT special EMPTY>
<!ATTLIST special
  active          (yes|no)            "yes"
  visible         (yes|no)            "yes"
  text            CDATA               #REQUIRED 
  x               NMTOKEN             #REQUIRED
  y               NMTOKEN             #REQUIRED
  width           NMTOKEN             #REQUIRED
  height          NMTOKEN             #REQUIRED
  bgcolor         NMTOKENS            #IMPLIED
  fgcolor         NMTOKENS            #IMPLIED
  bordercolor     NMTOKENS            #IMPLIED
  borderwidth     NMTOKEN             #IMPLIED
  borderstyle     (%linestyle;)       #IMPLIED
  fontfamily      NMTOKEN             #IMPLIED
  fontsize        NMTOKEN             #IMPLIED
  fontweight      (%fontweight;)      #IMPLIED
  fontitalic      (yes|no)            #IMPLIED
  halignment      (%halignment;)      #IMPLIED
  valignment      (%halignment;)      #IMPLIED
  wordwrap        (yes|no)            #IMPLIED
  dateformat      CDATA               #IMPLIED
>
