Forums
This topic is locked
Replacing characters in a character string???
Posted 09 Apr 2002 08:06:52
1
has voted
09 Apr 2002 08:06:52 David Houghland posted:
I am creating an application in UD, using data from SQL Server and passing the parameter data to Crystal Enterprise. The query string is as follows.annualreport.rpt?promptex-PropertyID=<=Session("PropertyID"%>
The resulting string when opening the .rpt file would look something like this:
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
The problem occurs because the PropertyID session variable is actually data coming from SQL Server which has been assigned a uniqueidentifier (GUID). Crystal Reports will not recognize the string and I am trying to figure out a workaround. I have been able to determine that the following query string would bring about positive results.
THIS FORMAT DOES NOT WORK
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
THIS FORMAT DOES WORK, BUT I AM NOT SURE HOW TO ADD QUOTES AND TAKE AWAY BRACKETS
annualreport.rpt?promptex-PropertyID="B7233-3033-G3344-302303-0300"
In short, I am trying to replace the front '{' and back '}' brackets with quotation marks. I thought about using the REPLACE function, but am not having much luck scripting it. Any help is greatly appreciated.
Replies
Replied 09 Apr 2002 09:05:00
09 Apr 2002 09:05:00 Viktor Farcic replied:
<%
Dim strID
strID = Session("PropertyID"
strID = Replace(strID, "{", ""
strID = Replace(strID, "}", ""
%>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I am creating an application in UD, using data from SQL Server and passing the parameter data to Crystal Enterprise. The query string is as follows.
annualreport.rpt?promptex-PropertyID=<=Session("PropertyID"%>
The resulting string when opening the .rpt file would look something like this:
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
The problem occurs because the PropertyID session variable is actually data coming from SQL Server which has been assigned a uniqueidentifier (GUID). Crystal Reports will not recognize the string and I am trying to figure out a workaround. I have been able to determine that the following query string would bring about positive results.
THIS FORMAT DOES NOT WORK
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
THIS FORMAT DOES WORK, BUT I AM NOT SURE HOW TO ADD QUOTES AND TAKE AWAY BRACKETS
annualreport.rpt?promptex-PropertyID="B7233-3033-G3344-302303-0300"
In short, I am trying to replace the front '{' and back '}' brackets with quotation marks. I thought about using the REPLACE function, but am not having much luck scripting it. Any help is greatly appreciated.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
Dim strID
strID = Session("PropertyID"
strID = Replace(strID, "{", ""
strID = Replace(strID, "}", ""
%>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I am creating an application in UD, using data from SQL Server and passing the parameter data to Crystal Enterprise. The query string is as follows.
annualreport.rpt?promptex-PropertyID=<=Session("PropertyID"%>
The resulting string when opening the .rpt file would look something like this:
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
The problem occurs because the PropertyID session variable is actually data coming from SQL Server which has been assigned a uniqueidentifier (GUID). Crystal Reports will not recognize the string and I am trying to figure out a workaround. I have been able to determine that the following query string would bring about positive results.
THIS FORMAT DOES NOT WORK
annualreport.rpt?promptex-PropertyID={B7233-3033-G3344-302303-0300}
THIS FORMAT DOES WORK, BUT I AM NOT SURE HOW TO ADD QUOTES AND TAKE AWAY BRACKETS
annualreport.rpt?promptex-PropertyID="B7233-3033-G3344-302303-0300"
In short, I am trying to replace the front '{' and back '}' brackets with quotation marks. I thought about using the REPLACE function, but am not having much luck scripting it. Any help is greatly appreciated.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager