Showing posts with label textbox. Show all posts
Showing posts with label textbox. Show all posts

Monday, March 26, 2012

Easy question - changing Visibility of textbox

I'm trying to affect the visibility of a text box based upon a field value
returned in my dataset. The field is a summed field, and I simply do NOT
want to show the field if it is 0, less than zero, or NULL.
What should my expression for the "Visbility" property look like?
TIA,
--
Brian Grant
Senior Programmer
SI International
www.si-intl.comiif(Parameters!Fieldname.Value <= 0 OR Parameters!Fieldname.Value IS Nothing, True, False)
"G" wrote:
> I'm trying to affect the visibility of a text box based upon a field value
> returned in my dataset. The field is a summed field, and I simply do NOT
> want to show the field if it is 0, less than zero, or NULL.
> What should my expression for the "Visbility" property look like?
> TIA,
> --
> Brian Grant
> Senior Programmer
> SI International
> www.si-intl.com
>
>|||IS Nothing
that is what was tripping me up, thanks comet.
--
Brian Grant
Senior Programmer
SI International
www.si-intl.com
"comet61" <comet61@.discussions.microsoft.com> wrote in message
news:CFF1A78C-9DE1-475E-9BB9-5D4D6F4EAE04@.microsoft.com...
> iif(Parameters!Fieldname.Value <= 0 OR Parameters!Fieldname.Value IS
Nothing, True, False)
> "G" wrote:
> > I'm trying to affect the visibility of a text box based upon a field
value
> > returned in my dataset. The field is a summed field, and I simply do NOT
> > want to show the field if it is 0, less than zero, or NULL.
> >
> > What should my expression for the "Visbility" property look like?
> >
> > TIA,
> >
> > --
> > Brian Grant
> > Senior Programmer
> > SI International
> > www.si-intl.com
> >
> >
> >

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<

Dynamically retrieve the name of all the parameters for a report.

Does anyone know, if you are inside the body of a report, of a way to have a
textbox dynamically populated with the name of all the parameters that are on
that report?
So, the idea is, this textbox in the body of the report would have some
expression, and that expression would always return the names of all
parameters that are defined for the report. So, if someone changes the report
to use have a new parameter, this textbox would automatically show the name
of that new parameter.
Any help would be greatly appreciated.
Thanks.Sorry, this is not supported at this point.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mike Barzilli" <Mike Barzilli@.discussions.microsoft.com> wrote in message
news:D21AC308-F48C-4F68-B189-4737E03DFEC1@.microsoft.com...
> Does anyone know, if you are inside the body of a report, of a way to have
> a
> textbox dynamically populated with the name of all the parameters that are
> on
> that report?
> So, the idea is, this textbox in the body of the report would have some
> expression, and that expression would always return the names of all
> parameters that are defined for the report. So, if someone changes the
> report
> to use have a new parameter, this textbox would automatically show the
> name
> of that new parameter.
> Any help would be greatly appreciated.
> Thanks.

Friday, March 9, 2012

Dynamically changing position of Textbox

Hi,

In my report, I've to print the address of the customer in a form which is in a pre-defined format. So while printing, the line number and position should be specified by the user. Is there any ways in SSRS to change the position of a textbox/any control dynamically by inputing the x and y coordinates? If there is a way please let me know that.

Thanks in Advance,

Leks

What does the surrounding content in the layout look like? Do you have a "clear" region in which you could place a very large textbox, representing the all the page area in which the textbox could potentially be placed?

If so, you might be able to do this with padding. IOW, you would place this very large textbox in the layout and then you would pad the top and left to "push" the content of the text box into the customer's preferred position, at runtime.

This is possible because you can express the padding values as expressions. Think of the textbox's true top and left as an offset from 0,0, which you will subtract from the customer's input values (which will be parameters) to get the padded top and left at runtime.

HTH,

>L<

|||

Hi Lisa,

Thanks for your quick reply. But unfortunately my layout is not clear. It contains other data too that I need to position according to the input for them. For each item in the report we have to enter the position. I know this process is a bit tedious. but there is no other ways. They actualy need the report data such that it can be printed in many forms. Please reply as soon as possible.

Thank you dear,

Leks

|||

Hi Leks,

If you have to enter the position of each item in the report, then I think your best option is to edit the RDL on the fly, put your coordinates right in the report definition.

Are you comfortable with doing this? It may be quite straightward. Some things that would enter into it and might change what you have to do would include:

* -- What type of data region are you using (list/table) to contain the dynamic items?

* -- Are there additional items in the report that are *not* dynamically positioned, for example is this an order header you are trying to position so that it fits in a window envelope with a table of order lines that is relatively static?

>L<

|||

Hi Lisa,

Here all the data should change position dynamically. So Your solution shoud work. But I didnt get it. How we can change the rdl on the fly?

Thanking you,

Leks

|||

You can write a whole RDL on the fly if you want to. Look for an example called something like "generate RDL dynamically" on http://gotreportviewer.com/ and there is another example there that will show you how to LoadReportDefinition for a local report from a stream. If the report is a serverreport, you could use the SOAP API to upload the adjusted report definition instead.

In your case, I don't think that it will be necessary to write the whole RDL from scratch (although you will still have to load or upload your revised version). You can have a "template" RDL that you adjust, for each run or each customer, or as needed.

There are two ways to do an RDL template revision, the way I would do it and the way most developers would prefer to do it <g>. I prefer XSLT; in this case I might have a parameter in the XSLT for each positionable item in the report, or pass the entire set of adjustments in the form of a lookup document. If you prefer to load up the RDL in the DOM and select the textboxes as nodes to adjust each of them, this is pretty easy too.

Do you need more help than this, or is this what you're looking for?

>L<

|||

Hi Lisa,

Yes. This was what I was looking for. Now I know that using the XSLT we can position the textbox or any control dynamically.

Thank you so much Lisa,

Leks

|||

Great -- if you get stuck, holler. I am very willing to go the extra mile for other folks who like XSLT <s>.

>L<

Dynamically changing position of Textbox

Hi,

In my report, I've to print the address of the customer in a form which is in a pre-defined format. So while printing, the line number and position should be specified by the user. Is there any ways in SSRS to change the position of a textbox/any control dynamically by inputing the x and y coordinates? If there is a way please let me know that.

Thanks in Advance,

Leks

What does the surrounding content in the layout look like? Do you have a "clear" region in which you could place a very large textbox, representing the all the page area in which the textbox could potentially be placed?

If so, you might be able to do this with padding. IOW, you would place this very large textbox in the layout and then you would pad the top and left to "push" the content of the text box into the customer's preferred position, at runtime.

This is possible because you can express the padding values as expressions. Think of the textbox's true top and left as an offset from 0,0, which you will subtract from the customer's input values (which will be parameters) to get the padded top and left at runtime.

HTH,

>L<

|||

Hi Lisa,

Thanks for your quick reply. But unfortunately my layout is not clear. It contains other data too that I need to position according to the input for them. For each item in the report we have to enter the position. I know this process is a bit tedious. but there is no other ways. They actualy need the report data such that it can be printed in many forms. Please reply as soon as possible.

Thank you dear,

Leks

|||

Hi Leks,

If you have to enter the position of each item in the report, then I think your best option is to edit the RDL on the fly, put your coordinates right in the report definition.

Are you comfortable with doing this? It may be quite straightward. Some things that would enter into it and might change what you have to do would include:

* -- What type of data region are you using (list/table) to contain the dynamic items?

* -- Are there additional items in the report that are *not* dynamically positioned, for example is this an order header you are trying to position so that it fits in a window envelope with a table of order lines that is relatively static?

>L<

|||

Hi Lisa,

Here all the data should change position dynamically. So Your solution shoud work. But I didnt get it. How we can change the rdl on the fly?

Thanking you,

Leks

|||

You can write a whole RDL on the fly if you want to. Look for an example called something like "generate RDL dynamically" on http://gotreportviewer.com/ and there is another example there that will show you how to LoadReportDefinition for a local report from a stream. If the report is a serverreport, you could use the SOAP API to upload the adjusted report definition instead.

In your case, I don't think that it will be necessary to write the whole RDL from scratch (although you will still have to load or upload your revised version). You can have a "template" RDL that you adjust, for each run or each customer, or as needed.

There are two ways to do an RDL template revision, the way I would do it and the way most developers would prefer to do it <g>. I prefer XSLT; in this case I might have a parameter in the XSLT for each positionable item in the report, or pass the entire set of adjustments in the form of a lookup document. If you prefer to load up the RDL in the DOM and select the textboxes as nodes to adjust each of them, this is pretty easy too.

Do you need more help than this, or is this what you're looking for?

