Home
Extended ECM
API, SDK, REST and Web Services
replacing tab characters in a webreport
Kristy_Shen
Currently, I have a webreport which can export the data returned from the livereport into Excel. It uses tabs as delimiters. Thus, I need to replace any tab characters that are coming back from the database with spaces. I tried to use the REPLACE attribute in the Livelink tags but it doesn't recognize the tab character I copied into the webreport. I also tried to use:[LL_REPTAG=Details ESCAPESTR REPLACE: ESCAPESTR REPLACE:"\t":" " /]This works, but because I'm using ESCAPESTR, any quotes show up as the escaped version \"Is there some way I can replace the tabs with spaces, but not cause other characters from displaying as their escaped versions? I've also tried to do the replace in the sql but some of the fields are ntext and the built-in sql replace function is not supported for ntext. So it would be best to do it within the webreport.
Find more posts tagged with
Comments
Greg_Petti
Message from Greg Petti via eLinkHi,One thing you could try is placing double quotes around each cell:"[LL_REPTAG=Details /]"So that Excel will ignore any characters within the quotes. Out ofcuriosity is there any particular reason you are using tabs instead ofcommas? There is a sub-tag (which appears not to be in thedocumentation) called ESCAPECSV which can be used to automatically quotecells that have commas in them. This can also be used asESCAPECSV:ALLCELLS which would also make sure that any double quotes inthe cell would be appropriately escaped. One other way to manage what you are trying to do below would be to usethe PATCHANGE sub-tag that allows pattern matching. This would probablylook like this:[LL_REPTAG=Details PATCHANGE:
@t
:" " /]Greg-----Original Message-----From: eLink Discussion: Livelink LiveReports Discussion[mailto:livereportsdiscussion@elinkkc.opentext.com] Sent: January-08-08 8:09 AMTo: eLink RecipientSubject: replacing tab characters in a webreportreplacing tab characters in a webreportPosted by Shen, Kristy on 01/08/2008 10:02 AMCurrently, I have a webreport which can export the data returned fromthe livereport into Excel. It uses tabs as delimiters. Thus, I need to replace any tab characters that are coming back from thedatabase with spaces. I tried to use the REPLACE attribute in theLivelink tags but it doesn't recognize the tab character I copied intothe webreport. I also tried to use:[LL_REPTAG=Details ESCAPESTR REPLACE: ESCAPESTR REPLACE:"\t":" " /]This works, but because I'm using ESCAPESTR, any quotes show up as theescaped version \"Is there some way I can replace the tabs with spaces, but not causeother characters from displaying as their escaped versions? I've alsotried to do the replace in the sql but some of the fields are ntext andthe built-in sql replace function is not supported for ntext. So itwould be best to do it within the webreport.[To reply to this thread, use your normal E-mail reply function.]============================================================Discussion: Livelink LiveReports Discussion
https://knowledge.opentext.com/knowledge/llisapi.dll/open/Livelink_LiveReports_DiscussionLivelink
Server:
https://knowledge.opentext.com/knowledge/llisapi.dllTo
Unsubscribe from this Discussion, send an e-mail tounsubscribe.livereportsdiscussion@elinkkc.opentext.com.
Kristy_Shen
Hi Greg:Thank you so much foryour quick response! The reason why I'm using tabs as a delimiter instead of commas is because we had issues in the past where there were commas in the data. It was thought that tabs were fine since you can't type them into a text field. However users have bypassed that by copying and pasting from word files that have tabs chars in them. We did not know at the time that commas were being used as a delimiter that ESCAPECSV exists (it's not in the documentation). Do you know what version of webreports this is available in?Anyways, I tried your suggestion of using PATCHANGE:
@t
:" " to replace tha tabs, however it says that PATCHANGE is not supported by our version of webreports (3.6.0)I also tried putting double quotes around each cell, and I still get the quotes displayed as \". I'm still not sure what you mean by "So that Excel will ignore any characters within the quotes." Is there a typo there? Do you mean "so that Excel will ignore any tab characters within the quotes"? Because if it ignores any chars, no data would be shown.
Greg_Petti
Message from Greg Petti via eLinkHi, I think you will need at least WebReports 4.0 to use ESCAPECSV orPATCHANGE (the latest version is 4.1.0). What I meant to say is that Excel should ignore any ambiguous characters(e.g. commas or tabs that may be used as delimiters) if the cell isquoted. This approach should work provided your data doesn't include anydouble quotes. Greg-----Original Message-----From: eLink Discussion: Livelink LiveReports Discussion[mailto:livereportsdiscussion@elinkkc.opentext.com] Sent: January-09-08 9:10 AMTo: eLink RecipientSubject: RE replacing tab characters in a webreportRE replacing tab characters in a webreportPosted by Shen, Kristy on 01/09/2008 11:04 AMHi Greg:Thank you so much foryour quick response! The reason why I'm using tabs as a delimiter instead of commas isbecause we had issues in the past where there were commas in the data.It was thought that tabs were fine since you can't type them into a textfield. However users have bypassed that by copying and pasting from wordfiles that have tabs chars in them. We did not know at the time thatcommas were being used as a delimiter that ESCAPECSV exists (it's not inthe documentation). Do you know what version of webreports this isavailable in?Anyways, I tried your suggestion of using PATCHANGE:
@t
:" " to replacetha tabs, however it says that PATCHANGE is not supported by our versionof webreports (3.6.0)I also tried putting double quotes around each cell, and I still get thequotes displayed as \". I'm still not sure what you mean by "So thatExcel will ignore any characters within the quotes." Is there a typothere? Do you mean "so that Excel will ignore any tab characters withinthe quotes"? Because if it ignores any chars, no data would be shown.[To reply to this thread, use your normal E-mail reply function.]============================================================Topic: replacing tab characters in a webreport
https://knowledge.opentext.com/knowledge/llisapi.dll/open/13690093Discussion
: Livelink LiveReports Discussion
https://knowledge.opentext.com/knowledge/llisapi.dll/open/Livelink_LiveReports_DiscussionLivelink
Server:
https://knowledge.opentext.com/knowledge/llisapi.dllTo
Unsubscribe from this Discussion, send an e-mail tounsubscribe.livereportsdiscussion@elinkkc.opentext.com.
Kristy_Shen
Hi Greg:I tried the method of quoting the cell, but since my data has quotes, I tried to use REPLACE:'"':'\"' (single quote around the double quote, and single quotes around the \" escaped quote character). But what ends up happening is that the quotes in the data are ignored and do not get displayed in Excel. The tab character no longer causes a skip in the columns but a unknown character (a square) gets displayed in place of the tab. So, other than having the version 4.1.0, is there any other way to replace tabs in Excel?
Greg_Petti
Message from Greg Petti via eLinkHi, The correct way of escaping quotes for Excel is to double them up. E.g. REPLACE:'"':'""'Try that and let me know. Greg -----Original Message-----From: eLink Discussion: Livelink LiveReports Discussion[mailto:livereportsdiscussion@elinkkc.opentext.com] Sent: January-15-08 7:54 AMTo: eLink RecipientSubject: RE replacing tab characters in a webreportRE replacing tab characters in a webreportPosted by Shen, Kristy on 01/15/2008 09:45 AMHi Greg:I tried the method of quoting the cell, but since my data has quotes, Itried to use REPLACE:'"':'\"' (single quote around the double quote,and single quotes around the \" escaped quote character). But what endsup happening is that the quotes in the data are ignored and do not getdisplayed in Excel. The tab character no longer causes a skip in thecolumns but a unknown character (a square) gets displayed in place ofthe tab. So, other than having the version 4.1.0, is there any other way toreplace tabs in Excel?[To reply to this thread, use your normal E-mail reply function.]============================================================Topic: replacing tab characters in a webreport
https://knowledge.opentext.com/knowledge/llisapi.dll/open/13690093Discussion
: Livelink LiveReports Discussion
https://knowledge.opentext.com/knowledge/llisapi.dll/open/Livelink_LiveReports_DiscussionLivelink
Server:
https://knowledge.opentext.com/knowledge/llisapi.dllTo
Unsubscribe from this Discussion, send an e-mail tounsubscribe.livereportsdiscussion@elinkkc.opentext.com.
Kristy_Shen
That worked! Thanks Greg :DNow, the tab char is just displayed as a square character, and all my quotes, appostrophes and commas are showing up correctly.Thanks again!