Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 29, 2012

formula in sql server

hi,
my users can make posts in my web application, i mean they fill a form and the information they filled will be saved in sql server 2000 and can be shown in web application,now i want to give each post an Id and save it in the database, how can i do that? does sql server have the abilities or i should do sth in my c# application

thanx

This is something that is best to let the database handle for you.

Set your ID column as an Identity column in your sql table.

Sql server will then set its value to a unique auto incrementing value automatically every time a new row is inserted.

Tuesday, March 27, 2012

Forms Authentication-Authorization ticket not received by LogonUse

Hello,
I've had my web application up and running and integrated with
ReportingServices using Forms Authentication for quite a while now. I
followed the examples provided and everything was running smoothly in the
testing environment.
We were accessing the Report Server using the domain/machine name and it was
working a treat. This afternoon, we recieved our fully qualified domain name
and went about updating references to this new url. Unfortunately, after
doing this we no longer seem to be able to access the report server. We
receive the following exception :
Authorization ticket not received by LogonUser
We are performing cookie management as described by the examples.
This has everyone here quite stumped and I was hoping someone may be able to
help out.OK, It seemed to have been due to a configuration setting in
RSReportServer.config.
I updated the node: <Configuration><Service><UrlRoot> to match the new url.
Just to be sure I also updated the node:
<Configuration><UI><ReportServerUrl> in RSWebApplication.config.
"Danny" wrote:
> Hello,
> I've had my web application up and running and integrated with
> ReportingServices using Forms Authentication for quite a while now. I
> followed the examples provided and everything was running smoothly in the
> testing environment.
> We were accessing the Report Server using the domain/machine name and it was
> working a treat. This afternoon, we recieved our fully qualified domain name
> and went about updating references to this new url. Unfortunately, after
> doing this we no longer seem to be able to access the report server. We
> receive the following exception :
> Authorization ticket not received by LogonUser
> We are performing cookie management as described by the examples.
> This has everyone here quite stumped and I was hoping someone may be able to
> help out.

Forms Authentication...Can it really be done?

I could really use help getting form authentication to work. I have a box with a web site and ReportingServices installed(which if I can get this working will be moved to the DMZ). The databases are on a different machine(which will on on our network).

I have been working with the sample provided with the install and this blog.

http://blogs.msdn.com/bimusings/archive/2005/12/05/500195.aspx

My problem is that I can logon and authenticate but when I call ListChildren() my System.Net.CredentialCache.DefaultCredentials is empty so I get nothing back from the call.

I know that I have a valid cookie because after I logon I can use the Reports and the ReportServer URL's and go directly to those pages.

Can someone tell me what I need to do to make ListChildren() work? Do I still call ListChildren()? Documentation is scarce and would appreciate any help provided.

Thanks

-JW

I was afraid I wouldn't get a response to this.

Can anyone help?

Forms Authentication without Report Manager

I am intergrating Reporting Services into my own web application and want to use Forms Authentication. Do I need to do anything different than the Security Extension Sample on MSDN books online? Specifically, since I no longer need to go through Report Manager, how would I login the user and manage the cookie?http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ufairs.asp?ferame=true will help you in this. Actualyl I am researching this myself. I am looking to add/delete user roles programmatically. So far, I am having little luck but, I think I'll pull it together!

Forms authentication question

Hi,
The forms authentication works fine. However, after the prescribed timeout
period specified in the report server web.conifg report server autmatically
logs you off even when you are constantly using the report server.
To reproduce:
1. Set the forms auth timeout to a small number say 5 min
2. log on to report manager and access the reports every minute
3. After 5 minutes from logging in the report server rejects the cookie
although you have been actively using it.
Any suggestions?HI.
Sorry, is there any example code about the use of
Forms Auth. and reporting services?
Thanks in advance
S.Bertini
"j_a5" <j_a5@.hotmail.com> wrote in message
news:ORB0pOKpEHA.3848@.tk2msftngp13.phx.gbl...
> Hi,
> The forms authentication works fine. However, after the prescribed timeout
> period specified in the report server web.conifg report server
autmatically
> logs you off even when you are constantly using the report server.
> To reproduce:
> 1. Set the forms auth timeout to a small number say 5 min
> 2. log on to report manager and access the reports every minute
> 3. After 5 minutes from logging in the report server rejects the cookie
> although you have been actively using it.
> Any suggestions?
>|||See the following article that shows how to enable forms authentication
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs_topic3
"Sergio Bertini" <sergio.bertini@.RIMUOVIMI.alcatel.it> wrote in message
news:uTDFvTKpEHA.3460@.TK2MSFTNGP15.phx.gbl...
> HI.
> Sorry, is there any example code about the use of
> Forms Auth. and reporting services?
> Thanks in advance
> S.Bertini
> "j_a5" <j_a5@.hotmail.com> wrote in message
> news:ORB0pOKpEHA.3848@.tk2msftngp13.phx.gbl...
> > Hi,
> > The forms authentication works fine. However, after the prescribed
timeout
> > period specified in the report server web.conifg report server
> autmatically
> > logs you off even when you are constantly using the report server.
> > To reproduce:
> > 1. Set the forms auth timeout to a small number say 5 min
> > 2. log on to report manager and access the reports every minute
> > 3. After 5 minutes from logging in the report server rejects the cookie
> > although you have been actively using it.
> > Any suggestions?
> >
> >
>

