Showing posts with label dynamic. Show all posts
Showing posts with label dynamic. Show all posts

Sunday, March 25, 2012

custom(and dynamic) record fields query

Hello,
I need to create a query that depends on custom fields (virtual).
First I'll try to outline the background.
I got Nodes table, that has NodeID field, and other (not really important)
fields like name, some boolean fields and so on.
Lets define node as an item for sale (just for the example purposes).
User of the application can create custom attribute values for each each
item (node).
To make the attribute names consistant through application I got another
table Attributes (AttID, AttributeName)
And the last table is association table between Node and Attributes
containing the value of the attribute as well.
I'd like to get following resultset:
NodeID, NodeName, CustomField1, CustomField2, CustomField3, ... and so on
(names of the fields would depend on Attribute name)
with values:
1,FirstNode, 'one of the values', 'another value', NULL, ...
2,SecondNode, NULL, NULL, NULL , ...
3,ThirdNode, NULL, NULL, 'some value', ...
SQL for creation such tables would look like (I ommited constrains and
indexes for siplicity):
CREATE TABLE Nodes (
NodeID INT IDENTITY (1, 1) NOT NULL,
NodeName NVARCHAR(255) NULL
)
CREATE TABLE Attributes (
AttID INT IDENTITY (1, 1) NOT NULL,
AttributeName NVARCHAR(50) NOT NULL
)
CREATE TABLE NodeAttr (
NodeID INT NOT NULL,
AttID INT NOT NULL,
Value NVARCHAR(255)
)
some data insertion:
INSERT INTO Nodes(NodeName) VALUES ('FirstNode')
INSERT INTO Nodes(NodeName) VALUES ('SecondNode')
INSERT INTO Nodes(NodeName) VALUES ('ThirdNode')
INSERT INTO Nodes(NodeName) VALUES ('FourthNode')
INSERT INTO Nodes(NodeName) VALUES ('FifthNode')
INSERT INTO Attributes (AttributeName) VALUES ('CustomField1')
INSERT INTO Attributes (AttributeName) VALUES ('CustomField2')
INSERT INTO Attributes (AttributeName) VALUES ('CustomField3')
INSERT INTO NodeAttr (NodeID,AttID,Value) VALUES (1,1,'My Value for Field1')
INSERT INTO NodeAttr (NodeID,AttID,Value) VALUES (1,2,'My Value for Field2')
INSERT INTO NodeAttr (NodeID,AttID,Value) VALUES (1,3,'My Value for Field3')
INSERT INTO NodeAttr (NodeID,AttID,Value) VALUES (3,3,'My Value for Field3
in third node')
Second I describe my approach to the problem.
I created function that retrieves data based on nodeID and Attribute name:
CREATE FUNCTION myfun(@.NodeID INT, @.AttributeName NVARCHAR(50))
RETURNS NVARCHAR(255)
AS
BEGIN
DECLARE @.Value NVARCHAR(255)
SET @.Value=NULL
SELECT @.Value=Value FROM NodeAttr NA
INNER JOIN Attributes A ON (NA.AttID=A.AttID)
WHERE NodeID=@.NodeID AND AttributeName=@.AttributeName
RETURN @.Value
END
Next, I create dynamic SQL for data retrieval:
declare @.query NVARCHAR(4000)
SELECT
@.query=isnull(@.query+',','SELECT NodeID,
')+'dbo.myfun(NodeID,'''+AttributeName+''') AS ['+AttributeName+']'
FROM Attributes
SET @.query = @.query + ' FROM Nodes'
and execute it:
EXECUTE sp_executesql @.query
Dynamicly generated SQL looks like this:
SELECT NodeID,
dbo.myfun(NodeID,'CustomField1') AS [CustomField1],
dbo.myfun(NodeID,'CustomField2') AS [CustomField2],
dbo.myfun(NodeID,'CustomField3') AS [CustomField3]
FROM Nodes
It is great when you deal with small number of nodes. When node number is
about 2000 the perfomarnce is really bad (executes over a minute). And I'd
like to have even more.
Anyone can point me to better solution? :)
regards,
Pawel Rogozinski
Software Engineer at Eracent Inc.
pawel.rogozinski@.eracent.com>> I need to create a query that depends on custom fields (virtual). <<
This flawed approach is called an EAV design and newbies re-invent it
about once a month here. The basic fallacy that leads to meltdown in
about a year is that you are mixing data and metadata. Also, columns
are not fields and rows are not records -- totally different concepts.
Then give the users a copy of SQL and get out of the way. If any
random user is a better database programmers and designer than you are,
you should not be programming.
It is not just exponently slow; since it has no data integrity, it is
error-prone, too!!|||>> I'd like to get following resultset:
It is better to use a client programming language or a report writer to
generate such cross tabulations. In t-SQL, most general approaches are
clumsy. For some methods refer to: http://tinyurl.com/ayjwa
Anith|||This sounds like an EAV (Entity-Attribute-Value) design. One of it's biggest
failings is that reporting is significantly more difficult and slow. Another
divanatage is that it requires dynamic SQL and all of its issues. Thus, y
ou
should be aware that the difficulties you are having in finding a solution a
re
directly related to the design.
That said and assuming you wanted to continue with this design, one solution
that takes the dynamic SQL out of the equation would be to make the equivale
nt
of a materialized view. In essence, create a permanent temp table where each
"attribute" in your design is a column in this temp table. You would then
populate and maintain this table with every entity's attribute values. To do
that you can use a massive case statement like so:
Select NA.NodeId
, Min(Case When NA.AttId = 1 Then NA.Value End) As Attribute1Name
, Min(Case When NA.AttId = 2 Then NA.Value End) As Attribute2Name
...
From NodeAttr As NA
Group By NA.NodeId
In order to maitain the contents of the table, you'll need to use triggers t
o
update the entity's appropriate attribute values in the temp table and so on
.
The solutions to the problems created by this type of design get uglier and
uglier and the performance gets worse and worse.
Thomas|||Celko,
thanks for your "constructive" comments.

> This flawed approach is called an EAV design
> and newbies re-invent it about once a month here.
Nice. I did not reinvent this, I'm just working on such flawed design,
as you called it.
Do you know better design, that could substitute EAV then?
[...cut...]

> It is not just exponently slow; since it has no data
> integrity, it is error-prone, too!!
Didn't I mention that I did not put integrity constraitns for simplicity
of the example? I believie I did.
I would be very gratefull if you could lead me to a better solution and
not criticizing my approach, as I am aware of the flaws that come with
my approach (and the design as well).
*** Sent via Developersdex http://www.examnotes.net ***|||I like the temporary table solution.
As the attributes are not added/deleted frequently it could be one of the
best approaches.
regards,
Pawel Rogozinski
Software Engineer at Eracent
pawel.rogozinski@.eracent.com|||>> Do you know better design, that could substitute EAV then? <<
The point everyone is trying to get across to you is that you need a
totally different approach; it is not a matter of finding a substutute.
Why not use an actual data model, based on the specifications from the
user. There is no "magical, one size fits all" answer that you s
with kludges like EAV. Each database is a thing in itself, but you can
look for patterns for reuse.
simplicity of the example? I believe I did. <<
Did I meniton that doing that is virtually impossible without a few
hundred lines of procedural code in triggers and procs if you have a
database of any size?
Let's say I have 50 attributes of type INTEGER in my EAV model. They
are crammed into one table. Each one has 1 or 2 CHECK() constraints
that are totally different. Now try to write the CASE expression with
50 WHEN clauses to validlate each one.
Let's say that I have a primary key among those 50 attributes. Can you
show me the uniquenss constraint to enforce that business rule?
Let's say that I have a a foreign key among those 50 attributes. Can
you show me the uniquness constraint to enforce that business rule?
And do the DRI Actions required to maintain this relationship?
Thomas Coleman had a recent posting where he worked out the equivalent
of a simple GROUP BY statement for an EAV. Google it.sql

Tuesday, February 14, 2012

custom (dynamic) hyperlink

I have looked through various posts, but I still don't have a solution to the
problem I have in my hand. I attempted to make create three hyperlinks from
a comma delimited string output:
value1,value2,value3
I tried the following:
="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>") & "</a>"
I'm getting the string I want but it doesn't get rendered into HTML. Please
help. Thanks in advance.Are you trying to do this from within a report and the jump to url
property? If so, then where you are getting into trouble is that you are
trying to create the html, not just the url. What you want to do is create
exactly the string that you would put into the address bar of IE. You are
not trying to create the underlying html.
Do the following. Assign the expression to a textbox on your report. You
should be able to copy and paste into IE and it should work.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> I have looked through various posts, but I still don't have a solution to
the
> problem I have in my hand. I attempted to make create three hyperlinks
from
> a comma delimited string output:
> value1,value2,value3
> I tried the following:
> ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>") &
"</a>"
> I'm getting the string I want but it doesn't get rendered into HTML.
Please
> help. Thanks in advance.|||wow, the response is quick. I'm so impressed. I'm trying to create <a></a>
tags in a column. And it links to a non-report web page. The string didn't
get rendered as HTML. I kept getting "<a
href='somewebpage.asp?c='123'>123</a>". Thanks again.
"Bruce L-C [MVP]" wrote:
> Are you trying to do this from within a report and the jump to url
> property? If so, then where you are getting into trouble is that you are
> trying to create the html, not just the url. What you want to do is create
> exactly the string that you would put into the address bar of IE. You are
> not trying to create the underlying html.
> Do the following. Assign the expression to a textbox on your report. You
> should be able to copy and paste into IE and it should work.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > I have looked through various posts, but I still don't have a solution to
> the
> > problem I have in my hand. I attempted to make create three hyperlinks
> from
> > a comma delimited string output:
> >
> > value1,value2,value3
> >
> > I tried the following:
> > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>") &
> "</a>"
> >
> > I'm getting the string I want but it doesn't get rendered into HTML.
> Please
> > help. Thanks in advance.
>
>|||You are missing a concept here. You don't create tags in a column. You
create a column or use an existing one. Then do a right mouse click,
properties, extended properties, navigation, jump to url. The put in
="http://www.microsoft.com/"
as a test.
I also then set the text blue and underlined so the user knows to click on
it.
Once that is working for you then just assemble the appropriate string.
Again, you are not create html tags. You are creating a url string.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> wow, the response is quick. I'm so impressed. I'm trying to create
<a></a>
> tags in a column. And it links to a non-report web page. The string
didn't
> get rendered as HTML. I kept getting "<a
> href='somewebpage.asp?c='123'>123</a>". Thanks again.
> "Bruce L-C [MVP]" wrote:
> > Are you trying to do this from within a report and the jump to url
> > property? If so, then where you are getting into trouble is that you are
> > trying to create the html, not just the url. What you want to do is
create
> > exactly the string that you would put into the address bar of IE. You
are
> > not trying to create the underlying html.
> >
> > Do the following. Assign the expression to a textbox on your report. You
> > should be able to copy and paste into IE and it should work.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "JL" <JL@.discussions.microsoft.com> wrote in message
> > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > I have looked through various posts, but I still don't have a solution
to
> > the
> > > problem I have in my hand. I attempted to make create three
hyperlinks
> > from
> > > a comma delimited string output:
> > >
> > > value1,value2,value3
> > >
> > > I tried the following:
> > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>") &
> > "</a>"
> > >
> > > I'm getting the string I want but it doesn't get rendered into HTML.
> > Please
> > > help. Thanks in advance.
> >
> >
> >|||I knew I could use the "jump to url" feature. But I attempted to create the
actual html because I planned to create a VB function in "custom code" box
that would take a delimited string input parameter, for instance,
"value1,value2,value3". Then the function would transform this string into 3
different hyperlinks:
<a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
<a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
...
And I wasn't sure if this was doable because I couldn't even create any
custom html, like <br> or <hr>, in the report designer.
"Bruce L-C [MVP]" wrote:
> You are missing a concept here. You don't create tags in a column. You
> create a column or use an existing one. Then do a right mouse click,
> properties, extended properties, navigation, jump to url. The put in
> ="http://www.microsoft.com/"
> as a test.
> I also then set the text blue and underlined so the user knows to click on
> it.
> Once that is working for you then just assemble the appropriate string.
> Again, you are not create html tags. You are creating a url string.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > wow, the response is quick. I'm so impressed. I'm trying to create
> <a></a>
> > tags in a column. And it links to a non-report web page. The string
> didn't
> > get rendered as HTML. I kept getting "<a
> > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > Are you trying to do this from within a report and the jump to url
> > > property? If so, then where you are getting into trouble is that you are
> > > trying to create the html, not just the url. What you want to do is
> create
> > > exactly the string that you would put into the address bar of IE. You
> are
> > > not trying to create the underlying html.
> > >
> > > Do the following. Assign the expression to a textbox on your report. You
> > > should be able to copy and paste into IE and it should work.
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > I have looked through various posts, but I still don't have a solution
> to
> > > the
> > > > problem I have in my hand. I attempted to make create three
> hyperlinks
> > > from
> > > > a comma delimited string output:
> > > >
> > > > value1,value2,value3
> > > >
> > > > I tried the following:
> > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>") &
> > > "</a>"
> > > >
> > > > I'm getting the string I want but it doesn't get rendered into HTML.
> > > Please
> > > > help. Thanks in advance.
> > >
> > >
> > >
>
>|||Ahh, OK. I see what you are trying to accomplish. This is where the power of
expressions comes in. The jump to URL is still the way to go. You can have
any expression you want to create the URL string. This means that you can
have custom code that is doing this. So,
= code.mylinkbuilder(Parameters!whateverparameternameis.Value)
Just be sure that you return a string with the appropriate URL.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> I knew I could use the "jump to url" feature. But I attempted to create
the
> actual html because I planned to create a VB function in "custom code" box
> that would take a delimited string input parameter, for instance,
> "value1,value2,value3". Then the function would transform this string
into 3
> different hyperlinks:
> <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> ...
> And I wasn't sure if this was doable because I couldn't even create any
> custom html, like <br> or <hr>, in the report designer.
> "Bruce L-C [MVP]" wrote:
> > You are missing a concept here. You don't create tags in a column. You
> > create a column or use an existing one. Then do a right mouse click,
> > properties, extended properties, navigation, jump to url. The put in
> > ="http://www.microsoft.com/"
> >
> > as a test.
> >
> > I also then set the text blue and underlined so the user knows to click
on
> > it.
> >
> > Once that is working for you then just assemble the appropriate string.
> > Again, you are not create html tags. You are creating a url string.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> > "JL" <JL@.discussions.microsoft.com> wrote in message
> > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > wow, the response is quick. I'm so impressed. I'm trying to create
> > <a></a>
> > > tags in a column. And it links to a non-report web page. The string
> > didn't
> > > get rendered as HTML. I kept getting "<a
> > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > Are you trying to do this from within a report and the jump to url
> > > > property? If so, then where you are getting into trouble is that you
are
> > > > trying to create the html, not just the url. What you want to do is
> > create
> > > > exactly the string that you would put into the address bar of IE.
You
> > are
> > > > not trying to create the underlying html.
> > > >
> > > > Do the following. Assign the expression to a textbox on your report.
You
> > > > should be able to copy and paste into IE and it should work.
> > > >
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > I have looked through various posts, but I still don't have a
solution
> > to
> > > > the
> > > > > problem I have in my hand. I attempted to make create three
> > hyperlinks
> > > > from
> > > > > a comma delimited string output:
> > > > >
> > > > > value1,value2,value3
> > > > >
> > > > > I tried the following:
> > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>")
&
> > > > "</a>"
> > > > >
> > > > > I'm getting the string I want but it doesn't get rendered into
HTML.
> > > > Please
> > > > > help. Thanks in advance.
> > > >
> > > >
> > > >
> >
> >
> >|||It still doesn't solve my problem. I want function to display 2 or more
hyperlinks in a single output, according to the number of elements in the
comma delimited string. For example, if the input parameter is
"value1,value2,value3,value4", the function will return 4 different <A> html
tags. I don't think the "jump to url" can do it because it only allows one
url. I'm sorry being pain in the butt. But I have looked thru the forum and
still has no clue how to approach it. Thx again. JL
"Bruce L-C [MVP]" wrote:
> Ahh, OK. I see what you are trying to accomplish. This is where the power of
> expressions comes in. The jump to URL is still the way to go. You can have
> any expression you want to create the URL string. This means that you can
> have custom code that is doing this. So,
> = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> Just be sure that you return a string with the appropriate URL.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > I knew I could use the "jump to url" feature. But I attempted to create
> the
> > actual html because I planned to create a VB function in "custom code" box
> > that would take a delimited string input parameter, for instance,
> > "value1,value2,value3". Then the function would transform this string
> into 3
> > different hyperlinks:
> >
> > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> >
> > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > ...
> >
> > And I wasn't sure if this was doable because I couldn't even create any
> > custom html, like <br> or <hr>, in the report designer.
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > You are missing a concept here. You don't create tags in a column. You
> > > create a column or use an existing one. Then do a right mouse click,
> > > properties, extended properties, navigation, jump to url. The put in
> > > ="http://www.microsoft.com/"
> > >
> > > as a test.
> > >
> > > I also then set the text blue and underlined so the user knows to click
> on
> > > it.
> > >
> > > Once that is working for you then just assemble the appropriate string.
> > > Again, you are not create html tags. You are creating a url string.
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > >
> > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > wow, the response is quick. I'm so impressed. I'm trying to create
> > > <a></a>
> > > > tags in a column. And it links to a non-report web page. The string
> > > didn't
> > > > get rendered as HTML. I kept getting "<a
> > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > Are you trying to do this from within a report and the jump to url
> > > > > property? If so, then where you are getting into trouble is that you
> are
> > > > > trying to create the html, not just the url. What you want to do is
> > > create
> > > > > exactly the string that you would put into the address bar of IE.
> You
> > > are
> > > > > not trying to create the underlying html.
> > > > >
> > > > > Do the following. Assign the expression to a textbox on your report.
> You
> > > > > should be able to copy and paste into IE and it should work.
> > > > >
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > I have looked through various posts, but I still don't have a
> solution
> > > to
> > > > > the
> > > > > > problem I have in my hand. I attempted to make create three
> > > hyperlinks
> > > > > from
> > > > > > a comma delimited string output:
> > > > > >
> > > > > > value1,value2,value3
> > > > > >
> > > > > > I tried the following:
> > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a href='#'>")
> &
> > > > > "</a>"
> > > > > >
> > > > > > I'm getting the string I want but it doesn't get rendered into
> HTML.
> > > > > Please
> > > > > > help. Thanks in advance.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||So you are trying to create a list of URLs that they would pick from? I'm
sure there is a way that this could be accomplished but you definitely need
to stop thinking about creating the html yourself. That is just not the way
that RS works. RS takes data, the report definition language (defined in
XML) and then renders it in a variety of formats. HTML is just one of the
formats.
I still might not understand what you are trying to accomplish but if it is
a list of hyperlinks you want then if you could put this in a stored
procedure where each hyperlink was in a row. Perhaps one column with a
description and the other with the hyperlink. Only the description would be
shown and then the jump to URL would use the second column.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> It still doesn't solve my problem. I want function to display 2 or more
> hyperlinks in a single output, according to the number of elements in the
> comma delimited string. For example, if the input parameter is
> "value1,value2,value3,value4", the function will return 4 different <A>
html
> tags. I don't think the "jump to url" can do it because it only allows
one
> url. I'm sorry being pain in the butt. But I have looked thru the forum
and
> still has no clue how to approach it. Thx again. JL
> "Bruce L-C [MVP]" wrote:
> > Ahh, OK. I see what you are trying to accomplish. This is where the
power of
> > expressions comes in. The jump to URL is still the way to go. You can
have
> > any expression you want to create the URL string. This means that you
can
> > have custom code that is doing this. So,
> >
> > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> >
> > Just be sure that you return a string with the appropriate URL.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> > "JL" <JL@.discussions.microsoft.com> wrote in message
> > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > I knew I could use the "jump to url" feature. But I attempted to
create
> > the
> > > actual html because I planned to create a VB function in "custom code"
box
> > > that would take a delimited string input parameter, for instance,
> > > "value1,value2,value3". Then the function would transform this string
> > into 3
> > > different hyperlinks:
> > >
> > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > >
> > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > ...
> > >
> > > And I wasn't sure if this was doable because I couldn't even create
any
> > > custom html, like <br> or <hr>, in the report designer.
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > You are missing a concept here. You don't create tags in a column.
You
> > > > create a column or use an existing one. Then do a right mouse click,
> > > > properties, extended properties, navigation, jump to url. The put in
> > > > ="http://www.microsoft.com/"
> > > >
> > > > as a test.
> > > >
> > > > I also then set the text blue and underlined so the user knows to
click
> > on
> > > > it.
> > > >
> > > > Once that is working for you then just assemble the appropriate
string.
> > > > Again, you are not create html tags. You are creating a url string.
> > > >
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > >
> > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > wow, the response is quick. I'm so impressed. I'm trying to
create
> > > > <a></a>
> > > > > tags in a column. And it links to a non-report web page. The
string
> > > > didn't
> > > > > get rendered as HTML. I kept getting "<a
> > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > >
> > > > > "Bruce L-C [MVP]" wrote:
> > > > >
> > > > > > Are you trying to do this from within a report and the jump to
url
> > > > > > property? If so, then where you are getting into trouble is that
you
> > are
> > > > > > trying to create the html, not just the url. What you want to do
is
> > > > create
> > > > > > exactly the string that you would put into the address bar of
IE.
> > You
> > > > are
> > > > > > not trying to create the underlying html.
> > > > > >
> > > > > > Do the following. Assign the expression to a textbox on your
report.
> > You
> > > > > > should be able to copy and paste into IE and it should work.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Bruce Loehle-Conger
> > > > > > MVP SQL Server Reporting Services
> > > > > >
> > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > I have looked through various posts, but I still don't have a
> > solution
> > > > to
> > > > > > the
> > > > > > > problem I have in my hand. I attempted to make create three
> > > > hyperlinks
> > > > > > from
> > > > > > > a comma delimited string output:
> > > > > > >
> > > > > > > value1,value2,value3
> > > > > > >
> > > > > > > I tried the following:
> > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
href='#'>")
> > &
> > > > > > "</a>"
> > > > > > >
> > > > > > > I'm getting the string I want but it doesn't get rendered into
> > HTML.
> > > > > > Please
> > > > > > > help. Thanks in advance.
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Hmm...let me try this:
Here is a sample of the data:
col1 col2 col3
----
John 713-333-5555 project1,project2,project3
I'm trying to make RS create 3 hyperlinks according to the string in "one"
row. Each hyperlink links to an asp page.
The url should look like:
http://localhost/projects/getProject.asp?name=project1
So for the second element in this string, the url would be:
http://localhost/projects/getProject.asp?name=project2
I don't want to break it into 3 rows. Is this doable in RS?
"Bruce L-C [MVP]" wrote:
> So you are trying to create a list of URLs that they would pick from? I'm
> sure there is a way that this could be accomplished but you definitely need
> to stop thinking about creating the html yourself. That is just not the way
> that RS works. RS takes data, the report definition language (defined in
> XML) and then renders it in a variety of formats. HTML is just one of the
> formats.
> I still might not understand what you are trying to accomplish but if it is
> a list of hyperlinks you want then if you could put this in a stored
> procedure where each hyperlink was in a row. Perhaps one column with a
> description and the other with the hyperlink. Only the description would be
> shown and then the jump to URL would use the second column.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> > It still doesn't solve my problem. I want function to display 2 or more
> > hyperlinks in a single output, according to the number of elements in the
> > comma delimited string. For example, if the input parameter is
> > "value1,value2,value3,value4", the function will return 4 different <A>
> html
> > tags. I don't think the "jump to url" can do it because it only allows
> one
> > url. I'm sorry being pain in the butt. But I have looked thru the forum
> and
> > still has no clue how to approach it. Thx again. JL
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > Ahh, OK. I see what you are trying to accomplish. This is where the
> power of
> > > expressions comes in. The jump to URL is still the way to go. You can
> have
> > > any expression you want to create the URL string. This means that you
> can
> > > have custom code that is doing this. So,
> > >
> > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> > >
> > > Just be sure that you return a string with the appropriate URL.
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > >
> > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > > I knew I could use the "jump to url" feature. But I attempted to
> create
> > > the
> > > > actual html because I planned to create a VB function in "custom code"
> box
> > > > that would take a delimited string input parameter, for instance,
> > > > "value1,value2,value3". Then the function would transform this string
> > > into 3
> > > > different hyperlinks:
> > > >
> > > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > > >
> > > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > > ...
> > > >
> > > > And I wasn't sure if this was doable because I couldn't even create
> any
> > > > custom html, like <br> or <hr>, in the report designer.
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > You are missing a concept here. You don't create tags in a column.
> You
> > > > > create a column or use an existing one. Then do a right mouse click,
> > > > > properties, extended properties, navigation, jump to url. The put in
> > > > > ="http://www.microsoft.com/"
> > > > >
> > > > > as a test.
> > > > >
> > > > > I also then set the text blue and underlined so the user knows to
> click
> > > on
> > > > > it.
> > > > >
> > > > > Once that is working for you then just assemble the appropriate
> string.
> > > > > Again, you are not create html tags. You are creating a url string.
> > > > >
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > >
> > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > > wow, the response is quick. I'm so impressed. I'm trying to
> create
> > > > > <a></a>
> > > > > > tags in a column. And it links to a non-report web page. The
> string
> > > > > didn't
> > > > > > get rendered as HTML. I kept getting "<a
> > > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > > >
> > > > > > "Bruce L-C [MVP]" wrote:
> > > > > >
> > > > > > > Are you trying to do this from within a report and the jump to
> url
> > > > > > > property? If so, then where you are getting into trouble is that
> you
> > > are
> > > > > > > trying to create the html, not just the url. What you want to do
> is
> > > > > create
> > > > > > > exactly the string that you would put into the address bar of
> IE.
> > > You
> > > > > are
> > > > > > > not trying to create the underlying html.
> > > > > > >
> > > > > > > Do the following. Assign the expression to a textbox on your
> report.
> > > You
> > > > > > > should be able to copy and paste into IE and it should work.
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Bruce Loehle-Conger
> > > > > > > MVP SQL Server Reporting Services
> > > > > > >
> > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > > I have looked through various posts, but I still don't have a
> > > solution
> > > > > to
> > > > > > > the
> > > > > > > > problem I have in my hand. I attempted to make create three
> > > > > hyperlinks
> > > > > > > from
> > > > > > > > a comma delimited string output:
> > > > > > > >
> > > > > > > > value1,value2,value3
> > > > > > > >
> > > > > > > > I tried the following:
> > > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
> href='#'>")
> > > &
> > > > > > > "</a>"
> > > > > > > >
> > > > > > > > I'm getting the string I want but it doesn't get rendered into
> > > HTML.
> > > > > > > Please
> > > > > > > > help. Thanks in advance.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Depends. Can you count on a maximum number of projects? If so, add that many
columns. Have the source for the column be an expression that calls your
custom code where you pass it which one you want. So it would say project1
project2 etc. Leave blank if you ask for project 3 and there is no project
three. Then make it blue and underline, use the jump to url
= code.mylinkbuilder(Parameters!whateverparameternameis.Value, 1) for the
first one etc
If you set those columns to not have a border then you won't notice the
additional columns that do not have any values.
So you end up with two pieces of code, one that returns some verbiage, the
other that returns a hyperlink. The verbiage is displayed, the hyperlink is
used in the jump to url.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:8D82D3E9-B2CB-43B1-9273-94654D70232F@.microsoft.com...
> Hmm...let me try this:
> Here is a sample of the data:
> col1 col2 col3
> ----
> John 713-333-5555 project1,project2,project3
> I'm trying to make RS create 3 hyperlinks according to the string in "one"
> row. Each hyperlink links to an asp page.
> The url should look like:
> http://localhost/projects/getProject.asp?name=project1
> So for the second element in this string, the url would be:
> http://localhost/projects/getProject.asp?name=project2
> I don't want to break it into 3 rows. Is this doable in RS?
>
> "Bruce L-C [MVP]" wrote:
> > So you are trying to create a list of URLs that they would pick from?
I'm
> > sure there is a way that this could be accomplished but you definitely
need
> > to stop thinking about creating the html yourself. That is just not the
way
> > that RS works. RS takes data, the report definition language (defined in
> > XML) and then renders it in a variety of formats. HTML is just one of
the
> > formats.
> >
> > I still might not understand what you are trying to accomplish but if it
is
> > a list of hyperlinks you want then if you could put this in a stored
> > procedure where each hyperlink was in a row. Perhaps one column with a
> > description and the other with the hyperlink. Only the description would
be
> > shown and then the jump to URL would use the second column.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "JL" <JL@.discussions.microsoft.com> wrote in message
> > news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> > > It still doesn't solve my problem. I want function to display 2 or
more
> > > hyperlinks in a single output, according to the number of elements in
the
> > > comma delimited string. For example, if the input parameter is
> > > "value1,value2,value3,value4", the function will return 4 different
<A>
> > html
> > > tags. I don't think the "jump to url" can do it because it only
allows
> > one
> > > url. I'm sorry being pain in the butt. But I have looked thru the
forum
> > and
> > > still has no clue how to approach it. Thx again. JL
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > Ahh, OK. I see what you are trying to accomplish. This is where the
> > power of
> > > > expressions comes in. The jump to URL is still the way to go. You
can
> > have
> > > > any expression you want to create the URL string. This means that
you
> > can
> > > > have custom code that is doing this. So,
> > > >
> > > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> > > >
> > > > Just be sure that you return a string with the appropriate URL.
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > >
> > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > > > I knew I could use the "jump to url" feature. But I attempted to
> > create
> > > > the
> > > > > actual html because I planned to create a VB function in "custom
code"
> > box
> > > > > that would take a delimited string input parameter, for instance,
> > > > > "value1,value2,value3". Then the function would transform this
string
> > > > into 3
> > > > > different hyperlinks:
> > > > >
> > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > > > >
> > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > > > ...
> > > > >
> > > > > And I wasn't sure if this was doable because I couldn't even
create
> > any
> > > > > custom html, like <br> or <hr>, in the report designer.
> > > > >
> > > > > "Bruce L-C [MVP]" wrote:
> > > > >
> > > > > > You are missing a concept here. You don't create tags in a
column.
> > You
> > > > > > create a column or use an existing one. Then do a right mouse
click,
> > > > > > properties, extended properties, navigation, jump to url. The
put in
> > > > > > ="http://www.microsoft.com/"
> > > > > >
> > > > > > as a test.
> > > > > >
> > > > > > I also then set the text blue and underlined so the user knows
to
> > click
> > > > on
> > > > > > it.
> > > > > >
> > > > > > Once that is working for you then just assemble the appropriate
> > string.
> > > > > > Again, you are not create html tags. You are creating a url
string.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Bruce Loehle-Conger
> > > > > > MVP SQL Server Reporting Services
> > > > > >
> > > > > >
> > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > > > wow, the response is quick. I'm so impressed. I'm trying to
> > create
> > > > > > <a></a>
> > > > > > > tags in a column. And it links to a non-report web page. The
> > string
> > > > > > didn't
> > > > > > > get rendered as HTML. I kept getting "<a
> > > > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > > > >
> > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > >
> > > > > > > > Are you trying to do this from within a report and the jump
to
> > url
> > > > > > > > property? If so, then where you are getting into trouble is
that
> > you
> > > > are
> > > > > > > > trying to create the html, not just the url. What you want
to do
> > is
> > > > > > create
> > > > > > > > exactly the string that you would put into the address bar
of
> > IE.
> > > > You
> > > > > > are
> > > > > > > > not trying to create the underlying html.
> > > > > > > >
> > > > > > > > Do the following. Assign the expression to a textbox on your
> > report.
> > > > You
> > > > > > > > should be able to copy and paste into IE and it should work.
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Bruce Loehle-Conger
> > > > > > > > MVP SQL Server Reporting Services
> > > > > > > >
> > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > > > I have looked through various posts, but I still don't
have a
> > > > solution
> > > > > > to
> > > > > > > > the
> > > > > > > > > problem I have in my hand. I attempted to make create
three
> > > > > > hyperlinks
> > > > > > > > from
> > > > > > > > > a comma delimited string output:
> > > > > > > > >
> > > > > > > > > value1,value2,value3
> > > > > > > > >
> > > > > > > > > I tried the following:
> > > > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
> > href='#'>")
> > > > &
> > > > > > > > "</a>"
> > > > > > > > >
> > > > > > > > > I'm getting the string I want but it doesn't get rendered
into
> > > > HTML.
> > > > > > > > Please
> > > > > > > > > help. Thanks in advance.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||The unfortunate part is the number of projects is unknown. But anyhow, is
there a way to display custom html in RS? If yes, I'm sure there is a
workaround.
"Bruce L-C [MVP]" wrote:
> Depends. Can you count on a maximum number of projects? If so, add that many
> columns. Have the source for the column be an expression that calls your
> custom code where you pass it which one you want. So it would say project1
> project2 etc. Leave blank if you ask for project 3 and there is no project
> three. Then make it blue and underline, use the jump to url
> = code.mylinkbuilder(Parameters!whateverparameternameis.Value, 1) for the
> first one etc
> If you set those columns to not have a border then you won't notice the
> additional columns that do not have any values.
> So you end up with two pieces of code, one that returns some verbiage, the
> other that returns a hyperlink. The verbiage is displayed, the hyperlink is
> used in the jump to url.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:8D82D3E9-B2CB-43B1-9273-94654D70232F@.microsoft.com...
> > Hmm...let me try this:
> >
> > Here is a sample of the data:
> >
> > col1 col2 col3
> > ----
> > John 713-333-5555 project1,project2,project3
> >
> > I'm trying to make RS create 3 hyperlinks according to the string in "one"
> > row. Each hyperlink links to an asp page.
> >
> > The url should look like:
> > http://localhost/projects/getProject.asp?name=project1
> >
> > So for the second element in this string, the url would be:
> > http://localhost/projects/getProject.asp?name=project2
> >
> > I don't want to break it into 3 rows. Is this doable in RS?
> >
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > So you are trying to create a list of URLs that they would pick from?
> I'm
> > > sure there is a way that this could be accomplished but you definitely
> need
> > > to stop thinking about creating the html yourself. That is just not the
> way
> > > that RS works. RS takes data, the report definition language (defined in
> > > XML) and then renders it in a variety of formats. HTML is just one of
> the
> > > formats.
> > >
> > > I still might not understand what you are trying to accomplish but if it
> is
> > > a list of hyperlinks you want then if you could put this in a stored
> > > procedure where each hyperlink was in a row. Perhaps one column with a
> > > description and the other with the hyperlink. Only the description would
> be
> > > shown and then the jump to URL would use the second column.
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> > > > It still doesn't solve my problem. I want function to display 2 or
> more
> > > > hyperlinks in a single output, according to the number of elements in
> the
> > > > comma delimited string. For example, if the input parameter is
> > > > "value1,value2,value3,value4", the function will return 4 different
> <A>
> > > html
> > > > tags. I don't think the "jump to url" can do it because it only
> allows
> > > one
> > > > url. I'm sorry being pain in the butt. But I have looked thru the
> forum
> > > and
> > > > still has no clue how to approach it. Thx again. JL
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > Ahh, OK. I see what you are trying to accomplish. This is where the
> > > power of
> > > > > expressions comes in. The jump to URL is still the way to go. You
> can
> > > have
> > > > > any expression you want to create the URL string. This means that
> you
> > > can
> > > > > have custom code that is doing this. So,
> > > > >
> > > > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> > > > >
> > > > > Just be sure that you return a string with the appropriate URL.
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > >
> > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > > > > I knew I could use the "jump to url" feature. But I attempted to
> > > create
> > > > > the
> > > > > > actual html because I planned to create a VB function in "custom
> code"
> > > box
> > > > > > that would take a delimited string input parameter, for instance,
> > > > > > "value1,value2,value3". Then the function would transform this
> string
> > > > > into 3
> > > > > > different hyperlinks:
> > > > > >
> > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > > > > >
> > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > > > > ...
> > > > > >
> > > > > > And I wasn't sure if this was doable because I couldn't even
> create
> > > any
> > > > > > custom html, like <br> or <hr>, in the report designer.
> > > > > >
> > > > > > "Bruce L-C [MVP]" wrote:
> > > > > >
> > > > > > > You are missing a concept here. You don't create tags in a
> column.
> > > You
> > > > > > > create a column or use an existing one. Then do a right mouse
> click,
> > > > > > > properties, extended properties, navigation, jump to url. The
> put in
> > > > > > > ="http://www.microsoft.com/"
> > > > > > >
> > > > > > > as a test.
> > > > > > >
> > > > > > > I also then set the text blue and underlined so the user knows
> to
> > > click
> > > > > on
> > > > > > > it.
> > > > > > >
> > > > > > > Once that is working for you then just assemble the appropriate
> > > string.
> > > > > > > Again, you are not create html tags. You are creating a url
> string.
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Bruce Loehle-Conger
> > > > > > > MVP SQL Server Reporting Services
> > > > > > >
> > > > > > >
> > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > > > > wow, the response is quick. I'm so impressed. I'm trying to
> > > create
> > > > > > > <a></a>
> > > > > > > > tags in a column. And it links to a non-report web page. The
> > > string
> > > > > > > didn't
> > > > > > > > get rendered as HTML. I kept getting "<a
> > > > > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > > > > >
> > > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > > >
> > > > > > > > > Are you trying to do this from within a report and the jump
> to
> > > url
> > > > > > > > > property? If so, then where you are getting into trouble is
> that
> > > you
> > > > > are
> > > > > > > > > trying to create the html, not just the url. What you want
> to do
> > > is
> > > > > > > create
> > > > > > > > > exactly the string that you would put into the address bar
> of
> > > IE.
> > > > > You
> > > > > > > are
> > > > > > > > > not trying to create the underlying html.
> > > > > > > > >
> > > > > > > > > Do the following. Assign the expression to a textbox on your
> > > report.
> > > > > You
> > > > > > > > > should be able to copy and paste into IE and it should work.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Bruce Loehle-Conger
> > > > > > > > > MVP SQL Server Reporting Services
> > > > > > > > >
> > > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > > news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > > > > I have looked through various posts, but I still don't
> have a
> > > > > solution
> > > > > > > to
> > > > > > > > > the
> > > > > > > > > > problem I have in my hand. I attempted to make create
> three
> > > > > > > hyperlinks
> > > > > > > > > from
> > > > > > > > > > a comma delimited string output:
> > > > > > > > > >
> > > > > > > > > > value1,value2,value3
> > > > > > > > > >
> > > > > > > > > > I tried the following:
> > > > > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
> > > href='#'>")
> > > > > &
> > > > > > > > > "</a>"
> > > > > > > > > >
> > > > > > > > > > I'm getting the string I want but it doesn't get rendered
> into
> > > > > HTML.
> > > > > > > > > Please
> > > > > > > > > > help. Thanks in advance.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||No, there is no way to add custom html to RS. This has come up with people
wanting to display html they have in a database as well. If you use web
services you can do a whole lot more but it is correspondingly more
difficult too.
Given that the number of columns is not known then you have two choices that
I see. One is to modify the report rdl. This has its own difficulties,
including dealing with multi-user issues. With Version 2 with the new
controls (webform and winform) this option would be easier than it is now.
The other option is to use a matrix. Have you investigated using a matrix.
You would still need to have an expression that shows the verbiage and the
jump to URL.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JL" <JL@.discussions.microsoft.com> wrote in message
news:68626FC4-7D7B-4313-B777-F613E0A45837@.microsoft.com...
> The unfortunate part is the number of projects is unknown. But anyhow, is
> there a way to display custom html in RS? If yes, I'm sure there is a
> workaround.
> "Bruce L-C [MVP]" wrote:
> > Depends. Can you count on a maximum number of projects? If so, add that
many
> > columns. Have the source for the column be an expression that calls your
> > custom code where you pass it which one you want. So it would say
project1
> > project2 etc. Leave blank if you ask for project 3 and there is no
project
> > three. Then make it blue and underline, use the jump to url
> >
> > = code.mylinkbuilder(Parameters!whateverparameternameis.Value, 1) for
the
> > first one etc
> >
> > If you set those columns to not have a border then you won't notice the
> > additional columns that do not have any values.
> >
> > So you end up with two pieces of code, one that returns some verbiage,
the
> > other that returns a hyperlink. The verbiage is displayed, the hyperlink
is
> > used in the jump to url.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> > "JL" <JL@.discussions.microsoft.com> wrote in message
> > news:8D82D3E9-B2CB-43B1-9273-94654D70232F@.microsoft.com...
> > > Hmm...let me try this:
> > >
> > > Here is a sample of the data:
> > >
> > > col1 col2 col3
> > > ----
> > > John 713-333-5555 project1,project2,project3
> > >
> > > I'm trying to make RS create 3 hyperlinks according to the string in
"one"
> > > row. Each hyperlink links to an asp page.
> > >
> > > The url should look like:
> > > http://localhost/projects/getProject.asp?name=project1
> > >
> > > So for the second element in this string, the url would be:
> > > http://localhost/projects/getProject.asp?name=project2
> > >
> > > I don't want to break it into 3 rows. Is this doable in RS?
> > >
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > So you are trying to create a list of URLs that they would pick
from?
> > I'm
> > > > sure there is a way that this could be accomplished but you
definitely
> > need
> > > > to stop thinking about creating the html yourself. That is just not
the
> > way
> > > > that RS works. RS takes data, the report definition language
(defined in
> > > > XML) and then renders it in a variety of formats. HTML is just one
of
> > the
> > > > formats.
> > > >
> > > > I still might not understand what you are trying to accomplish but
if it
> > is
> > > > a list of hyperlinks you want then if you could put this in a stored
> > > > procedure where each hyperlink was in a row. Perhaps one column with
a
> > > > description and the other with the hyperlink. Only the description
would
> > be
> > > > shown and then the jump to URL would use the second column.
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> > > > > It still doesn't solve my problem. I want function to display 2
or
> > more
> > > > > hyperlinks in a single output, according to the number of elements
in
> > the
> > > > > comma delimited string. For example, if the input parameter is
> > > > > "value1,value2,value3,value4", the function will return 4
different
> > <A>
> > > > html
> > > > > tags. I don't think the "jump to url" can do it because it only
> > allows
> > > > one
> > > > > url. I'm sorry being pain in the butt. But I have looked thru
the
> > forum
> > > > and
> > > > > still has no clue how to approach it. Thx again. JL
> > > > >
> > > > > "Bruce L-C [MVP]" wrote:
> > > > >
> > > > > > Ahh, OK. I see what you are trying to accomplish. This is where
the
> > > > power of
> > > > > > expressions comes in. The jump to URL is still the way to go.
You
> > can
> > > > have
> > > > > > any expression you want to create the URL string. This means
that
> > you
> > > > can
> > > > > > have custom code that is doing this. So,
> > > > > >
> > > > > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> > > > > >
> > > > > > Just be sure that you return a string with the appropriate URL.
> > > > > >
> > > > > > --
> > > > > > Bruce Loehle-Conger
> > > > > > MVP SQL Server Reporting Services
> > > > > >
> > > > > >
> > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > > > > > I knew I could use the "jump to url" feature. But I attempted
to
> > > > create
> > > > > > the
> > > > > > > actual html because I planned to create a VB function in
"custom
> > code"
> > > > box
> > > > > > > that would take a delimited string input parameter, for
instance,
> > > > > > > "value1,value2,value3". Then the function would transform
this
> > string
> > > > > > into 3
> > > > > > > different hyperlinks:
> > > > > > >
> > > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > > > > > >
> > > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > > > > > ...
> > > > > > >
> > > > > > > And I wasn't sure if this was doable because I couldn't even
> > create
> > > > any
> > > > > > > custom html, like <br> or <hr>, in the report designer.
> > > > > > >
> > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > >
> > > > > > > > You are missing a concept here. You don't create tags in a
> > column.
> > > > You
> > > > > > > > create a column or use an existing one. Then do a right
mouse
> > click,
> > > > > > > > properties, extended properties, navigation, jump to url.
The
> > put in
> > > > > > > > ="http://www.microsoft.com/"
> > > > > > > >
> > > > > > > > as a test.
> > > > > > > >
> > > > > > > > I also then set the text blue and underlined so the user
knows
> > to
> > > > click
> > > > > > on
> > > > > > > > it.
> > > > > > > >
> > > > > > > > Once that is working for you then just assemble the
appropriate
> > > > string.
> > > > > > > > Again, you are not create html tags. You are creating a url
> > string.
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Bruce Loehle-Conger
> > > > > > > > MVP SQL Server Reporting Services
> > > > > > > >
> > > > > > > >
> > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > > > > > wow, the response is quick. I'm so impressed. I'm trying
to
> > > > create
> > > > > > > > <a></a>
> > > > > > > > > tags in a column. And it links to a non-report web page.
The
> > > > string
> > > > > > > > didn't
> > > > > > > > > get rendered as HTML. I kept getting "<a
> > > > > > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > > > > > >
> > > > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > > > >
> > > > > > > > > > Are you trying to do this from within a report and the
jump
> > to
> > > > url
> > > > > > > > > > property? If so, then where you are getting into trouble
is
> > that
> > > > you
> > > > > > are
> > > > > > > > > > trying to create the html, not just the url. What you
want
> > to do
> > > > is
> > > > > > > > create
> > > > > > > > > > exactly the string that you would put into the address
bar
> > of
> > > > IE.
> > > > > > You
> > > > > > > > are
> > > > > > > > > > not trying to create the underlying html.
> > > > > > > > > >
> > > > > > > > > > Do the following. Assign the expression to a textbox on
your
> > > > report.
> > > > > > You
> > > > > > > > > > should be able to copy and paste into IE and it should
work.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Bruce Loehle-Conger
> > > > > > > > > > MVP SQL Server Reporting Services
> > > > > > > > > >
> > > > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > > >
news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > > > > > I have looked through various posts, but I still don't
> > have a
> > > > > > solution
> > > > > > > > to
> > > > > > > > > > the
> > > > > > > > > > > problem I have in my hand. I attempted to make create
> > three
> > > > > > > > hyperlinks
> > > > > > > > > > from
> > > > > > > > > > > a comma delimited string output:
> > > > > > > > > > >
> > > > > > > > > > > value1,value2,value3
> > > > > > > > > > >
> > > > > > > > > > > I tried the following:
> > > > > > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
> > > > href='#'>")
> > > > > > &
> > > > > > > > > > "</a>"
> > > > > > > > > > >
> > > > > > > > > > > I'm getting the string I want but it doesn't get
rendered
> > into
> > > > > > HTML.
> > > > > > > > > > Please
> > > > > > > > > > > help. Thanks in advance.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Matrix can be an interesting solution. I know where to go from here now.
Thanks! You have been very helpful. Happy Thanksgiving.
"Bruce L-C [MVP]" wrote:
> No, there is no way to add custom html to RS. This has come up with people
> wanting to display html they have in a database as well. If you use web
> services you can do a whole lot more but it is correspondingly more
> difficult too.
> Given that the number of columns is not known then you have two choices that
> I see. One is to modify the report rdl. This has its own difficulties,
> including dealing with multi-user issues. With Version 2 with the new
> controls (webform and winform) this option would be easier than it is now.
> The other option is to use a matrix. Have you investigated using a matrix.
> You would still need to have an expression that shows the verbiage and the
> jump to URL.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "JL" <JL@.discussions.microsoft.com> wrote in message
> news:68626FC4-7D7B-4313-B777-F613E0A45837@.microsoft.com...
> > The unfortunate part is the number of projects is unknown. But anyhow, is
> > there a way to display custom html in RS? If yes, I'm sure there is a
> > workaround.
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > Depends. Can you count on a maximum number of projects? If so, add that
> many
> > > columns. Have the source for the column be an expression that calls your
> > > custom code where you pass it which one you want. So it would say
> project1
> > > project2 etc. Leave blank if you ask for project 3 and there is no
> project
> > > three. Then make it blue and underline, use the jump to url
> > >
> > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value, 1) for
> the
> > > first one etc
> > >
> > > If you set those columns to not have a border then you won't notice the
> > > additional columns that do not have any values.
> > >
> > > So you end up with two pieces of code, one that returns some verbiage,
> the
> > > other that returns a hyperlink. The verbiage is displayed, the hyperlink
> is
> > > used in the jump to url.
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > >
> > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > news:8D82D3E9-B2CB-43B1-9273-94654D70232F@.microsoft.com...
> > > > Hmm...let me try this:
> > > >
> > > > Here is a sample of the data:
> > > >
> > > > col1 col2 col3
> > > > ----
> > > > John 713-333-5555 project1,project2,project3
> > > >
> > > > I'm trying to make RS create 3 hyperlinks according to the string in
> "one"
> > > > row. Each hyperlink links to an asp page.
> > > >
> > > > The url should look like:
> > > > http://localhost/projects/getProject.asp?name=project1
> > > >
> > > > So for the second element in this string, the url would be:
> > > > http://localhost/projects/getProject.asp?name=project2
> > > >
> > > > I don't want to break it into 3 rows. Is this doable in RS?
> > > >
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > So you are trying to create a list of URLs that they would pick
> from?
> > > I'm
> > > > > sure there is a way that this could be accomplished but you
> definitely
> > > need
> > > > > to stop thinking about creating the html yourself. That is just not
> the
> > > way
> > > > > that RS works. RS takes data, the report definition language
> (defined in
> > > > > XML) and then renders it in a variety of formats. HTML is just one
> of
> > > the
> > > > > formats.
> > > > >
> > > > > I still might not understand what you are trying to accomplish but
> if it
> > > is
> > > > > a list of hyperlinks you want then if you could put this in a stored
> > > > > procedure where each hyperlink was in a row. Perhaps one column with
> a
> > > > > description and the other with the hyperlink. Only the description
> would
> > > be
> > > > > shown and then the jump to URL would use the second column.
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > news:2BB7F82E-BC6A-4B8A-B263-180AD08C2AB4@.microsoft.com...
> > > > > > It still doesn't solve my problem. I want function to display 2
> or
> > > more
> > > > > > hyperlinks in a single output, according to the number of elements
> in
> > > the
> > > > > > comma delimited string. For example, if the input parameter is
> > > > > > "value1,value2,value3,value4", the function will return 4
> different
> > > <A>
> > > > > html
> > > > > > tags. I don't think the "jump to url" can do it because it only
> > > allows
> > > > > one
> > > > > > url. I'm sorry being pain in the butt. But I have looked thru
> the
> > > forum
> > > > > and
> > > > > > still has no clue how to approach it. Thx again. JL
> > > > > >
> > > > > > "Bruce L-C [MVP]" wrote:
> > > > > >
> > > > > > > Ahh, OK. I see what you are trying to accomplish. This is where
> the
> > > > > power of
> > > > > > > expressions comes in. The jump to URL is still the way to go.
> You
> > > can
> > > > > have
> > > > > > > any expression you want to create the URL string. This means
> that
> > > you
> > > > > can
> > > > > > > have custom code that is doing this. So,
> > > > > > >
> > > > > > > = code.mylinkbuilder(Parameters!whateverparameternameis.Value)
> > > > > > >
> > > > > > > Just be sure that you return a string with the appropriate URL.
> > > > > > >
> > > > > > > --
> > > > > > > Bruce Loehle-Conger
> > > > > > > MVP SQL Server Reporting Services
> > > > > > >
> > > > > > >
> > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > news:ADAA9315-B8BA-4581-B806-89D071361D60@.microsoft.com...
> > > > > > > > I knew I could use the "jump to url" feature. But I attempted
> to
> > > > > create
> > > > > > > the
> > > > > > > > actual html because I planned to create a VB function in
> "custom
> > > code"
> > > > > box
> > > > > > > > that would take a delimited string input parameter, for
> instance,
> > > > > > > > "value1,value2,value3". Then the function would transform
> this
> > > string
> > > > > > > into 3
> > > > > > > > different hyperlinks:
> > > > > > > >
> > > > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value1">value1</a>
> > > > > > > >
> > > > > > > > <a href="http://links.10026.com/?link=webpage.asp?c=value2">value2</a>
> > > > > > > > ...
> > > > > > > >
> > > > > > > > And I wasn't sure if this was doable because I couldn't even
> > > create
> > > > > any
> > > > > > > > custom html, like <br> or <hr>, in the report designer.
> > > > > > > >
> > > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > > >
> > > > > > > > > You are missing a concept here. You don't create tags in a
> > > column.
> > > > > You
> > > > > > > > > create a column or use an existing one. Then do a right
> mouse
> > > click,
> > > > > > > > > properties, extended properties, navigation, jump to url.
> The
> > > put in
> > > > > > > > > ="http://www.microsoft.com/"
> > > > > > > > >
> > > > > > > > > as a test.
> > > > > > > > >
> > > > > > > > > I also then set the text blue and underlined so the user
> knows
> > > to
> > > > > click
> > > > > > > on
> > > > > > > > > it.
> > > > > > > > >
> > > > > > > > > Once that is working for you then just assemble the
> appropriate
> > > > > string.
> > > > > > > > > Again, you are not create html tags. You are creating a url
> > > string.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Bruce Loehle-Conger
> > > > > > > > > MVP SQL Server Reporting Services
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > > news:4D114C71-70BE-44EB-BBC1-5657B54DB1A2@.microsoft.com...
> > > > > > > > > > wow, the response is quick. I'm so impressed. I'm trying
> to
> > > > > create
> > > > > > > > > <a></a>
> > > > > > > > > > tags in a column. And it links to a non-report web page.
> The
> > > > > string
> > > > > > > > > didn't
> > > > > > > > > > get rendered as HTML. I kept getting "<a
> > > > > > > > > > href='somewebpage.asp?c='123'>123</a>". Thanks again.
> > > > > > > > > >
> > > > > > > > > > "Bruce L-C [MVP]" wrote:
> > > > > > > > > >
> > > > > > > > > > > Are you trying to do this from within a report and the
> jump
> > > to
> > > > > url
> > > > > > > > > > > property? If so, then where you are getting into trouble
> is
> > > that
> > > > > you
> > > > > > > are
> > > > > > > > > > > trying to create the html, not just the url. What you
> want
> > > to do
> > > > > is
> > > > > > > > > create
> > > > > > > > > > > exactly the string that you would put into the address
> bar
> > > of
> > > > > IE.
> > > > > > > You
> > > > > > > > > are
> > > > > > > > > > > not trying to create the underlying html.
> > > > > > > > > > >
> > > > > > > > > > > Do the following. Assign the expression to a textbox on
> your
> > > > > report.
> > > > > > > You
> > > > > > > > > > > should be able to copy and paste into IE and it should
> work.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Bruce Loehle-Conger
> > > > > > > > > > > MVP SQL Server Reporting Services
> > > > > > > > > > >
> > > > > > > > > > > "JL" <JL@.discussions.microsoft.com> wrote in message
> > > > > > > > > > >
> news:9F515492-05D8-41A1-8DA2-662425254001@.microsoft.com...
> > > > > > > > > > > > I have looked through various posts, but I still don't
> > > have a
> > > > > > > solution
> > > > > > > > > to
> > > > > > > > > > > the
> > > > > > > > > > > > problem I have in my hand. I attempted to make create
> > > three
> > > > > > > > > hyperlinks
> > > > > > > > > > > from
> > > > > > > > > > > > a comma delimited string output:
> > > > > > > > > > > >
> > > > > > > > > > > > value1,value2,value3
> > > > > > > > > > > >
> > > > > > > > > > > > I tried the following:
> > > > > > > > > > > > ="<a href='#'>" & replace(Fields!cdString,",","</a>,<a
> > > > > href='#'>")
> > > > > > > &
> > > > > > > > > > > "</a>"
> > > > > > > > > > > >
> > > > > > > > > > > > I'm getting the string I want but it doesn't get
> rendered
> > > into
> > > > > > > HTML.
> > > > > > > > > > > Please
> > > > > > > > > > > > help. Thanks in advance.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>