00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef Report_HPP
00012 #define Report_HPP
00013
00014 #include "read_write_base.hpp"
00015 #include "lookup.hpp"
00016 #include "Composite_Query.hpp"
00017
00018 class Report_Obj: public read_write_base
00019 {
00020
00021 public:
00022 identifier Id;
00023 llong Site_Id;
00024 llong Template_Id;
00025 llong Query_Id;
00026 llong Composite_Query;
00027 string Name;
00028 llong Media_Type;
00029 string Category;
00030 bool Show_In_List;
00031 int Formatting_Modulus;
00032 int Items_Per_Page;
00033 string External_Program;
00034
00035 Report_Obj():read_write_base()
00036 ,Id(0LL)
00037 ,Site_Id(0LL)
00038 ,Template_Id(0LL)
00039 ,Query_Id(0LL)
00040 ,Composite_Query(0LL)
00041 ,Name("")
00042 ,Media_Type(0LL)
00043 ,Category("")
00044 ,Show_In_List(true)
00045 ,Formatting_Modulus(0)
00046 ,Items_Per_Page(0)
00047 ,External_Program("")
00048 {
00049
00050 data_name("Report");
00051
00052 addDXMap( new llongXfer("Id", &Id ));
00053 addDXMap( new llongXfer("Site_Id", &Site_Id ));
00054 addDXMap( new llongXfer("Template_Id", &Template_Id ));
00055 addDXMap( new llongXfer("Query_Id", &Query_Id ));
00056 addDXMap( new llongXfer("Composite_Query", &Composite_Query ));
00057 addDXMap( new stringXfer("Name", &Name ));
00058 addDXMap( new llongXfer("Media_Type", &Media_Type ));
00059 addDXMap( new stringXfer("Category", &Category ));
00060 addDXMap( new boolXfer("Show_In_List", &Show_In_List ));
00061 addDXMap( new intXfer("Formatting_Modulus", &Formatting_Modulus ));
00062 addDXMap( new intXfer("Items_Per_Page", &Items_Per_Page ));
00063 addDXMap( new stringXfer("External_Program", &External_Program ));
00064 }
00065
00066 string getTemplatePath(void)
00067 {
00068 ocString q = "Select Path from Report_Templates where Id = ";
00069 q.append(Template_Id);
00070 return tableLookup ( q );
00071 }
00072
00073
00074 string getQuery(void)
00075 {
00076 if( Query_Id )
00077 {
00078 ocString q = "Select Query from Query where Id = ";
00079 q.append(Query_Id);
00080 return tableLookup ( q );
00081 }
00082 else
00083 {
00084 return "";
00085 }
00086
00087 }
00088 string getMediaType(void)
00089 {
00090 ocString q = "Select Name from Report_Type where Id = ";
00091 q.append(Media_Type);
00092 return tableLookup ( q );
00093 }
00094
00095 string getCompositeQuery(void)
00096 {
00097 string result;
00098 Composite_Query_Obj cq;
00099 cq.key(Composite_Query);
00100 if( cq.get_data() )
00101 {
00102 result = cq.asSQL();
00103 }
00104 return result;
00105 }
00106
00107 };
00108 #endif
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123