Forms Authentication for reporting

Hello
I have a web application that uses forms authentication.
Ideally I would like to be able to make some reports from my Reporting Services server available BUT I would also like to be able to pass authentication data through as I would like the reports available to be dictated by who the user is and the roles that they have within the application.
So for example if I have user A and user B then there are some reports that only user A will want to be able to see and some that only user B will want to see

There are also some reports that will vary the data according to who the user is e.g. user A will want to see their data only and User B will want to see their data only but on the same report
Is this possible? If anyone has any suggestions on where I can look to find out how to do this I would be grateful
thanks
steveI'd suggest doing the authentication before ever getting over to the reporting services server. Let the application control which reports each person can see based on their authorization in the application. Hopefully you will already have this information available, and if not it should not be hard to add.
And... even though it is more work now I'd also consider streaming the reporting services data back from the reporting services server to your application. Your server builds all of the correct parms including user specific required information, passes the request to the reporting services server, it processes the report data and comes back with a report, the report is streamed back to your application which displays it in a web browser or makes it available for download.|||

Thanks Patrick

The authorization information is available as you suggest.
I'm not sure I'm absolutely clear on what you mean bystreaming the reporting services data back. Do you mean some sort of HTTP handler or web service call? Ideally I would like something fairly simple that maintained much of the functionality of Reporting Services - particularly the ability to subscribe and to have different output formats

steve

|||What I am talking about is sending the data to the reporting server torun the report and getting the data back, but not actually using thereporting server to display the report. You'd lose some of thefunctionality of RS, but gain as much flexibility as you can code in.
I know reporting services can restrict report view by userids anddomains,but that is all configured on the reporting services side atthe report and the report folder level. The way that comes to mindfirst doing what you are talking about (passing credentials at reportrun time) is to have the report at a high level look at what is beingpassed and conditionally hide the page.
One thing I don't understand - how will somebody ever haveauthorization to see a report is even available if they are notauthorized to view it? Shouldn't you not even make the option availableto them? Display a report list for the current user, but that list is asubset of ALL of the reports available. They only see what they cantruly get to. I don't have your original post in front of me so I don'tknow if you have some restriction that prevents that. But that routeseems to be the best long term solution for anyone that is planning onusing reporting services and wants authentication.
FYI... in VS2005 there is a control you can put in your applicationthat looks/feels just like the reporting services website. So it willbe easier to stream reports back while keeping alot of thefunctionality.
|||Thanks patrick

steve|||My pleasure. I can't believe I was actually able to help somebody.
Report back with what you finally do and how it worked. I am interestedin seeing your solution and the code that goes along with it.
|||OK, no problems but don't hold your breath it may take a while
steve

Monday, March 26, 2012

Forms Authentication and integrating with an existing Web App

