Business Objects XI SDK Example, Part 2

Continued from Business Objects XI SDK Example, part 1

In this post, we'll go over how we can use a python script to process BO XI Java SDK CSV output.

The python script makes an http request to the web app and receives the contents.

The configuration file stores information to email a report. It contains the following information:



to = ", "
sentfrom = ""

User = "testuser "
Password = "password"
docIdentifier = "442005"

The contents of the config file should be self-explanatory. It allows for the option of removing the header report from the dat

The "#" is the python comment symbol.

Python is case sensitive. Be aware of this when creating configuration files.

The above code is read inline from the python script (it is executable python code). The config files sets the appropriate values that are needed by

Here's the contents of the python script:

import sys
import smtplib
from email.MIMEText import MIMEText
import urllib



CSV_EXTRACT_URL = "http://dev1:8080/dpvalues/loginforward.jsp"

auth = "secEnterprise"
CMS = "ersdev1"

to = ""
sentfrom = ""

config_file = sys.argv[1]

#read in config info, and overwrite defaults set above

params = urllib.urlencode({'CMS': CMS, 'User': User, 'Password': Password, 'auth':auth, 'docIdentifier':docIdentifier })

print str(params)

f = urllib.urlopen(CSV_EXTRACT_URL, params)
raw =

rows = raw.split("\n")
rows = rows[1:]

buf = ""
for x in rows:
cln = x.strip()
if len(cln) < 3:
sp = cln[1:-1].split('";"')
buf += COLUMN_SEPARATOR.join( sp ) + "\n"

msg = MIMEText(buf)

msg['Subject'] = 'csv values'
msg['From'] = sentfrom
msg['To'] = to

s = smtplib.SMTP()
s.sendmail(sentfrom, [to], msg.as_string())

Continued on Business Objects XI SDK Example, part 3

Filed under by

Spread the word Digg Furl Reddit

Permalink • Print • Comment

WordPress database error: [Table './boguru/wp_comments' is marked as crashed and last (automatic?) repair failed]
SELECT * FROM wp_comments WHERE comment_post_ID = '18' AND comment_approved = '1' ORDER BY comment_date