Showing posts with label certain. Show all posts
Showing posts with label certain. Show all posts

Monday, March 26, 2012

Formatting text in using Report Designer

Hello,

I am designing a report which has some static and dynamic data. The static content is a huge text and I want to highlight certain portions of the text with bold font and in some places with different color.

I am using textbox report item to draft the static text. But unfortunately, I am not able to change the font of a portion of the text. If I change the font, by highlighing some text, it changes for all the text in the text box.

Can you please help to solve this problem?

-Srinivas

The bits of text you want to change will have to be treated as separate pieces of data and be in a separate container (ie textbox). Do you know what they are ahead of time? You could try having a bunch of textboxes lined up end to end, and set CanGrow to true - but it would still be difficult to get this looking good.

sluggy

|||Earlier, I have tried having series of textbox's as in the similar way as you have suggested. And that works.

But I want to do that in one control so that it will be easy to format and gives the flexibility to work on complete text (instead of bits of text) and also align the text as needed.

Is there a way?

Friday, March 23, 2012

formatting output

Hi, I am running a script which inserts certain rows into a table and at the end of the execution, I do a select statement to show the inserted data as output in the results pane and it is showing as truncated...How can I show the full results..
Here is my script to show the results.
----
SET NOCOUNT ON
DECLARE @.errorCount INT
SELECT @.errorCount = COUNT(*) FROM error_report WHERE id != - 2 AND id != - 5
IF @.errorCount = 0
BEGIN
INSERT INTO error_report VALUES( '' , - 1 , 'No error found.' )
END
INSERT INTO error_report VALUES( '' , - 2 , 'The Report was generated on ' + CAST(CONVERT(VARCHAR(23), GETDATE(), 1) AS VARCHAR) )
GO
SELECT table_name + ' table has bad data at id = ' + CAST(CONVERT(VARCHAR(23), id) AS VARCHAR) + ' (' + CAST(reason AS VARCHAR) + ')'FROM error_report WHERE id > 0
SELECT table_name + ' table has bad data (' + CAST(reason AS VARCHAR) + ')' FROM error_report WHERE id = 0
SELECT reason FROM error_report WHERE id = - 1
SELECT ''
SELECT reason FROM error_report WHERE id = - 2
SET NOCOUNT OFF
GO
--------
The Results in the bottom pane looks like this below
------
NODETABLE table has bad data (There are 2 duplicate subclass)
Propertytable table has bad data (at Parentid = 2000000859 and p)
Propertytable table has bad data (at Parentid = 10122 and proper)
------
But, when I do a select, they are like this below
--

NODETABLE 0 There are 2 duplicate subclass name: Specification
Propertytable 0 at Parentid = 2000000859 and propertyid = 721
Propertytable 0 at Parentid = 10122 and propertyid = 9That sounds like a grid limitation to me. I'd suggest Ctrl-T to set text mode, then Ctrl-E to execute the query again.

-PatP|||Hi Pat,
It outputted in the text format but the results are the same. However when I do select statement, it is fine.|||You need to explicitly specify the size for VARCHAR fields.|||Hi LOOKING AT THE ABOVE CODE, CAN YOU TELL ME WHERE IT IS?|||For example, here:

'The Report was generated on ' + CAST(CONVERT(VARCHAR(23), GETDATE(), 1) AS VARCHAR(8)) )

But you also don't need that CAST.

'The Report was generated on ' + CONVERT(VARCHAR(8), GETDATE(), 1)

Friday, March 9, 2012

FORMAT_STRING For Calculation

I have a calculation that gives the evolution of a certain measure over 1 month in percentage.

MAR2006 : 1000

APR2006: 1100

> calculation = 10%

MAR2006 : 1000

APR2006: 900

--> calculation = -10%

This works perfect ... but the users of my application ask me if I can put a '+' sign for positive evolutions.

In the first case they want to see '+10%' in stead of '10%'