Hello,
I was hoping someone could help me with this.
I have set up a Reporting Services installation to use forms authentication as described on the MSDN page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ufairs.asp. By itself it is working fine.
Now I would like to integrate access to reports from this instance of Reporting Services from into an existing ASP.NET Web Application that also uses forms authentication.
The problem I have is that I can't seem to get both Reporting Services and the Web Application to use a common forms authentication cookie. Even if I give the <forms> element the same name in both the web.config for the report server and the web.config for the custom web app - one application still don't seem to see the authentication cookie generated by the other.
The ultimate goal is to have a web application, with a single forms authentication login page, that enables users to access reporting services reports.
Any help would be greatly appreciated.
Sincerely,
DannyI just came across the article 'Forms Authentication Across Applications' that discusses the requirement of matching attributes in the forms element and machineKey element.
I assume this matches my scenario so I will try it out and see how it goes.
Please, do reply to this post however if you have anything to contribute.
"Danny" wrote:
> Hello,
> I was hoping someone could help me with this.
> I have set up a Reporting Services installation to use forms authentication as described on the MSDN page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ufairs.asp. By itself it is working fine.
> Now I would like to integrate access to reports from this instance of Reporting Services from into an existing ASP.NET Web Application that also uses forms authentication.
> The problem I have is that I can't seem to get both Reporting Services and the Web Application to use a common forms authentication cookie. Even if I give the <forms> element the same name in both the web.config for the report server and the web.config for the custom web app - one application still don't seem to see the authentication cookie generated by the other.
> The ultimate goal is to have a web application, with a single forms authentication login page, that enables users to access reporting services reports.
> Any help would be greatly appreciated.
> Sincerely,
> Danny

forming where clause

I wonder if I could write a dynamic where statement in a store procedure.
I have a web page that will pass following information to the store procedur
e.
Lets say I have a parameter @.typeid that can be 1 for rent, 2 for sale, 1 or
2 for either. My store procedure looks like this
create select_apartment_details
(
@.typeid nvarchar(50) -- @.typeid ='1' or @.typeid ='2' or @.typeid='1, 2'
)
AS
SELECT * FROM tbl_apartments WHERE typeid IN (@.typeid)
GO
By the way typeid field in the tbl_apartments is integer.
However, this doesnt work. Can anyone help me pls?If the values in the TypeID Column in the tbl_apartments table are indeed
limited to
1 or 2, then I suggest the following
Pass in @.TypeID = 1 When you want only the 1s,
@.TypeID = 2 When you want only the 2s,
and @.TypeID = 3, when you want 1s and 2s
Then in your where clause, you can do this
Where TypeID ^ @.Type <> 0
This will do a bitwise And comparison such that
Database TypeID
@.TypeID | 1 2
-- | -- --
1 | 1 0
2 | 0 2
3 | 1 2
"regaliel" wrote:

> I wonder if I could write a dynamic where statement in a store procedure.
> I have a web page that will pass following information to the store proced
ure.
> Lets say I have a parameter @.typeid that can be 1 for rent, 2 for sale, 1
or
> 2 for either. My store procedure looks like this
> create select_apartment_details
> (
> @.typeid nvarchar(50) -- @.typeid ='1' or @.typeid ='2' or @.typeid='1, 2'
> )
> AS
> SELECT * FROM tbl_apartments WHERE typeid IN (@.typeid)
> GO
> By the way typeid field in the tbl_apartments is integer.
> However, this doesnt work. Can anyone help me pls?
>|||Sorry Memory tricked me... The bitwise operator yu want is bitwise AND, and
the operator symbol is an Ampersand as in
Where TypeID & @.TypeID <> 0
"regaliel" wrote:

> I wonder if I could write a dynamic where statement in a store procedure.
> I have a web page that will pass following information to the store proced
ure.
> Lets say I have a parameter @.typeid that can be 1 for rent, 2 for sale, 1
or
> 2 for either. My store procedure looks like this
> create select_apartment_details
> (
> @.typeid nvarchar(50) -- @.typeid ='1' or @.typeid ='2' or @.typeid='1, 2'
> )
> AS
> SELECT * FROM tbl_apartments WHERE typeid IN (@.typeid)
> GO
> By the way typeid field in the tbl_apartments is integer.
> However, this doesnt work. Can anyone help me pls?
>|||Try this:
SELECT * FROM tbl_apartments WHERE CHARINDEX(CAST(typeid AS CHAR(1)), @.test)
> 0
"regaliel" <regaliel@.discussions.microsoft.com> wrote in message
news:9B49F533-89B9-492D-B556-96B2199585C9@.microsoft.com...
>I wonder if I could write a dynamic where statement in a store procedure.
> I have a web page that will pass following information to the store
> procedure.
> Lets say I have a parameter @.typeid that can be 1 for rent, 2 for sale, 1
> or
> 2 for either. My store procedure looks like this
> create select_apartment_details
> (
> @.typeid nvarchar(50) -- @.typeid ='1' or @.typeid ='2' or @.typeid='1, 2'
> )
> AS
> SELECT * FROM tbl_apartments WHERE typeid IN (@.typeid)
> GO
> By the way typeid field in the tbl_apartments is integer.
> However, this doesnt work. Can anyone help me pls?
>

