Return TypeFunction nameArguments
voidhdsTable::Generate(hzChain&,hzHttpEvent*,unsigned int&,)

Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp

Function Logic:

0:START 1:hzChain::AddByte 2:m_Criteria==all 3:hdbObjRepos::Count nFound 4:hdbObjRepos::Select hdbIdset::Count nFound 5:nFound==0 6:pVE; 7:hdsVE::Generate 8:hzChain::Printf hzChain::Printf hzChain::Printf hzChain::Printf items ci 9:ci.Valid(); 10:hzList::Iter::Element col hzChain::Printf 11:items hdbObjRepos::Class hdbObject::Init objId 12:objId<=nFound; 13:hdbObjRepos::Fetch rc 14:rc!=E_OK 15:items ci 16:ci.Valid(); 17:hzList::Iter::Element col hdbObjRepos::Class hdbClass::GetMember hdbObject::GetValue hzAtom::IsSet 18:atom.IsSet() 19:hzAtom::Str value 20:hzString::Clear 21:col.m_nSize 22:hzChain::Printf 23:hzChain::Printf 24:items 25:items 26: No text

Function body:

void hdsTable::Generate (hzChain& C, hzHttpEvent* pE, unsigned int& nLine)
{
   _hzfunc("hdsTable::Generate") ;
   hzList<hdsCol>::Iter    ci ;
   hzVect<uint32_t>        items ;
   hdbObject   obj ;
   hdbIdset    srchResult ;
   hdsCol      col ;
   hdsVE*      pVE ;
   hzAtom      atom ;
   hzString    value ;
   uint32_t    nFound ;
   uint32_t    objId ;
   hzEcode     rc ;
   C.AddByte(CHAR_NL) ;
   if (m_Criteria == "all")
       nFound = m_pRepos->Count() ;
   else
   {
       m_pRepos->Select(srchResult, *m_Criteria) ;
       nFound = srchResult.Count() ;
   }
   if (nFound == 0)
   {
       for (pVE = m_pNone ; pVE ; pVE = pVE->Sibling())
           pVE->Generate(C, pE, nLine) ;
   }
   else
   {
       C.Printf("<table width="%d" align="center" border="0" cellspacing="0" cellpadding="0" class="%s">\n"            , m_nWidth, *m_CSS) ;
       C.Printf("<tr valign="top" height="20"><td>Listing %d objects</td></tr>\n"    , nFound) ;
       C.Printf("<tr valign="top" height="%d">\n\t<td>\n"    , m_nHeight) ;
       C.Printf("\t<table width="%d" align="center" border="1" cellspacing="1" cellpadding="1" class="%s">\n"            , m_nWidth, *m_CSS) ;
       C << "\t<tr>\n" ;
       for (ci = m_Cols ; ci.Valid() ; ci++)
       {
           col = ci.Element() ;
           C.Printf("\t<th width="%d">%s</th>\n"  , col.m_nSize, *col.m_Title) ;
       }
       C << "\t</tr>\n" ;
       obj.Init(m_pRepos->Class()) ;
       for (objId = 1; objId <&eq; nFound ; objId++)
       {
           rc = m_pRepos->Fetch(obj, objId) ;
           if (rc != E_OK)
               break ;
           C << "\t<tr>" ;
           for (ci = m_Cols ; ci.Valid() ; ci++)
           {
               col = ci.Element() ;
               obj.GetValue(atom, m_pRepos->Class()->GetMember(col.m_mbrNo)) ;
               if (atom.IsSet())
                   value = atom.Str() ;
               else
                   value.Clear() ;
               if (col.m_nSize)
                   C.Printf("<td width="%d">%s</td>"  , col.m_nSize, *value) ;
               else
                   C.Printf("<td>%s</td>", *value) ;
           }
           C << "</tr>\n" ;
       }
       C << "</table>\n" ;
   }
}