>L<

|||

Hi Lisa,

Yes. This was what I was looking for. Now I know that using the XSLT we can position the textbox or any control dynamically.

Thank you so much Lisa,

Leks

|||

Great -- if you get stuck, holler. I am very willing to go the extra mile for other folks who like XSLT <s>.

>L<

Wednesday, March 7, 2012

Dynamic Width of textbox

Hi,
how can i set the width of a textbox dynamically ?
Ex: The text box has to expand in width to fit the availble data. It
shouldnt word wrap.
ex: hello how are you NOT hello how
are youSince you can not use an expression for textbox width, I do not think you
can do this...You would probably end up with bigger problems anyway, because
textboxes overlapping would be a problem unless you moved the others that
were affected by the size change anyway...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Ramani" <Ramani@.discussions.microsoft.com> wrote in message
news:E1CF20D3-CD14-4DB6-A380-3B5C694C26CB@.microsoft.com...
> Hi,
> how can i set the width of a textbox dynamically ?
> Ex: The text box has to expand in width to fit the availble data. It
> shouldnt word wrap.
> ex: hello how are you NOT hello how
> are you

Sunday, February 26, 2012

Dynamic Textbox size

I want to create a TextBox with dynamic width.
Probably reading from an expression.
Has anyone tried to set the width of the report objects with an expression.I posted a response here:
http://www.reportingservicesfaq.com/ow.asp?DynamicTextboxSize
Help build the Wiki!
--
Reporting Services Articles, Forums, Blogs and Wiki Community
www.ReportingServicesFAQ.com
> I want to create a TextBox with dynamic width.
> Probably reading from an expression.
> Has anyone tried to set the width of the report objects with an expression.
>
>|||There is a CanGrow property on the textbox - however, it will allow the
textbox to grow vertically but not horizontally.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"newbie" <newbie@.discussions.microsoft.com> wrote in message
news:0A8894B2-A1C3-4B7E-B1FF-555D2C1A5866@.microsoft.com...
> I want to create a TextBox with dynamic width.
> Probably reading from an expression.
> Has anyone tried to set the width of the report objects with an
expression.
>
>

Friday, February 24, 2012

Dynamic Textbox height?

Hi,

I often have a 'label' text box next to a 'data' textbox. If the data textbox expands how can I get the label to match it in height?. I tried to set the height of one to the height of the other but got errors.

Thanks,

Best way would be to use a table, the row the label and the textbox are in would be sized at the same size then.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Dear,

U can do it by using functioin.Your testbox and label size will be same.

U can try this

="hello" & space(len(Parameters!SaleOrderNo.Value)) & "."

In passed these parameter with in a lable(textbox).

Parameters!SaleOrderNo.Value in a textbox.

Hope this helps u.

from

sufian

|||

Thanks Jens,

But at present this needs to stay free form.

|||

Thanks Sufian,

But I'm not following what you are saying. I believe you are saying to create a report parameter and then use this code:

space(len(Parameters!SaleOrderNo.Value)) & "."

I did this (using my own values of course) but am not able to make it work. Please explain what I'm not understanding.

Thanks,

Fairfield

|||

Dear,

suppose u have a lable and a textbox.

In textbox u have a value(!Fieldname.value)

In the label function box write the code like this

="hello" & space(len(!fieldname.value)) & "."

So it will read the (!fieldname)length and add that length to ur lable with space function.I used a dot "." at last in the function because there should be something to hold the space.

U can customise the code according to ur need.

HTH

from

sufian.

|||

Thanks again, Sufian.

However for some reason this technique doesn't expand the textbox either horizontally or vertically. Even when I force it using Space(250) and the "." it still doesn't expand the textbox. Any ideas?

Thanks.

|||

Dear failfield,

I read ur question. In that u had written that when the size of the testbox is increased the lable size should be increaed automatically.

U had not written anything like that u need to increase the size of the textbox.

BTW there should be a object to hold another object detail.

for example

if u need to increase the size of the lable in refence to height u need to hold the height of the textbox in ur lable.

suppose u have a textbox1. and u have a text lets say "Hello world"

and a lable lable1 with text hello.

Now u need that lable should be of the same size as the text.(in refrence to height only)

then in the function box write the same code i had written.

="hello" & space(len("helloworld")) & "." .

U can also use a field in place ot "helloword".

All this code is written in lable function window.

Hope this helps u.

from

sufian