Wednesday, March 21, 2012

Formatting numbers

Hi all,
I would like to know how can one change the thousand and decimal separator.
I tried to change the ReportingServer web.configs <globalization> culture
and uiCulture.
Regardless of the cultures I am always getting US number formats (e.g.
"1,234,567.89").
The format string I use on the report is: "#,##0.00" and according to the
cultures I would expect to get "1.234.567,89".
Please help I am already desperateOn the 'Report' properties there is a Language setting - you need to set
that.
--
Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=21
(Create your own groups, Forum, FAQ's and a ton more)|||Hi Tony,
Thanx I missed that property - it works now!!!!
"Tony Rogerson" <tonyrogerson@.sqlserver.eu.com> wrote in message
news:efviupE2EHA.3840@.tk2msftngp13.phx.gbl...
> On the 'Report' properties there is a Language setting - you need to set
> that.
> --
> Tony Rogerson
> SQL Server MVP
> http://www.sqlserverfaq.com?mbr=21
> (Create your own groups, Forum, FAQ's and a ton more)
>

Monday, March 19, 2012

Formatting database content

Hi
I have set up a SQL database to contain alist FAQ's for our company and
then plan to pull this info off using a web page.

So far I have entered the data but I am unable to control how it is
displayed inside SQL ie I cannot enter new blank lines I have tried
using lots of spaces but this does not work when I use the website to
display the info.

Is there a way of formatting and editing the data in the sql database
as I am unable to do this, if I try to edit the data in the database I
have to copy it to notepad delete what is in the database, edit the
text in notepad then paste it back in.

There must be a better way.

Please help

alamb200Sounds as if you need to convert your carraige return / line feed into the
HTML <BR> tag which will then give you the correct formatting on the screen.

If you want to do it in the database then use REPLACE( <col>, char(13) +
char(10), '<BR>' ) - check, it might be 10, 13 :)

Tony

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials

<alamb200@.hotmail.com> wrote in message
news:1147771818.200249.269650@.j55g2000cwa.googlegr oups.com...
> Hi
> I have set up a SQL database to contain alist FAQ's for our company and
> then plan to pull this info off using a web page.
> So far I have entered the data but I am unable to control how it is
> displayed inside SQL ie I cannot enter new blank lines I have tried
> using lots of spaces but this does not work when I use the website to
> display the info.
> Is there a way of formatting and editing the data in the sql database
> as I am unable to do this, if I try to edit the data in the database I
> have to copy it to notepad delete what is in the database, edit the
> text in notepad then paste it back in.
> There must be a better way.
> Please help
> alamb200|||I have just had a look at the parameter tag but as I am new to SQL I am
not sure how I would put this place.

For example if my prefix charecter was / and my suffix charecter was \
for the sake of argument nad i wanted a new line after the full stop
in the following text how would I enter the information.

If your printer is no longer printing your logo's or overlays it may
have lost the images that have been "Flashed" on to it, to reflash your
printer follow the following instructions. Log on to SB Client and go
into the Company Files section. Next goto Runtime then Maintenance and
System Manager Menu.

Also I seem to be unable to edit text already in the database and have
to delete it and reenter it every time, is there an easier way of doing
that.

Thanks

Anthony

Tony Rogerson wrote:
> Sounds as if you need to convert your carraige return / line feed into the
> HTML <BR> tag which will then give you the correct formatting on the screen.
> If you want to do it in the database then use REPLACE( <col>, char(13) +
> char(10), '<BR>' ) - check, it might be 10, 13 :)
> Tony
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
> <alamb200@.hotmail.com> wrote in message
> news:1147771818.200249.269650@.j55g2000cwa.googlegr oups.com...
> > Hi
> > I have set up a SQL database to contain alist FAQ's for our company and
> > then plan to pull this info off using a web page.
> > So far I have entered the data but I am unable to control how it is
> > displayed inside SQL ie I cannot enter new blank lines I have tried
> > using lots of spaces but this does not work when I use the website to
> > display the info.
> > Is there a way of formatting and editing the data in the sql database
> > as I am unable to do this, if I try to edit the data in the database I
> > have to copy it to notepad delete what is in the database, edit the
> > text in notepad then paste it back in.
> > There must be a better way.
> > Please help
> > alamb200|||On 16 May 2006 04:13:58 -0700, alamb200@.hotmail.com wrote:

