Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Friday, March 30, 2012

how to diaplay date in MM/dd/yyyy format

how to display date in mm/dd/yy using select query ( i have dates which are in mm/dd/yyyyy format but when i run a query it displaying yyyy-mm-dd format).i want to display date in mm/dd/yyyy format so how to write select query for that

This 'should' work:

SELECT convert( varchar(10), MyColumn, 101 )

For example, using today's date:

SELECT convert( varchar(10), getdate(), 101 )


-
05/25/2007

|||what is this 101 , 102 in code|||

It the style number which indicates how the system should transform your data.

Here is more detail.

http://msdn2.microsoft.com/en-us/library/ms187928.aspx

|||thanks a lot MVPsql

Wednesday, March 28, 2012

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<

sql

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<

Monday, March 26, 2012

How to determine output format during rendering?

Is there a "global" variable I could test for the output format? I need to change styles/formats for a report based on whether its XML, Excel or CSV. There has to be a better way instead of developing reports for a specific format, in other words, I would like one report instead of multiple versions.

Any suggestions would be helpful.

Bob

Hi,

no so far there is no render-specific format. You will have to design the report for the appropiate format or produce a report to fit all rendering formats.

HTH, Jens SUessmeyer.


http://www.sqlserver2005.de

sql

Monday, March 12, 2012

How to deploy SQLProject from VS2005

This is a multi-part message in MIME format.
--=_NextPart_000_00A6_01C61699.4C6A9AA0
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
Hello,
According to documentation I'm supposed to be able to deploy SQL project = directly from VS2005. I don't have Either Build<project name> under = Build menu, neither I have Deploy <project name> for my SQL project.
What am I doing wrong?
To deploy items in a SQL Server project to a SQL Server
1.. Build the project by selecting Build <project name> from the Build = menu.
Note Resolve all build errors prior to deploying.

2.. Select Deploy <project name> from the Build menu.
Note If you receive a message informing you that the project cannot = be deployed, then you may need to manually create the assembly on the = server. This error is typically the result of referenced assemblies in = your project. For more information on manually deploying your assembly, = see the Create Assembly page in the "SQL Books Online."

--=_NextPart_000_00A6_01C61699.4C6A9AA0
Content-Type: text/html;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hello,

According to documentation I'm supposed = to be able to deploy SQL project directly from VS2005. I don't have Either = Build under Build menu, neither I have Deploy = for my SQL project.
What am I doing wrong?



To deploy items in a SQL Server project to a SQL = Server
Build the project by selecting Build from the Build menu.
Note
Resolve all build errors prior to deploying.
Select Deploy from the Build menu.
Note
If you receive a message informing you that the project = cannot be deployed, then you may need to manually create the assembly on = the server. This error is typically the result of referenced = assemblies in your project. For more information on manually deploying your = assembly, see the Create Assembly page in the "SQL Books = Online."=
--=_NextPart_000_00A6_01C61699.4C6A9AA0--This is a multi-part message in MIME format.
--=_NextPart_000_0042_01C617C5.60008200
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
Right-click the project in Solution Explorer. There's a deploy option =there.
Most people will do it via scripts though.
HTH,
Greg
"GS" <nospam@.nowhere.com> wrote in message =news:ObaPYusFGHA.3200@.tk2msftngp13.phx.gbl...
Hello,
According to documentation I'm supposed to be able to deploy SQL =project directly from VS2005. I don't have Either Build<project name> =under Build menu, neither I have Deploy <project name> for my SQL =project.
What am I doing wrong?
To deploy items in a SQL Server project to a SQL Server
1.. Build the project by selecting Build <project name> from the =Build menu.
Note Resolve all build errors prior to deploying.

2.. Select Deploy <project name> from the Build menu.
Note If you receive a message informing you that the project cannot =be deployed, then you may need to manually create the assembly on the =server. This error is typically the result of referenced assemblies in =your project. For more information on manually deploying your assembly, =see the Create Assembly page in the "SQL Books Online."
--=_NextPart_000_0042_01C617C5.60008200
Content-Type: text/html;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML XMLNS:MSHelp =3D "<HEAD>">http://msdn.microsoft.com/mshelp"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dkoi8-r">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Right-click the project in Solution =Explorer. There's a deploy option there.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Most people will do it via scripts though.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>HTH,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Greg</FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"GS" <<A =href=3D"mailto:nospam@.nowhere.com">nospam@.nowhere.com</A>> wrote in message <A =href=3D"news:ObaPYusFGHA.3200@.tk2msftngp13.phx.gbl">news:ObaPYusFGHA.3200=@.tk2msftngp13.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>According to documentation I'm =supposed to be able to deploy SQL project directly from VS2005. I don't have Either Build<project name> under Build menu, neither I have Deploy =<project name> for my SQL project.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What am I doing wrong?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<H1 class=3Dheading>To deploy items in a SQL Server project to a SQL =Server</H1>
<DIV class=3Dsection id=3DprocedureSection0>
<OL>
<LI>
<P>Build the project by selecting <B>Build <</B><I>project name</I><B>></B> from the <B>Build</B> menu.</P>
<DIV class=3Dalert>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%">
<TBODY>
<TR>
<TH align=3Dleft><IMG class=3Dnote alt=3DNote =src=3D"ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_raddat=a/local/note.gif"></IMG>Note </TH></TR>
<TR>
<TD>
<P>Resolve all build errors prior to deploying.</P></TD></TR></TBODY></TABLE></DIV>
<LI>
<P>Select <B>Deploy <</B><I>project name</I><B>></B> from the <B>Build</B> menu.</P>
<DIV class=3Dalert>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%">
<TBODY>
<TR>
<TH align=3Dleft><IMG class=3Dnote alt=3DNote =src=3D"ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_raddat=a/local/note.gif"></IMG>Note </TH></TR>
<TR>
<TD>
<P>If you receive a message informing you that the project =cannot be deployed, then you may need to manually create the assembly on =the server. This error is typically the result of referenced =assemblies in your project. For more information on manually deploying your assembly, see the <MSHelp:link tabIndex=3D0 keywords=3D"d8d1d245-c2c3-4325-be52-4fc1122c2079">Create Assembly</MSHelp:link> page in the "SQL Books =Online."</P></TD></TR></TBODY></TABLE></DIV></LI></OL></DIV></DIV></BLOCK=QUOTE></BODY></HTML>
--=_NextPart_000_0042_01C617C5.60008200--