Showing posts with label suppose. Show all posts
Showing posts with label suppose. Show all posts

Monday, March 19, 2012

Dynamically set different font weight for each text in the textbox

Hi friends,

I have a text box with n number of text.

I want to set the font weight of each text in the textbox dynamically..

For eg.. suppose the text of the textbox is "Hello Friends", then i need "Hello Friends" as output.

Is there any way to accomplish this in SQL Reporting Service.

Any help will be appreciated. Its critical.

Please help me out ASAP.

No, the font settings are per textbox, so everything in the textbox will have the same font weight. You can use different textboxes, but that ends up pretty messy.

|||

Yes it is possible. However, it is not easy and you will need Visual Studio 2005 to do it.

It sounds like you are basically wanting to change the layout of the report at runtime.

Here is how to do it:

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

After you are able to change the layout of the report at runtime, you will want to deploy the report from your application using SetReportDefinition.

|||

Greg, are you thinking that he would create a separate textbox for each wordin the original textbox to handle this requirement, so that each one would have its own formatting? How would that work, for different instances of the same textbox in the report (for example, the first one reads "this is my text" and "is" should be bold, but the second instance reads "this is not really my text" and the word "my" should be bold?

Also I think the positioning/kerning would be a nightmare...

>L<

|||

The only way I know how to do this successfully in Reporting Services (although Greg may have another approach, I'm not seeing it!), is to do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<

|||

Lisa Nicholls wrote:

The only way I know how to do this successfully in Reporting Services (although Greg may have another approach, I'm not seeing it!), is to do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<

This sounds like a better approach. I suppose I was thinking that you could change the font weight per word.

|||

Thanks Lisa and Greg for the answers .. I am sorry to reply late.. I was trying out lisa's solution.

But my scenario is different. I have a text bos and the expression of my textbox is as follows:

="Dear"+" "+Ucase("Robert")+space(2)+vbcrlf+"How are you"

where "vbclrf" is for new line and "space(2)" is for leaving 2 spaces between the text and "Ucase" stands for upper case.

Similarly I need a way to display the text "Robert" in bold letters.

Do you have any suggestion for this.

|||

Lisa Nicholls wrote:

...do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<

It still sounds like this is what you need.

|||


>>But my scenario is different.

No, really, it's exactly what I thought. If you tried what I suggested... what exactly did you try?

In the current version of RS, what you need to do is build a function that parses your markup in a

CustomReportItem, and renders the content appropriately for your markup.

In the next version of RS (Katmai -- there is a thread post about rich text) you might have a

better choice, from the point of view of rendering. IOW, you would not have to use a

CustomReportItem for this. However, given your custom markup, you would still have to create a

code function to parse the markup and put it in a more standard form, such as HTML markup or RTF

or whatever Katmai supports, so that the standard rendering could deal with it.

For this reason, I strongly suggest you think about switching to a standard markup format that

standard renderers, whether in RS or elsewhere, could read! Your users and designers will also

thank you for it.

>L<

Friday, February 24, 2012

Dynamic Table Creation

Hi
I wish to create a table through sql code which picks up fields from
different tables in the database.
Lets suppose I have TableA with fields 'W' and 'X'. TableB has fields 'Y'
and 'Z'. I want to create a TableC with fields 'W', 'X', 'Y' and 'Z'.
Is this possible? Any help is greatly appreciated. Thanks!
MJTry,
select a.w, a.x, b.y, b.z
into tablec
from tablaA as a inner join tableb as b on 0 = 1
This will not create constraints. You have to alter tablc and add them
manually.
AMB
"MJ" wrote:

> Hi
> I wish to create a table through sql code which picks up fields from
> different tables in the database.
> Lets suppose I have TableA with fields 'W' and 'X'. TableB has fields 'Y'
> and 'Z'. I want to create a TableC with fields 'W', 'X', 'Y' and 'Z'.
> Is this possible? Any help is greatly appreciated. Thanks!
> MJ|||MJ,
In order to give a query for this, you need to provide the rule
that explains when to put TableA.W and TableA.X in the same
output row as TableB.Y and TableB.Z.
For example, say TableA is PeoplePhoneNumbers, and has columns
(Name,Phone), and TableB is CarLicenses with tables (VINnumber, License),
how do you match up name,phone pairs with VINnumber, license pairs?
Even if you don't care how things are matched up, you still need to decide
on a specific rule to follow.
Steve Kass
Drew University
MJ wrote:

>Hi
>I wish to create a table through sql code which picks up fields from
>different tables in the database.
>Lets suppose I have TableA with fields 'W' and 'X'. TableB has fields 'Y'
>and 'Z'. I want to create a TableC with fields 'W', 'X', 'Y' and 'Z'.
>Is this possible? Any help is greatly appreciated. Thanks!
>MJ
>|||Hi yes using AMB's code it worked fine. I dont really care how they match
up and I think the constaint 0 = 1 allows for that.
Thanks both you guys!
MJ
"Steve Kass" wrote:

> MJ,
> In order to give a query for this, you need to provide the rule
> that explains when to put TableA.W and TableA.X in the same
> output row as TableB.Y and TableB.Z.
> For example, say TableA is PeoplePhoneNumbers, and has columns
> (Name,Phone), and TableB is CarLicenses with tables (VINnumber, License),
> how do you match up name,phone pairs with VINnumber, license pairs?
> Even if you don't care how things are matched up, you still need to deci
de
> on a specific rule to follow.
> Steve Kass
> Drew University
> MJ wrote:
>
>|||Columns are not fields; rows are not records. This is basic.
It sounds like you want to create a table on the fly, after the data
model is implemented. Surely not! That would mean that you have no
data model yet and should not have implemented a schema. You can
kludge it, but yu can also learn to be a good SQL programmer instead.|||Ah - I was under the assumption you wanted to put data into the
table, not just create an empty table. Alejandro's suggestion is
an excellent one for what you want.
SK
MJ wrote:
>Hi yes using AMB's code it worked fine. I dont really care how they match
>up and I think the constaint 0 = 1 allows for that.
>Thanks both you guys!
>MJ
>"Steve Kass" wrote:
>
>

Dynamic table creation

Suppose I have a table named table1 which has a field question_Id.There are many values for this field say 100,101,102.
Now I want to make a table with the field name 100,101,102 but the problem is that it is not fixed how many values are there for question_id.Here in this example I mentioned three(100,101,102) but it may be anything.How can I make a table with the field names this way?
SubhasishOriginally posted by subhasishray
Suppose I have a table named table1 which has a field question_Id.There are many values for this field say 100,101,102.
Now I want to make a table with the field name 100,101,102 but the problem is that it is not fixed how many values are there for question_id.Here in this example I mentioned three(100,101,102) but it may be anything.How can I make a table with the field names this way?
Subhasish

Why do you want to do this?
Looks like you're after some kind of crosstab report, right?|||Yes Frank I need that.How to do?|||Two of the better solutions to this can be found here
http://www.winnetmag.com/SQLServer/Article/ArticleID/15608/15608.html
or
http://www.sqlteam.com/item.asp?ItemID=2955

Btw, personally I think this thing should strictly be done at the client as this is more of data presentation.

HTH