Diff
Not logged in

Differences From Artifact [139230cc9a]:

To Artifact [cf7dc16d8f]:


996
997
998
999
1000
1001
1002
1003

1004
1005
1006
1007
1008
1009
1010
1011

1012
1013
1014
1015








1016
1017
1018

1019
1020
1021
1022
1023
1024
1025
996
997
998
999
1000
1001
1002

1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023

1024
1025
1026
1027
1028
1029
1030
1031







-
+








+

-
-
-
+
+
+
+
+
+
+
+


-
+







}

/*
** Generate a report.  The rn query parameter is the report number.
** The output is written to stdout as flat file. The zFilter paramater
** is a full WHERE-condition.
*/
void rptshow( int rn, const char *zSep, const char *zFilter ){
void rptshow( const char *zRep, const char *zSep, const char *zFilter ){
  Stmt q;
  char *zSql;
  char *zTitle;
  char *zOwner;
  char *zClrKey;
  char *zErr1 = 0;
  char *zErr2 = 0;
  int count = 0;
  int rn;

  /* view_add_functions(tabs); */
  db_prepare(&q,
    "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
  rn = atoi(zRep);
  if( rn ){
    db_prepare(&q,
     "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
  }else{
    db_prepare(&q,
     "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE title='%s'", zRep);
  }
  if( db_step(&q)!=SQLITE_ROW ){
    db_finalize(&q);
    fossil_fatal("unkown report format(%d)!",rn);
    fossil_fatal("unkown report format(%s)!",zRep);
  }
  zTitle = db_column_malloc(&q, 0);
  zSql = db_column_malloc(&q, 1);
  zOwner = db_column_malloc(&q, 2);
  zClrKey = db_column_malloc(&q, 3);
  db_finalize(&q);
  if( zFilter ){