>I have just had a look at the parameter tag but as I am new to SQL I am
>not sure how I would put this place.
>For example if my prefix charecter was / and my suffix charecter was \
>for the sake of argument nad i wanted a new line after the full stop
>in the following text how would I enter the information.

Hi Anthony,

wiith the right front-end, there's no need to use parameters. For
instance, copy and paste the following into Query Analyzer and execute;
you'll see that the output has exactly the lline breaks yoou asked for:

CREATE TABLE test (KeyColumn int NOT NULL PRIMARY KEY,
DataColumn varchar(1000) NOT NULL)
INSERT INTO test (KeyColumn, DataColumn)
VALUES (1, 'If your printer is no longer printing your logo''s or
overlays it may have lost the images that have been "Flashed" on to it,
to reflash your printer follow the following instructions.
Log on to SB Client and go into the Company Files section.
Next goto Runtime then Maintenance and System Manager Menu.')
go
SELECT * FROM test
go
DROP TABLE test
go

(Note: beware of extra line breaks inserted by Usenet software. In the
intended code, there are line breaks after the periods, but no other
line breaks in the VALUES clause.)

>Also I seem to be unable to edit text already in the database and have
>to delete it and reenter it every time, is there an easier way of doing
>that.

That, too, is a problem with your frontend.

May I ask you what tool you are using as your frontend?

--
Hugo Kornelis, SQL Server MVP|||Hi

I am using a web page as my front end using ASP to pull the info from
the SQL database so I am in the position of either having multiple
columns with small bits of info in my database so I can format them how
I want

The other option is to have some commands built into the text in the
database entry which will be read by the system and control the
formatting when it is read.

Is this possible?

When I am trying to edit the info in the database all I am doing is
right clicking on the table in Enterprise manager and display all
columns and working on it from there.

Is this the right way to do this?

Anthony

Hugo Kornelis wrote:
> On 16 May 2006 04:13:58 -0700, alamb200@.hotmail.com wrote:
> >I have just had a look at the parameter tag but as I am new to SQL I am
> >not sure how I would put this place.
> >For example if my prefix charecter was / and my suffix charecter was \
> >for the sake of argument nad i wanted a new line after the full stop
> >in the following text how would I enter the information.
> Hi Anthony,
> wiith the right front-end, there's no need to use parameters. For
> instance, copy and paste the following into Query Analyzer and execute;
> you'll see that the output has exactly the lline breaks yoou asked for:
> CREATE TABLE test (KeyColumn int NOT NULL PRIMARY KEY,
> DataColumn varchar(1000) NOT NULL)
> INSERT INTO test (KeyColumn, DataColumn)
> VALUES (1, 'If your printer is no longer printing your logo''s or
> overlays it may have lost the images that have been "Flashed" on to it,
> to reflash your printer follow the following instructions.
> Log on to SB Client and go into the Company Files section.
> Next goto Runtime then Maintenance and System Manager Menu.')
> go
> SELECT * FROM test
> go
> DROP TABLE test
> go
> (Note: beware of extra line breaks inserted by Usenet software. In the
> intended code, there are line breaks after the periods, but no other
> line breaks in the VALUES clause.)
> >Also I seem to be unable to edit text already in the database and have
> >to delete it and reenter it every time, is there an easier way of doing
> >that.
> That, too, is a problem with your frontend.
> May I ask you what tool you are using as your frontend?
> --
> Hugo Kornelis, SQL Server MVP|||On 17 May 2006 02:01:41 -0700, alamb200@.hotmail.com wrote:

>Hi
>I am using a web page as my front end using ASP to pull the info from
>the SQL database so I am in the position of either having multiple
>columns with small bits of info in my database so I can format them how
>I want
>The other option is to have some commands built into the text in the
>database entry which will be read by the system and control the
>formatting when it is read.
>Is this possible?

Hi Anthony,

I'm not an ASP guy, so I don't know. Are you saying that linebreaks in a
long character data column are not displayed properly by ASP? Have you
consiedered asking for alternatives in one of the ASP groups?

>When I am trying to edit the info in the database all I am doing is
>right clicking on the table in Enterprise manager and display all
>columns and working on it from there.
>Is this the right way to do this?

No, definitely not. Data entry through Enterprise Manager is broken in
far more ways than I care to remember. Some of these errors are listed
by Aaron Bertrand at http://www.aspfaq.com/show.asp?id=2455.

--
Hugo Kornelis, SQL Server MVP|||Hi

Go to http://212.50.191.220/techfaq and enter restart in the search box
in the bottom center this pops up a new page of info pulled from my SQL
database. As you can see it can be difficult to read so I would like to
add some line breaks and if possible some other formatting.

When I pull the info in it comes as one big lump of text so ASP cannot
format it what I beleive from one of my earlier replies is that I can
embed some commands into the text held in the entry to be pulled out of
the database that ASP can read and turn into html formatting when it is
displayed on the page.

Is this correct and if so how do I add them.

Anthony
Hugo Kornelis wrote:
> On 17 May 2006 02:01:41 -0700, alamb200@.hotmail.com wrote:
> >Hi
> >I am using a web page as my front end using ASP to pull the info from
> >the SQL database so I am in the position of either having multiple
> >columns with small bits of info in my database so I can format them how
> >I want
> >The other option is to have some commands built into the text in the
> >database entry which will be read by the system and control the
> >formatting when it is read.
> >Is this possible?
> Hi Anthony,
> I'm not an ASP guy, so I don't know. Are you saying that linebreaks in a
> long character data column are not displayed properly by ASP? Have you
> consiedered asking for alternatives in one of the ASP groups?
> >When I am trying to edit the info in the database all I am doing is
> >right clicking on the table in Enterprise manager and display all
> >columns and working on it from there.
> >Is this the right way to do this?
> No, definitely not. Data entry through Enterprise Manager is broken in
> far more ways than I care to remember. Some of these errors are listed
> by Aaron Bertrand at http://www.aspfaq.com/show.asp?id=2455.
> --
> Hugo Kornelis, SQL Server MVP|||On 18 May 2006 06:53:21 -0700, alamb200@.hotmail.com wrote:

>Hi
>Go to http://212.50.191.220/techfaq

"The page cannot be found"

>When I pull the info in it comes as one big lump of text so ASP cannot
>format it

I can only repeat my previous suggestion: if ASP has trouble retaining
embedded CR/LF combinations from a varchar column, then the best place
to seek help is an ASP group.

--
Hugo Kornelis, SQL Server MVP|||(alamb200@.hotmail.com) writes:
> When I pull the info in it comes as one big lump of text so ASP cannot
> format it what I beleive from one of my earlier replies is that I can
> embed some commands into the text held in the entry to be pulled out of
> the database that ASP can read and turn into html formatting when it is
> displayed on the page.

Neither do I know much ASP, but I would assume that if you get some
text from the database, and spit it out between regular <P> tags,
that any line breaks will be blissfully ignored, as that is how HTML
works.

You could use the <PRE> tag to maintain the line-breaks, but the text
would be presented in a monospaced font, so it may look a bit ugly.

You could run this:

SELECT replace(col, char(13) + char(10), <BR />)

to change line breaks to <BR /> tags. The <BR /> introduces a line break
in the text.

You could also store the text in HTML format.

But as Hugo says, asking in an ASP group is probably a good idea.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 12, 2012

formatt telephone number

I have searched this forum and the web and am not finding the answer.

I have a local report using the Microsoft Report Viewer add in for VS 2005 Express. I am trying to format a text field in a report that is a telephone number.

Instead of 8008898890 I want (800) 889-8890

Any suggestions? I have tried all of the format options such as {0:(###) ###-####}

None of them are working.

Joe

For anyone who is wondering here is the answer:

=Format(CDbl(Fields!yourfield.value), "(###) ###-####")

Formating Reports To Print

How can I fixa report that displays correctly on the web page (Report
manager) but when I either print or convert to .pdf, some of the text boxes
shifts to a second and maybe a third ?
The report is actualy smaller than a regular letter page.
Any ideas ?You will have to build the report to render as a pdf. In doing so the
web formatting may look out of allignment but the pdf file will look
right. It is very difficult to get them both to look good.
Also, sometimes placing rectangles behind your report items will
prevent them from going outside the report boundries.
Another thing to check is to make sure the "report" page size and
"body" size properties are matching or similar (ie. set the report page
size to 11 x 8.5 for a Landscape print and set the body size to 10.75 x
8 to fit within the page boundries) and only work with in these
boundries. Take some time to try out different margin settings as
well. Work with it a little and usually you can come up with something
that works in the web and pdf worlds.
Let me know how it goes!