This is the FORMAT_STRING I am using : "#0.00%"

Any idea ?

Hi Christophe,

You need to include two sections in your format string definition, the first for the positive values and the second for the negative values. Here's an example from Adventure Works which does what you want, I think:

with

member measures.test as (7000000 - [Measures].[Internet Sales Amount])/[Measures].[Internet Sales Amount]

, format_string='+#0.00%; -#0.00%'

select measures.test on 0,

[Date].[Calendar Year].members on 1

from [Adventure Works]

HTH,

Chris

|||

THANKS A LOT.

Just tested it and it works.

Wednesday, March 7, 2012

Format of tables

Hello,

I have the following problem; In my application I have certain items that
have properties.

Item Property
--- --------
ToyBear Hairy, Soft, Brown
ToyCar Brown, Plastic, Wheels
ToyBall Round, Soft, Brown, Plastic

As you might expect I want to do queries on the properties; so property
Brown should yield all items listed above and Plastic should yield only
ToyCar and ToyBall.
The amount of properties is limitless, so making a separate field per
property seems to be madness. My question is how can I make a (or more)
tables that will enable me to search for items by applying one or more
properties?? What structure do I need to accomplish this?

Kind regards, Darius Blaszijk"Darius Blaszijk" <dhkblaszyjk@.zeelandnet.nl> wrote in message
news:41060ef3$0$13577$fb624cd1@.morenews.zeelandnet .nl...
> Hello,
> I have the following problem; In my application I have certain items that
> have properties.
> Item Property
> --- --------
> ToyBear Hairy, Soft, Brown
> ToyCar Brown, Plastic, Wheels
> ToyBall Round, Soft, Brown, Plastic
> As you might expect I want to do queries on the properties; so property
> Brown should yield all items listed above and Plastic should yield only
> ToyCar and ToyBall.
> The amount of properties is limitless, so making a separate field per
> property seems to be madness. My question is how can I make a (or more)
> tables that will enable me to search for items by applying one or more
> properties?? What structure do I need to accomplish this?
> Kind regards, Darius Blaszijk

The obvious thing would be to have two tables - TB_Item and TB_Property.
TB_Property has a foriegn key referencing into TB_Item.

Therefore, you're definition would look something like this:

CREATE DATABASE TB_Item (
name VARCHAR (30),

CONSTRAINT PK_TB_Item
PRIMARY KEY (name)
)

CREATE DATABASE TB_Property (
itemName VARCHAR (30)
propName VARCHAR (30)

CONSTRAINT FK_TB_Item_name
FOREIGN KEY (itemName)
REFERENCES TB_Approver_Type (name)
)

Then, to populate the database for the example of ToyBear given above, do:
INSERT INTO TB_Item (name) VALUES ('ToyBear')
GO
INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Hairy')
INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Soft')
INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Brown')

Hope that is clear, and answers your question,

Rowland.|||"Rowland Banks" <banksr0@.hotmail.com> wrote in message
news:ce544k$6mp$1@.sparta.btinternet.com...
> "Darius Blaszijk" <dhkblaszyjk@.zeelandnet.nl> wrote in message
> news:41060ef3$0$13577$fb624cd1@.morenews.zeelandnet .nl...
> > Hello,
> > I have the following problem; In my application I have certain items
that
> > have properties.
> > Item Property
> > --- --------
> > ToyBear Hairy, Soft, Brown
> > ToyCar Brown, Plastic, Wheels
> > ToyBall Round, Soft, Brown, Plastic
> > As you might expect I want to do queries on the properties; so property
> > Brown should yield all items listed above and Plastic should yield only
> > ToyCar and ToyBall.
> > The amount of properties is limitless, so making a separate field per
> > property seems to be madness. My question is how can I make a (or more)
> > tables that will enable me to search for items by applying one or more
> > properties?? What structure do I need to accomplish this?
> > Kind regards, Darius Blaszijk
> The obvious thing would be to have two tables - TB_Item and TB_Property.
> TB_Property has a foriegn key referencing into TB_Item.
> Therefore, you're definition would look something like this:
> CREATE DATABASE TB_Item (
> name VARCHAR (30),
> CONSTRAINT PK_TB_Item
> PRIMARY KEY (name)
> )
> CREATE DATABASE TB_Property (
> itemName VARCHAR (30)
> propName VARCHAR (30)
> CONSTRAINT FK_TB_Item_name
> FOREIGN KEY (itemName)
> REFERENCES TB_Approver_Type (name)
> )
> Then, to populate the database for the example of ToyBear given above, do:
> INSERT INTO TB_Item (name) VALUES ('ToyBear')
> GO
> INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Hairy')
> INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Soft')
> INSERT INTO TB_Property (itemName, propName) VALUES ('ToyBear', 'Brown')
> Hope that is clear, and answers your question,
> Rowland.
ADDENDUM:
I just read through your post again and I missed a bit. To extract the
information, use somethign similar to:

