Hey guys I'm trying to use a replace function in a query in my birt report and it doesn't seem to be working. When I run this query outside BIRT it works fine. I have my query in the open function of my dataset. Here's what I have (maybe the issue is because I'm trying to replace something that has '\\' in it???):<br />
<br />
<br />
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());<br />
maximoDataSet.open();<br />
<br />
var sqlText = new String();<br />
<br />
sqlText = "select <strong class='bbc'>replace(filename, '\\camsprdactjam1\d$', '<a class='bbc_url' href='
http://camsengprd:7001'>http://camsengprd:7001</a>') filename</strong>, lirr_seq, description, ownertable, location, reference, lirr_imglayout from ( " +<br />
"SELECT urlname filename, doclinks.lirr_seq, lirr_desc description, doclinks.OWNERTABLE, " +<br />
" lirr_photoloc location, '' reference, lirr_imglayout " +<br />
" FROM docinfo, workorder, doclinks " +<br />
" WHERE wonum = '" + params["wonum"] + "' " +<br />
" AND docinfo.DOCINFOID = doclinks.DOCINFOID " +<br />
" AND workorder.workorderid = doclinks.ownerid " +<br />
" and docinfo.doctype = 'PHOTOS' " +<br />
" and doclinks.ownertable = 'WORKORDER' " +<br />
" and workorder.siteid = 'ES' " +<br />
"union " +<br />
"select max(filename) filename, min(lirr_seq) lirr_seq, wm_concat(description) description, ownertable, " + <br />
"wm_concat(DISTINCT location) location, lirr_getphotoref(lirr_wonum, sourcefile) reference, lirr_imglayout from( " +<br />
"select urlname filename, " +<br />
" v_docs.lirr_seq, " + <br />
" v_docs.lirr_desc description, " +<br />
" v_docs.ownertable, " +<br />
" v_docs.lirr_photoloc LOCATION, " + <br />
" v_docs.description sourcefile, " + <br />
" v_docs.document, " +<br />
" v_docs.lirr_imglayout, " +<br />
" real_m.lirr_wonum " +<br />
" from " +<br />
" (SELECT MAX (measurementid) measurementid, lirr_wonum, assetnum, " +<br />
" metername, siteid " +<br />
" FROM measurement GROUP BY lirr_wonum, assetnum, metername, siteid) real_m, " + <br />
" (SELECT a.assetnum, b.lirr_wonum, b.metername, " +<br />
" c.LIRR_SEQ, c.ownertable,c.lirr_desc, c.lirr_photoloc, c.LIRR_IMGLAYOUT, " +<br />
" d.doctype, d.docinfoid, d.document, d.urlname, d.description " +<br />
" FROM asset a, measurement b, doclinks c, docinfo d " +<br />
" WHERE a.assetnum = b.assetnum " +<br />
" AND a.siteid = b.siteid " +<br />
" AND b.lirr_wonum = c.lirr_reference " +<br />
" AND c.docinfoid = d.docinfoid " +<br />
" AND c.ownertable = 'MEASUREMENT' " +<br />
" AND d.doctype = 'PHOTOS' " +<br />
" AND c.ownerid = b.measurementid) v_docs " +<br />
" where real_m.lirr_wonum = v_docs.lirr_wonum " +<br />
" AND real_m.assetnum = v_docs.assetnum " +<br />
" AND real_m.metername = v_docs.metername " +<br />
" AND real_m.lirr_wonum = '" + params["wonum"] + "' " +<br />
" ) " +<br />
" group by lirr_wonum, sourcefile, ownertable, lirr_imglayout " +<br />
")" ;<br />
<br />
<br />
maximoDataSet.setQuery(sqlText);