Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Tuesday, March 27, 2012

adding a new line

Hello,

I have a column in my table that is ntext data type and it has html data. I need to strip all the html tags, which is pretty easy to do, but I also need to add a new line for every instance of "

". Do any of you know of a function or anything else that does that?

<p style="margin: 0px">11/21/06 - Position closed and filled by competition.

<p style="margin: 0px">&nbsp;

<p style="margin: 0px">11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position. Please respond NEW POSITION FOR ETS Location: Princeton, NJ Duration: 6 months New Max Rate: $55.00 Recruiter: Steve McDowell


If you are using SQL Server 2005 then convert the column to nvarchar(max). You can then use any of the built-in string functions to replace the values. However, these are operations that is not meant for SQL Server. It is more appropriate to clean the data on the client side before saving it to the database. If you are using SQL Server 2000 then you can use PATINDEX to search for string

and replace it. Below are some scripts that will help.

http://www.umachandar.com/technical/SQL6x70Scripts/Main62.htm -- strips html tags from varchar field. You have to modify it a bit to use it with ntext

http://www.umachandar.com/technical/SQL6x70Scripts/Main53.htm -- shows how to use updatetext

|||

Hello Uma,

First of, Thanks for your help!

I went through the code and I still dont understand how the code will add a new line for

or <n></n> instances. When you look at the data using IE you will see the columns appears like this:

11/21/06 - Position closed and filled by competition.

11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position.

But in my table you see the column appears with all the html tags and comes out like this:

<p style="margin: 0px">11/21/06 - Position closed and filled by competition.

<p style="margin: 0px">&nbsp;

<p style="margin: 0px">11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position.

I need to clean up the data and make it appear as simple text in my table without all the html tags but when that column (the new col) is view using IE, it needs to still show the new line for every

or <n></n>.

Can you help? Please let me know if you have any questions.

Sunday, March 25, 2012

Adding a legend to a report

I want to add a legend to a report. In the .Net version of the report, a
button was clicked which brought up a html page. Any suggestions?Why not adding a hyperlink to your RS reports which also points to a html
page?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Delton Blackwell" <deltonblackwell@.hotmail.com> wrote in message
news:OjCNQTTWEHA.3024@.TK2MSFTNGP09.phx.gbl...
> I want to add a legend to a report. In the .Net version of the report, a
> button was clicked which brought up a html page. Any suggestions?
>|||I don't quite understand your question. Would you please elaborate on what
you are attempting to achieve
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Delton Blackwell" <deltonblackwell@.hotmail.com> wrote in message
news:OjCNQTTWEHA.3024@.TK2MSFTNGP09.phx.gbl...
> I want to add a legend to a report. In the .Net version of the report, a
> button was clicked which brought up a html page. Any suggestions?
>

Tuesday, March 6, 2012

Add javascript code to report page inside the report manager

