Is it possible to get the text from the code editor into another app like MS
Word while retaining the font color coding?
txThis is what happens when you select code from Management Studio's query
editor and paste into Word. I don't think there is any magic for doing this
from Query Analyzer (the color coding is not part of what is transfered to
the clipboard).
"Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
> Is it possible to get the text from the code editor into another app like
> MS
> Word while retaining the font color coding?
> tx|||Thanks, Aaron. It's kind of brute force. I have been using ADO and catalog
views to extract meta data and then try to mimic the default color coding in
MS Word but it is a challenge of a different kind.
"Aaron Bertrand [SQL Server MVP]" wrote:
> This is what happens when you select code from Management Studio's query
> editor and paste into Word. I don't think there is any magic for doing th
is
> from Query Analyzer (the color coding is not part of what is transfered to
> the clipboard).
>
>
>
> "Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
> news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
>
>sql
Showing posts with label color. Show all posts
Showing posts with label color. Show all posts
Thursday, March 29, 2012
Extract color formatted text from code editor?
Is it possible to get the text from the code editor into another app like MS
Word while retaining the font color coding?
tx
This is what happens when you select code from Management Studio's query
editor and paste into Word. I don't think there is any magic for doing this
from Query Analyzer (the color coding is not part of what is transfered to
the clipboard).
"Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
> Is it possible to get the text from the code editor into another app like
> MS
> Word while retaining the font color coding?
> tx
|||Thanks, Aaron. It's kind of brute force. I have been using ADO and catalog
views to extract meta data and then try to mimic the default color coding in
MS Word but it is a challenge of a different kind.
"Aaron Bertrand [SQL Server MVP]" wrote:
> This is what happens when you select code from Management Studio's query
> editor and paste into Word. I don't think there is any magic for doing this
> from Query Analyzer (the color coding is not part of what is transfered to
> the clipboard).
>
>
>
> "Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
> news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
>
>
Word while retaining the font color coding?
tx
This is what happens when you select code from Management Studio's query
editor and paste into Word. I don't think there is any magic for doing this
from Query Analyzer (the color coding is not part of what is transfered to
the clipboard).
"Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
> Is it possible to get the text from the code editor into another app like
> MS
> Word while retaining the font color coding?
> tx
|||Thanks, Aaron. It's kind of brute force. I have been using ADO and catalog
views to extract meta data and then try to mimic the default color coding in
MS Word but it is a challenge of a different kind.
"Aaron Bertrand [SQL Server MVP]" wrote:
> This is what happens when you select code from Management Studio's query
> editor and paste into Word. I don't think there is any magic for doing this
> from Query Analyzer (the color coding is not part of what is transfered to
> the clipboard).
>
>
>
> "Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
> news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
>
>
Wednesday, March 7, 2012
Expression for Color property
I keep getting a message when setting the expression for the color property.
When I exit the expression builder an error message is displayed showing the
expression and "not a valid color". I have tried numerous IIF but cannot get
past the error.
IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
What am I missing? Thanks in advance...Make sure you put a = sign before IIF
so the expression should be
=IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
Hope this helps
RP
"Stanley Hammer" wrote:
> I keep getting a message when setting the expression for the color property.
> When I exit the expression builder an error message is displayed showing the
> expression and "not a valid color". I have tried numerous IIF but cannot get
> past the error.
> IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> What am I missing? Thanks in advance...|||Thanks, that worked great.
"RP" wrote:
> Make sure you put a = sign before IIF
> so the expression should be
> =IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> Hope this helps
> RP
> "Stanley Hammer" wrote:
> > I keep getting a message when setting the expression for the color property.
> > When I exit the expression builder an error message is displayed showing the
> > expression and "not a valid color". I have tried numerous IIF but cannot get
> > past the error.
> >
> > IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> >
> > What am I missing? Thanks in advance...
When I exit the expression builder an error message is displayed showing the
expression and "not a valid color". I have tried numerous IIF but cannot get
past the error.
IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
What am I missing? Thanks in advance...Make sure you put a = sign before IIF
so the expression should be
=IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
Hope this helps
RP
"Stanley Hammer" wrote:
> I keep getting a message when setting the expression for the color property.
> When I exit the expression builder an error message is displayed showing the
> expression and "not a valid color". I have tried numerous IIF but cannot get
> past the error.
> IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> What am I missing? Thanks in advance...|||Thanks, that worked great.
"RP" wrote:
> Make sure you put a = sign before IIF
> so the expression should be
> =IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> Hope this helps
> RP
> "Stanley Hammer" wrote:
> > I keep getting a message when setting the expression for the color property.
> > When I exit the expression builder an error message is displayed showing the
> > expression and "not a valid color". I have tried numerous IIF but cannot get
> > past the error.
> >
> > IIF( Fields!ACCOUNT_STATUS.Value="LOCKED","Red","Green")
> >
> > What am I missing? Thanks in advance...
Expression Data Type Conversion
I am getting the following error in my report. I am tring to program the BackgroungColor Expression so the if the value is null display a blue color else leave it white.
Conversion from string "" to type 'Date' is not valid
Here is my code sample:
=Iif(Fields!ReturnTime.Value = "", "AliceBlue", "White")
Hi RayClark,You cannot compare a string with a date.
You can do this in several ways here is one:
=IIF(Len(Fields!ReturnTime.Value)=0, "AliceBlue", "White")
Use the length function to check the length of return time. If it is 0 set it to alice blue else set it to white :).
http://jhermiz.googlepages.com|||Thanks that worked great!!!
expression
In RS, is it possible to code an expression so that if a field contains the
word "STAT" that whole row is highlighted in another color? If not, how about
a that field?
I can do it with numeric values, not text.
Thanks.On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> In RS, is it possible to code an expression so that if a field contains the
> word "STAT" that whole row is highlighted in another color? If not, how about
> a that field?
> I can do it with numeric values, not text.
> Thanks.
In Layout view, select the field that you want to change the
background color for and select F4 (for the Properties window). To the
right of Background Color, select <Expression...> and enter an
expression similar to the following:
=iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||That worked. I ad the syntax wrong. Thanks!
"EMartinez" wrote:
> On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > In RS, is it possible to code an expression so that if a field contains the
> > word "STAT" that whole row is highlighted in another color? If not, how about
> > a that field?
> >
> > I can do it with numeric values, not text.
> >
> > Thanks.
>
> In Layout view, select the field that you want to change the
> background color for and select F4 (for the Properties window). To the
> right of Background Color, select <Expression...> and enter an
> expression similar to the following:
> =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On May 24, 9:12 pm, brian <b...@.discussions.microsoft.com> wrote:
> That worked. I ad the syntax wrong. Thanks!
> "EMartinez" wrote:
> > On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > > In RS, is it possible to code an expression so that if a field contains the
> > > word "STAT" that whole row is highlighted in another color? If not, how about
> > > a that field?
> > > I can do it with numeric values, not text.
> > > Thanks.
> > In Layout view, select the field that you want to change the
> > background color for and select F4 (for the Properties window). To the
> > right of Background Color, select <Expression...> and enter an
> > expression similar to the following:
> > =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. Glad I could be of assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
word "STAT" that whole row is highlighted in another color? If not, how about
a that field?
I can do it with numeric values, not text.
Thanks.On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> In RS, is it possible to code an expression so that if a field contains the
> word "STAT" that whole row is highlighted in another color? If not, how about
> a that field?
> I can do it with numeric values, not text.
> Thanks.
In Layout view, select the field that you want to change the
background color for and select F4 (for the Properties window). To the
right of Background Color, select <Expression...> and enter an
expression similar to the following:
=iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||That worked. I ad the syntax wrong. Thanks!
"EMartinez" wrote:
> On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > In RS, is it possible to code an expression so that if a field contains the
> > word "STAT" that whole row is highlighted in another color? If not, how about
> > a that field?
> >
> > I can do it with numeric values, not text.
> >
> > Thanks.
>
> In Layout view, select the field that you want to change the
> background color for and select F4 (for the Properties window). To the
> right of Background Color, select <Expression...> and enter an
> expression similar to the following:
> =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On May 24, 9:12 pm, brian <b...@.discussions.microsoft.com> wrote:
> That worked. I ad the syntax wrong. Thanks!
> "EMartinez" wrote:
> > On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > > In RS, is it possible to code an expression so that if a field contains the
> > > word "STAT" that whole row is highlighted in another color? If not, how about
> > > a that field?
> > > I can do it with numeric values, not text.
> > > Thanks.
> > In Layout view, select the field that you want to change the
> > background color for and select F4 (for the Properties window). To the
> > right of Background Color, select <Expression...> and enter an
> > expression similar to the following:
> > =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. Glad I could be of assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
Friday, February 17, 2012
Exporting to Excel
I am having problems exporting to excel. When I try to export a report from
the SQL Server Reporting Services website the conditional color formating
doesn't come acrost. The nonconditional color formating comes acrost just
fine. If I try to export the same report from Visual Studio the formaing
exports just fine. What am I doing wrong or how can i get this to work.I read somewhere (though I can't remember where) that not all colours will
export to excel. Try changing the colour you are using for your conditional
hilighting to the same colour as that which you already have displayed in
excel. All my conditional colours display fine - though I don't have any
non-conditional colours if that makes sense.
"KO" wrote:
> I am having problems exporting to excel. When I try to export a report from
> the SQL Server Reporting Services website the conditional color formating
> doesn't come acrost. The nonconditional color formating comes acrost just
> fine. If I try to export the same report from Visual Studio the formaing
> exports just fine. What am I doing wrong or how can i get this to work.|||I've came across this issue recently. It not necessarily that the colors
don't come across. In the process formulas/functions are converted to an
Excel equivalent if one is found. The formulas/functions that get translated
are those that use report item expressions, not field expressions.
Otherwise, the result of the expression is stored in a cell as a constant
value.
For example, if a textbox contains an expression like
=Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
to that in Excel. So if you are using an IIF function in the color property
and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
Black) Excel doesn't know how to translate the Field expression. So it goes
with the first color Red and all the values in that column come out red.|||Hi russsage,
i've the same issue but i refer to ReportITems and not to Field...
can you give me some more tips?
Many thanks
"russsage" wrote:
> I've came across this issue recently. It not necessarily that the colors
> don't come across. In the process formulas/functions are converted to an
> Excel equivalent if one is found. The formulas/functions that get translated
> are those that use report item expressions, not field expressions.
> Otherwise, the result of the expression is stored in a cell as a constant
> value.
> For example, if a textbox contains an expression like
> =Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
> to that in Excel. So if you are using an IIF function in the color property
> and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
> Black) Excel doesn't know how to translate the Field expression. So it goes
> with the first color Red and all the values in that column come out red.|||I also had a color problem and hide/visible problem when exporting to excel.
I found that you must surround your settings in quotes otherwise you can get
unexpected results...
=IIF(Fields!UnitPrice.Value > 1500, "Red", "Black")
I have even had to set a standard value like this ="Visible". I know it
sounds wierd but it has worked in some instances for me.
Also... ditto on the color translation to excel. If the color is not in your
default excel palette then excel will mangle it and try to set it to the
nearest color. Some of my red shades end up as purple in excel. It can make
a nice report in RS look very ugly in excel.
Bill
russsage wrote:
>I've came across this issue recently. It not necessarily that the colors
>don't come across. In the process formulas/functions are converted to an
>Excel equivalent if one is found. The formulas/functions that get translated
>are those that use report item expressions, not field expressions.
>Otherwise, the result of the expression is stored in a cell as a constant
>value.
>For example, if a textbox contains an expression like
>=Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
>to that in Excel. So if you are using an IIF function in the color property
>and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
>Black) Excel doesn't know how to translate the Field expression. So it goes
>with the first color Red and all the values in that column come out red.
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200512/1
the SQL Server Reporting Services website the conditional color formating
doesn't come acrost. The nonconditional color formating comes acrost just
fine. If I try to export the same report from Visual Studio the formaing
exports just fine. What am I doing wrong or how can i get this to work.I read somewhere (though I can't remember where) that not all colours will
export to excel. Try changing the colour you are using for your conditional
hilighting to the same colour as that which you already have displayed in
excel. All my conditional colours display fine - though I don't have any
non-conditional colours if that makes sense.
"KO" wrote:
> I am having problems exporting to excel. When I try to export a report from
> the SQL Server Reporting Services website the conditional color formating
> doesn't come acrost. The nonconditional color formating comes acrost just
> fine. If I try to export the same report from Visual Studio the formaing
> exports just fine. What am I doing wrong or how can i get this to work.|||I've came across this issue recently. It not necessarily that the colors
don't come across. In the process formulas/functions are converted to an
Excel equivalent if one is found. The formulas/functions that get translated
are those that use report item expressions, not field expressions.
Otherwise, the result of the expression is stored in a cell as a constant
value.
For example, if a textbox contains an expression like
=Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
to that in Excel. So if you are using an IIF function in the color property
and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
Black) Excel doesn't know how to translate the Field expression. So it goes
with the first color Red and all the values in that column come out red.|||Hi russsage,
i've the same issue but i refer to ReportITems and not to Field...
can you give me some more tips?
Many thanks
"russsage" wrote:
> I've came across this issue recently. It not necessarily that the colors
> don't come across. In the process formulas/functions are converted to an
> Excel equivalent if one is found. The formulas/functions that get translated
> are those that use report item expressions, not field expressions.
> Otherwise, the result of the expression is stored in a cell as a constant
> value.
> For example, if a textbox contains an expression like
> =Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
> to that in Excel. So if you are using an IIF function in the color property
> and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
> Black) Excel doesn't know how to translate the Field expression. So it goes
> with the first color Red and all the values in that column come out red.|||I also had a color problem and hide/visible problem when exporting to excel.
I found that you must surround your settings in quotes otherwise you can get
unexpected results...
=IIF(Fields!UnitPrice.Value > 1500, "Red", "Black")
I have even had to set a standard value like this ="Visible". I know it
sounds wierd but it has worked in some instances for me.
Also... ditto on the color translation to excel. If the color is not in your
default excel palette then excel will mangle it and try to set it to the
nearest color. Some of my red shades end up as purple in excel. It can make
a nice report in RS look very ugly in excel.
Bill
russsage wrote:
>I've came across this issue recently. It not necessarily that the colors
>don't come across. In the process formulas/functions are converted to an
>Excel equivalent if one is found. The formulas/functions that get translated
>are those that use report item expressions, not field expressions.
>Otherwise, the result of the expression is stored in a cell as a constant
>value.
>For example, if a textbox contains an expression like
>=Sum(Fields!UnitPrice.Value * Fields!OrderQty.Value) there is no equivalent
>to that in Excel. So if you are using an IIF function in the color property
>and your doing a test on a field: =IIF(Fields!UnitPrice.Value > 1500, Red,
>Black) Excel doesn't know how to translate the Field expression. So it goes
>with the first color Red and all the values in that column come out red.
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200512/1
Subscribe to:
Posts (Atom)