SELECT i.name
FROM TB_Item AS i, TB_Property AS p
WHERE i.name = p.itemName
AND p.itemName = 'Hairy'

hope that helps,

Rowland

Friday, February 24, 2012

Format Expression

My client's want certain areas of my expression to be bold and also a
different color. Via HTML or CSS this would be the solution:
="<b><font color=blue>Resource(s) Name:</font></b> " &
Fields!ResourceName.Value & vbcrlf &
"<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf &
vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other Resource
Role:</font></b> " & Fields!OtherResourceRole.Value
However, this does not work with SSRS. Is this something that will be
allowed in SSRS 2008 or is it possible with 2005?
--
<moojjoo/>RS 2008 is going support rich format. I have not played with the CTPs
(general pre-release software) so I am not totally firm in my head on how
this support will show itself.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
news:522D7736-6B3C-48BB-8DC7-D9147A802978@.microsoft.com...
> My client's want certain areas of my expression to be bold and also a
> different color. Via HTML or CSS this would be the solution:
> ="<b><font color=blue>Resource(s) Name:</font></b> " &
> Fields!ResourceName.Value & vbcrlf &
> "<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf &
> vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
> Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other
> Resource
> Role:</font></b> " & Fields!OtherResourceRole.Value
> However, this does not work with SSRS. Is this something that will be
> allowed in SSRS 2008 or is it possible with 2005?
> --
> <moojjoo/>|||So basically I am up the river without a paddle on what my client wants at
this time with formating the font?
--
<moojjoo/>
"Bruce L-C [MVP]" wrote:
> RS 2008 is going support rich format. I have not played with the CTPs
> (general pre-release software) so I am not totally firm in my head on how
> this support will show itself.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
> news:522D7736-6B3C-48BB-8DC7-D9147A802978@.microsoft.com...
> > My client's want certain areas of my expression to be bold and also a
> > different color. Via HTML or CSS this would be the solution:
> >
> > ="<b><font color=blue>Resource(s) Name:</font></b> " &
> > Fields!ResourceName.Value & vbcrlf &
> > "<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf &
> > vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
> > Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other
> > Resource
> > Role:</font></b> " & Fields!OtherResourceRole.Value
> >
> > However, this does not work with SSRS. Is this something that will be
> > allowed in SSRS 2008 or is it possible with 2005?
> > --
> > <moojjoo/>
>
>|||You can do things like put multiple text boxes next to each other and format
each of those (which really only works for very simple scenarios).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
news:17509CDD-B058-44DF-8DD9-004D6B027AF4@.microsoft.com...
> So basically I am up the river without a paddle on what my client wants at
> this time with formating the font?
> --
> <moojjoo/>
>
> "Bruce L-C [MVP]" wrote:
>> RS 2008 is going support rich format. I have not played with the CTPs
>> (general pre-release software) so I am not totally firm in my head on how
>> this support will show itself.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
>> news:522D7736-6B3C-48BB-8DC7-D9147A802978@.microsoft.com...
>> > My client's want certain areas of my expression to be bold and also a
>> > different color. Via HTML or CSS this would be the solution:
>> >
>> > ="<b><font color=blue>Resource(s) Name:</font></b> " &
>> > Fields!ResourceName.Value & vbcrlf &
>> > "<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf &
>> > vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
>> > Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other
>> > Resource
>> > Role:</font></b> " & Fields!OtherResourceRole.Value
>> >
>> > However, this does not work with SSRS. Is this something that will be
>> > allowed in SSRS 2008 or is it possible with 2005?
>> > --
>> > <moojjoo/>
>>|||Bruce, I totally can understand that the only problem is I have this in a
table... and they are wanting multiple items in a cell along with that
formatting I am referrring to.
--
<moojjoo/>
"Moojjoo" wrote:
> So basically I am up the river without a paddle on what my client wants at
> this time with formating the font?
> --
> <moojjoo/>
>
> "Bruce L-C [MVP]" wrote:
> > RS 2008 is going support rich format. I have not played with the CTPs
> > (general pre-release software) so I am not totally firm in my head on how
> > this support will show itself.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
> > news:522D7736-6B3C-48BB-8DC7-D9147A802978@.microsoft.com...
> > > My client's want certain areas of my expression to be bold and also a
> > > different color. Via HTML or CSS this would be the solution:
> > >
> > > ="<b><font color=blue>Resource(s) Name:</font></b> " &
> > > Fields!ResourceName.Value & vbcrlf &
> > > "<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf &
> > > vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
> > > Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other
> > > Resource
> > > Role:</font></b> " & Fields!OtherResourceRole.Value
> > >
> > > However, this does not work with SSRS. Is this something that will be
> > > allowed in SSRS 2008 or is it possible with 2005?
> > > --
> > > <moojjoo/>
> >
> >
> >|||You are out of luck. This is very common requirement which is why it is
being implemented in RS 2008.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
news:C4A3785A-A03A-4855-B524-F6E9A65D39E4@.microsoft.com...
> Bruce, I totally can understand that the only problem is I have this in a
> table... and they are wanting multiple items in a cell along with that
> formatting I am referrring to.
> --
> <moojjoo/>
>
> "Moojjoo" wrote:
>> So basically I am up the river without a paddle on what my client wants
>> at
>> this time with formating the font?
>> --
>> <moojjoo/>
>>
>> "Bruce L-C [MVP]" wrote:
>> > RS 2008 is going support rich format. I have not played with the CTPs
>> > (general pre-release software) so I am not totally firm in my head on
>> > how
>> > this support will show itself.
>> >
>> >
>> > --
>> > Bruce Loehle-Conger
>> > MVP SQL Server Reporting Services
>> >
>> > "Moojjoo" <Moojjoo@.discussions.microsoft.com> wrote in message
>> > news:522D7736-6B3C-48BB-8DC7-D9147A802978@.microsoft.com...
>> > > My client's want certain areas of my expression to be bold and also a
>> > > different color. Via HTML or CSS this would be the solution:
>> > >
>> > > ="<b><font color=blue>Resource(s) Name:</font></b> " &
>> > > Fields!ResourceName.Value & vbcrlf &
>> > > "<b><font color=blue>Role:</font></b> " & Fields!Role.Value & vbcrlf
>> > > &
>> > > vbcrlf & "<b><font color=blue>Other Resource(s) Name:</font></b> " &
>> > > Fields!OtherResourceName.Value & vbcrlf & "<b><font color=blue>Other
>> > > Resource
>> > > Role:</font></b> " & Fields!OtherResourceRole.Value
>> > >
>> > > However, this does not work with SSRS. Is this something that will
>> > > be
>> > > allowed in SSRS 2008 or is it possible with 2005?
>> > > --
>> > > <moojjoo/>
>> >
>> >
>> >