Hi all,
Does anyone knows how can I add some javascript code into the html page
which contains a report into the report manager?.
Let's the following scenario, suppose that any user wants to execute some
reports from report manager, first the user goes to http://server/reports
after that he/she will be at home page configured due to his/her profile, the
user select a report with a click and, he/she executes it. The report will be
rendered in html inside the same window where the report manager is, but in
different frame.
I know using both htc and css files I can modify some behavior of the html
page but, the problem is that both report manager and the rendered report
coexist in the same window( I mean different frames for each of them ) I
don't know how to add some javascript code into the frame or page or whatever
the report lives in.
Any help will be appreciated.Hi
in the htc you can access the frame page which contain the report and the
report manager using the javascript dhtml code.
you can use like
frame[0].document.
or window.document.getelementbyID['asd'].
you dont have to insert script in the frame
you can put all the code in htc to call the code..
"jhcp" wrote:
> Hi all,
> Does anyone knows how can I add some javascript code into the html page
> which contains a report into the report manager?.
> Let's the following scenario, suppose that any user wants to execute some
> reports from report manager, first the user goes to http://server/reports
> after that he/she will be at home page configured due to his/her profile, the
> user select a report with a click and, he/she executes it. The report will be
> rendered in html inside the same window where the report manager is, but in
> different frame.
> I know using both htc and css files I can modify some behavior of the html
> page but, the problem is that both report manager and the rendered report
> coexist in the same window( I mean different frames for each of them ) I
> don't know how to add some javascript code into the frame or page or whatever
> the report lives in.
> Any help will be appreciated.|||Hi Bava,
thanks for your answer but, how can I know which frame contains the rendered
report?.
The htc file I coded is the following
<public:component tagName="test1">
<PUBLIC:ATTACH EVENT="oncontextmenu" onevent="f_CancelEvent()" />
<PUBLIC:ATTACH EVENT="onselectstart" onevent="f_CancelEvent()" />
<PUBLIC:ATTACH EVENT="ondragstart" onevent="f_CancelEvent()" />
</public:component>
<SCRIPT language="javascript">
function f_CancelEvent()
{
event.returnValue = false;
}
</script>
After that, I reference that piece of code in a css file as following
body {
margin: 0;
background-color: White;
font-family: Verdana, Sans-Serif;
font-size: x-small;
behavior: url(../js/test1.htc);
}
"Bava Mani" wrote:
> Hi
> in the htc you can access the frame page which contain the report and the
> report manager using the javascript dhtml code.
> you can use like
> frame[0].document.
> or window.document.getelementbyID['asd'].
> you dont have to insert script in the frame
> you can put all the code in htc to call the code..
> "jhcp" wrote:
> > Hi all,
> > Does anyone knows how can I add some javascript code into the html page
> > which contains a report into the report manager?.
> > Let's the following scenario, suppose that any user wants to execute some
> > reports from report manager, first the user goes to http://server/reports
> > after that he/she will be at home page configured due to his/her profile, the
> > user select a report with a click and, he/she executes it. The report will be
> > rendered in html inside the same window where the report manager is, but in
> > different frame.
> > I know using both htc and css files I can modify some behavior of the html
> > page but, the problem is that both report manager and the rendered report
> > coexist in the same window( I mean different frames for each of them ) I
> > don't know how to add some javascript code into the frame or page or whatever
> > the report lives in.
> > Any help will be appreciated.|||Hi,
are you using 2000 or 2005 reporting service?
in 2000 there is only one iframe so you can just use
window.frames.item(0)
or
window.document.getElementById(framid) if it is 2005
hope it helps
"jhcp" wrote:
> Hi Bava,
> thanks for your answer but, how can I know which frame contains the rendered
> report?.
> The htc file I coded is the following
> <public:component tagName="test1">
> <PUBLIC:ATTACH EVENT="oncontextmenu" onevent="f_CancelEvent()" />
> <PUBLIC:ATTACH EVENT="onselectstart" onevent="f_CancelEvent()" />
> <PUBLIC:ATTACH EVENT="ondragstart" onevent="f_CancelEvent()" />
> </public:component>
> <SCRIPT language="javascript">
> function f_CancelEvent()
> {
> event.returnValue = false;
> }
> </script>
> After that, I reference that piece of code in a css file as following
> body {
> margin: 0;
> background-color: White;
> font-family: Verdana, Sans-Serif;
> font-size: x-small;
> behavior: url(../js/test1.htc);
> }
>
> "Bava Mani" wrote:
> > Hi
> > in the htc you can access the frame page which contain the report and the
> > report manager using the javascript dhtml code.
> > you can use like
> > frame[0].document.
> > or window.document.getelementbyID['asd'].
> > you dont have to insert script in the frame
> > you can put all the code in htc to call the code..
> >
> > "jhcp" wrote:
> >
> > > Hi all,
> > > Does anyone knows how can I add some javascript code into the html page
> > > which contains a report into the report manager?.
> > > Let's the following scenario, suppose that any user wants to execute some
> > > reports from report manager, first the user goes to http://server/reports
> > > after that he/she will be at home page configured due to his/her profile, the
> > > user select a report with a click and, he/she executes it. The report will be
> > > rendered in html inside the same window where the report manager is, but in
> > > different frame.
> > > I know using both htc and css files I can modify some behavior of the html
> > > page but, the problem is that both report manager and the rendered report
> > > coexist in the same window( I mean different frames for each of them ) I
> > > don't know how to add some javascript code into the frame or page or whatever
> > > the report lives in.
> > > Any help will be appreciated.|||Hi Bava,
I'm using SSRS 2000.
Actually, I don't know how can I reference the iframe from htc file. Let me
explain.
What I want to do is to disable select any text or image inside the report
frame and, disable contextual menu too, that's why I posted the code
yesterday.
Could you please help me to do that?
I really appreciated your help.
"Bava Mani" wrote:
> Hi,
> are you using 2000 or 2005 reporting service?
> in 2000 there is only one iframe so you can just use
> window.frames.item(0)
> or
> window.document.getElementById(framid) if it is 2005
> hope it helps
> "jhcp" wrote:
> > Hi Bava,
> > thanks for your answer but, how can I know which frame contains the rendered
> > report?.
> > The htc file I coded is the following
> >
> > <public:component tagName="test1">
> > <PUBLIC:ATTACH EVENT="oncontextmenu" onevent="f_CancelEvent()" />
> > <PUBLIC:ATTACH EVENT="onselectstart" onevent="f_CancelEvent()" />
> > <PUBLIC:ATTACH EVENT="ondragstart" onevent="f_CancelEvent()" />
> > </public:component>
> > <SCRIPT language="javascript">
> > function f_CancelEvent()
> > {
> > event.returnValue = false;
> > }
> > </script>
> > After that, I reference that piece of code in a css file as following
> >
> > body {
> > margin: 0;
> > background-color: White;
> > font-family: Verdana, Sans-Serif;
> > font-size: x-small;
> > behavior: url(../js/test1.htc);
> > }
> >
> >
> >
> > "Bava Mani" wrote:
> >
> > > Hi
> > > in the htc you can access the frame page which contain the report and the
> > > report manager using the javascript dhtml code.
> > > you can use like
> > > frame[0].document.
> > > or window.document.getelementbyID['asd'].
> > > you dont have to insert script in the frame
> > > you can put all the code in htc to call the code..
> > >
> > > "jhcp" wrote:
> > >
> > > > Hi all,
> > > > Does anyone knows how can I add some javascript code into the html page
> > > > which contains a report into the report manager?.
> > > > Let's the following scenario, suppose that any user wants to execute some
> > > > reports from report manager, first the user goes to http://server/reports
> > > > after that he/she will be at home page configured due to his/her profile, the
> > > > user select a report with a click and, he/she executes it. The report will be
> > > > rendered in html inside the same window where the report manager is, but in
> > > > different frame.
> > > > I know using both htc and css files I can modify some behavior of the html
> > > > page but, the problem is that both report manager and the rendered report
> > > > coexist in the same window( I mean different frames for each of them ) I
> > > > don't know how to add some javascript code into the frame or page or whatever
> > > > the report lives in.
> > > > Any help will be appreciated.