Example #1
0
def makertf():
    import gluon.contrib.pyrtf as q
    doc = q.Document()
    section = q.Section()
    doc.Sections.append(section)
    section.append('Section Title')
    section.append('web2py is great. ' * 100)
    response.headers['Content-Type'] = 'text/rtf'
    return q.dumps(doc)
def makertf():
    import gluon.contrib.pyrtf as q
    doc=q.Document()
    section=q.Section()
    doc.Sections.append(section)
    section.append('Este é um teste de txt')
    section.append('Muito doido. '*100)
    response.headers['Content-Type']='text/rtf'
    return q.dumps(doc)
Example #3
0
def makertf():
    import gluon.contrib.pyrtf as q

    doc = q.Document()
    section = q.Section()
    doc.Sections.append(section)
    section.append("Section Title")
    section.append("web2py is great. " * 100)
    response.headers["Content-Type"] = "text/rtf"
    return q.dumps(doc)
Example #4
0
def case_rtf():

    import gluon.contrib.pyrtf as q
    doc=q.Document()
    ss= doc.StyleSheet
    section=q.Section()
    doc.Sections.append(section)
    para_props = q.ParagraphPS(tabs = [q.TabPS(width= q.TabPS.DEFAULT_WIDTH *3),
                                       q.TabPS(width= q.TabPS.DEFAULT_WIDTH *6),
                                       q.TabPS(width=q.TabPS.DEFAULT_WIDTH *8)])
    p = q.Paragraph(ss.ParagraphStyles.Heading1, para_props)
    p.append('Independent Counsel Case Tracking')
    section.append(p)
    rows = db().select(db.case_master.ALL)
   
    p = q.Paragraph(ss.ParagraphStyles.Heading2, para_props)
    p.append("Case Number", q.TAB, "Member Name", q.TAB, "Assigned Date")
    section.append(p)   
    for row in rows:
        p = q.Paragraph(ss.ParagraphStyles.Normal, para_props)
        p.append(row.case_number,q.TAB, row.member_id.last_name, q.TAB, str(row.date_assigned) )
        section.append(p)
    response.headers['Content-Type']='text/rtf'
    return q.dumps(doc)