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

Friday, March 30, 2012

regarding datetime in asp.net

hi ,

i had textbox which is used to enter datetime . in the database, the data type is date/time. now my requirement is when the textbox is empty. i want 2 store a default value. which value is suitable for datetime.

i had given as follows

if textbox12.text = "" then

textbox12.text = 5/5/2000 ---- it is storing this value.

end if

but if i want 2 update this date means it is not supporting . if i select current date using calender it was saved as 12/30/1899.

can anyone help me.

regards

m.arunachalam

You can try
textbox12.Text = DateTime.Today

Wednesday, March 28, 2012

Reg: Exporting to CSV Format

Hi,
Is there any facility to restrict the dataset not to display the textbox
more than once when exporting to CSV format,when textbox value displays group
value(text).
Many ThanksPlease ignore this one.
prasad
"VP" wrote:
> Hi,
> Is there any facility to restrict the dataset not to display the textbox
> more than once when exporting to CSV format,when textbox value displays group
> value(text).
> Many Thanks
>
>
>|||Hi,
I want to create a CSV or comma delimited file from four MSSQL databases
running on one server. Can anyone assist me?
"VP" wrote:
> Hi,
> Is there any facility to restrict the dataset not to display the textbox
> more than once when exporting to CSV format,when textbox value displays group
> value(text).
> Many Thanks
>
>
>

Wednesday, March 21, 2012

Referring to report items

Hi,
Is there any way to directly access a value contained in, for example, a
textbox?
If I were to create a textbox ('textbox1') with a default 'value' attribute
of "Hello World!", how would I make 'textbox2' get the value of 'textbox1'
and set its own 'value' to equal it?
I thought maybe it would be something like an expression in textbox2 along
the lines of: "=Controls!textbox1.Value"
Of course, I can see problems if controls aren't rendered etc, but I thought
I'd ask.
Thanks,
CraigTry =ReportItems!textbox1.Value
Regards,
Davy Ramirez
Winsight - Paris
http://www.winsight.fr
"CraigyBoop" <CraigyBoop@.discussions.microsoft.com> wrote in message
news:34FA58AE-092E-42F7-B371-CAC59F9E0568@.microsoft.com...
> Hi,
> Is there any way to directly access a value contained in, for example, a
> textbox?
> If I were to create a textbox ('textbox1') with a default 'value'
attribute
> of "Hello World!", how would I make 'textbox2' get the value of 'textbox1'
> and set its own 'value' to equal it?
> I thought maybe it would be something like an expression in textbox2 along
> the lines of: "=Controls!textbox1.Value"
> Of course, I can see problems if controls aren't rendered etc, but I
thought
> I'd ask.
> Thanks,
> Craig|||Please see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_expressions_v1_7ilv.asp
for more information about ReportItems and Globals in general.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Davy Ramirez" <davy.ramirez.removethis@.winsight.fr> wrote in message
news:%23gr%23UsssEHA.820@.TK2MSFTNGP12.phx.gbl...
> Try =ReportItems!textbox1.Value
> Regards,
> Davy Ramirez
> Winsight - Paris
> http://www.winsight.fr
> "CraigyBoop" <CraigyBoop@.discussions.microsoft.com> wrote in message
> news:34FA58AE-092E-42F7-B371-CAC59F9E0568@.microsoft.com...
>> Hi,
>> Is there any way to directly access a value contained in, for example, a
>> textbox?
>> If I were to create a textbox ('textbox1') with a default 'value'
> attribute
>> of "Hello World!", how would I make 'textbox2' get the value of
>> 'textbox1'
>> and set its own 'value' to equal it?
>> I thought maybe it would be something like an expression in textbox2
>> along
>> the lines of: "=Controls!textbox1.Value"
>> Of course, I can see problems if controls aren't rendered etc, but I
> thought
>> I'd ask.
>> Thanks,
>> Craig
>

Referencing/setting properties of an object

Is there any way to set the properties of one object depending on the
contents of a textbox or other object in a report? I'm trying to hide a
table column when the report is rendered if the footer value is zero.
Thanks in advance!You can use an expression on the visibility hidden properties of the header,
details & footer cell of the column you want to hide.
=IIF(ReportItems!colfooter1.Value is nothing,True,False)
where colfooter1 contains the value you are checking for zero.
hope that helps
Mark
"Boilin'Oil" wrote:
> Is there any way to set the properties of one object depending on the
> contents of a textbox or other object in a report? I'm trying to hide a
> table column when the report is rendered if the footer value is zero.
> Thanks in advance!

Tuesday, March 20, 2012

Referencing textbox values in expressions

I have a table displaying output from a query. I have cells "a" and "b"
that contain expressions performing calculations on fields in the query. I
would like to create an expression in cell "c" that performs a calculation
on the values in cells "a" and "b".
I can't seem to figure out how to reference the values of the textboxes in
the table. Even putting something as simple as "=a.text" or "=a.value"
returns an error that "a" is not declared ("a" being the name of the
textbox control).
Considering you need "Fields!" for referencing fields and "Parameters!" for
referencing parameters, I suspect that there is something comparable for
referencing the report controls, but I can't find any references to it in
the Books Online.
Does anyone know if this is possible, and if so how?
Thanks.One thing you might want to consider is adding a field to your dataset. When
you have the list of fields that you would drag and drop from when in the
layout tab, do a right mouse click, add. Pick calculated field. Add the
expressions for cell a and cell b. Now these are considered a field like
anything else. You can now create an expression in c that refers to field a
and field b. I find things more understandable and cleaner. Plus, let's say
you want to do a sum or something else on a grouping. No problem, it is just
a field like any other.
This is not real discoverable but in some situations it really makes things
simplier.
HTH,
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Kursplat" <newsgroup-spam@.microsoft.com> wrote in message
news:%23$H72k1%23FHA.2676@.TK2MSFTNGP10.phx.gbl...
>I have a table displaying output from a query. I have cells "a" and "b"
> that contain expressions performing calculations on fields in the query.
> I
> would like to create an expression in cell "c" that performs a calculation
> on the values in cells "a" and "b".
> I can't seem to figure out how to reference the values of the textboxes in
> the table. Even putting something as simple as "=a.text" or "=a.value"
> returns an error that "a" is not declared ("a" being the name of the
> textbox control).
> Considering you need "Fields!" for referencing fields and "Parameters!"
> for
> referencing parameters, I suspect that there is something comparable for
> referencing the report controls, but I can't find any references to it in
> the Books Online.
> Does anyone know if this is possible, and if so how?
> Thanks.|||I would do that if I could (I've tried), but the expression in the
source textboxes are calling functions in an Assembly, which I've
learned the hard way can't be called from the query (it crashes Visual
Studio every time I try).
So, I'm still looking for a way to have the expression of one textbox in
a table reference the value of another textbox in that table.
Thanks for the suggestion, though.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in
news:e$iAA91#FHA.952@.TK2MSFTNGP10.phx.gbl:
> One thing you might want to consider is adding a field to your
> dataset. When you have the list of fields that you would drag and drop
> from when in the layout tab, do a right mouse click, add. Pick
> calculated field. Add the expressions for cell a and cell b. Now these
> are considered a field like anything else. You can now create an
> expression in c that refers to field a and field b. I find things more
> understandable and cleaner. Plus, let's say you want to do a sum or
> something else on a grouping. No problem, it is just a field like any
> other.
> This is not real discoverable but in some situations it really makes
> things simplier.
> HTH,
>|||I found it in another post. You use "ReportItems!" to reference the
controls on the report.
Kursplat <newsgroup-spam@.microsoft.com> wrote in news:eHD9dGB$FHA.1028
@.TK2MSFTNGP11.phx.gbl:
> So, I'm still looking for a way to have the expression of one textbox in
> a table reference the value of another textbox in that table.|||Hi Kursplat,
For a workaround, in your query, you can set up the calculations there,
then refer to them in cells a and b in your table. From there, you can add
another cell c, and use the Fields! method to call the values in cells a and
b and manipulate those values as you wish in an expression.
Does that make sense?
Cheers,
Daniel.
"Kursplat" wrote:
> I would do that if I could (I've tried), but the expression in the
> source textboxes are calling functions in an Assembly, which I've
> learned the hard way can't be called from the query (it crashes Visual
> Studio every time I try).
> So, I'm still looking for a way to have the expression of one textbox in
> a table reference the value of another textbox in that table.
> Thanks for the suggestion, though.
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in
> news:e$iAA91#FHA.952@.TK2MSFTNGP10.phx.gbl:
> > One thing you might want to consider is adding a field to your
> > dataset. When you have the list of fields that you would drag and drop
> > from when in the layout tab, do a right mouse click, add. Pick
> > calculated field. Add the expressions for cell a and cell b. Now these
> > are considered a field like anything else. You can now create an
> > expression in c that refers to field a and field b. I find things more
> > understandable and cleaner. Plus, let's say you want to do a sum or
> > something else on a grouping. No problem, it is just a field like any
> > other.
> >
> > This is not real discoverable but in some situations it really makes
> > things simplier.
> >
> > HTH,
> >
> >
>

Referencing Textbox Values

Is there a way to reference a value from a textbox in a matrix? In other words I want to pull the value in the textbox that is the column header into a cell in the matrix under certain conditions.

You can try this:

=ReportItems!textbox3.value

or

You should be able to share a value in a hidden textbox using code.

Create a hidden textbox. Add the expression =Code.SetValue(mytextboxcontent) to the textbox.

Add the expression =Code.GetValue() to the matrix.

Create 2 functions

public myval as object


function setValue(value as object) as object

myval = value

return value


end function

function getValue() as object
return myval
end function

|||Thanks. You just helped me solve a bigger problem I've been working on for a week now.

Referencing textbox name in expression

I would like to reference a textbox name in an expression. When I write the
following expression, I get an error saying that the textbox name is
"private":
=ReportItems!txtPatientName.Name
Error: The value expression for the textbox â'textbox1â' contains an error:
[BC30390]
'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
ReadOnly Property Name() As String' is not accessible in this context because
it is 'Private'.I should probably mention that I am trying to ultimately reference the NAME
of the column/field returned from the stored procedure. Since that seems
impossible, I was hoping to set the name of the textbox to the name of the
column/field and then reference that. For example:
SELECT AdmitDate as [AdmitDate],
DischargeDate as [DischargeDate]
FROM Table_Name
In the report I would set the name of the textbox that displays the
AdmitDate field to "AdmitDate" so that I could reference the name of the
column/field being returned by the procedure with this statement:
=ReportItems!AdmitDate.Name
Is there any way to reference the name of the field/column being returned by
the procedure or the name of a textbox?
"mssarahlynn" wrote:
> I would like to reference a textbox name in an expression. When I write the
> following expression, I get an error saying that the textbox name is
> "private":
> =ReportItems!txtPatientName.Name
> Error: The value expression for the textbox â'textbox1â' contains an error:
> [BC30390]
> 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
> ReadOnly Property Name() As String' is not accessible in this context because
> it is 'Private'.
>
>

Referencing ReportItems in Subreport from Main Report

Is this at all possible in SQL 2000 reporting services?
I want to reference a textbox value from the sub report into the main
report.
Thanks
GeorgeOn Dec 6, 6:18 pm, "_george" <none@.nojne@.none> wrote:
> Is this at all possible in SQL 2000 reporting services?
> I want to reference a textbox value from the sub report into the main
> report.
> Thanks
> George
The best way to accommodate this is to create the same dataset that is
used in the subreport's textbox control (where applicable) in the main
report. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Referencing a value on one page of a report in a textbox

Hello,
I am creating a profit and loss statement in SQL Server reporting Services.
This single report creates a one page P&L for each loction in the company.
Some of the calculations are based on the Sales of each location (i.e.
percentages etc.). I'd like to reference the sales total for the each
location in one of the groupings of the report. The problem is, when I do
"Sum(Sales)" it doesn't sum the sales figures for the location, but only the
grouping I'm in. Is there a way to do this expression so it sums the Sales
figure for the whole location? If not, is there a way to reference a
particular textbox on the report?
Any help or direction would be greatly appreciated.
Thanks!
RickHey Rico,
Try Using:
RunningValue(Fields!Sales.Value, Sum,"LocationGroupName")
Michael C
"Rico" wrote:
> Hello,
> I am creating a profit and loss statement in SQL Server reporting Services.
> This single report creates a one page P&L for each loction in the company.
> Some of the calculations are based on the Sales of each location (i.e.
> percentages etc.). I'd like to reference the sales total for the each
> location in one of the groupings of the report. The problem is, when I do
> "Sum(Sales)" it doesn't sum the sales figures for the location, but only the
> grouping I'm in. Is there a way to do this expression so it sums the Sales
> figure for the whole location? If not, is there a way to reference a
> particular textbox on the report?
> Any help or direction would be greatly appreciated.
> Thanks!
> Rick
>
>|||Thanks!
"Michael C" <MichaelC@.discussions.microsoft.com> wrote in message
news:1F8BB7D0-3298-4A46-BB9D-389C26386523@.microsoft.com...
> Hey Rico,
> Try Using:
> RunningValue(Fields!Sales.Value, Sum,"LocationGroupName")
> Michael C
> "Rico" wrote:
>> Hello,
>> I am creating a profit and loss statement in SQL Server reporting
>> Services.
>> This single report creates a one page P&L for each loction in the
>> company.
>> Some of the calculations are based on the Sales of each location (i.e.
>> percentages etc.). I'd like to reference the sales total for the each
>> location in one of the groupings of the report. The problem is, when I
>> do
>> "Sum(Sales)" it doesn't sum the sales figures for the location, but only
>> the
>> grouping I'm in. Is there a way to do this expression so it sums the
>> Sales
>> figure for the whole location? If not, is there a way to reference a
>> particular textbox on the report?
>> Any help or direction would be greatly appreciated.
>> Thanks!
>> Rick
>>

Monday, March 12, 2012

Referencing a Control's Value Property

I'm trying to reference a image control value property. I want to show
the contents of the value property in a textbox control. I thought I
saw this before but cannot seem to find it again.
For example, I have an image control called image1. Which has a value
of: C:\images\xxxx.jpg
In a textbox I want to show "C:\images\xxxx.jpg"
I'm trying something like: textbox.value=image1.value
So when I preview the report I get an image, and a textbox that shows
the value used for the text box.
Any ideas?
Thanks,
rwiethornCurrently, the only Value property exposed to expressions is Textbox.Value
(in fact, the only report items visible to expressions at all are
textboxes).
But... You could achieve the desired result by making the value of the image
control an expression that refers to the contents of the textbox:
=ReportItems!Textbox1.Value
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"rwiethorn" <rwiethorn2002@.yahoo.com> wrote in message
news:553a0349.0408230522.2226ad4d@.posting.google.com...
> I'm trying to reference a image control value property. I want to show
> the contents of the value property in a textbox control. I thought I
> saw this before but cannot seem to find it again.
> For example, I have an image control called image1. Which has a value
> of: C:\images\xxxx.jpg
> In a textbox I want to show "C:\images\xxxx.jpg"
> I'm trying something like: textbox.value=image1.value
> So when I preview the report I get an image, and a textbox that shows
> the value used for the text box.
> Any ideas?
> Thanks,
> rwiethorn

Friday, March 9, 2012

Reference a textbox in a report SSRS 2000

I am working in SSRS 2000, and I have a report using a table. In the footer of the table I want to do a calcuation. I have a textbox in the table called "SumAmtCurrent", which is a sum value for a field in my dataset. I have another field in my dataset, "TotalRevCurrent", and I would like to take this second field, subtract the value in the textbox "SumAmtCurrent", and have the result in the footer of the table. I tried to reference the textbox using ReportItems!SumAmtCurrent.Value - but that gives me the following error

"...The value expression for the textbox ‘textbox7’ refers to the report item ‘SumAmtCurrent’. Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope..."

Is there a way I can get this total into my report?

Thanks in advance!

One way would be to use a Global variable and some custom code.

Something like this... (untested)

' Put this in the code tab

Protected MyValue as Object

function setValue(value as object) as object
MyValue = value

end function

function getValue() as object
return MyValue

end function

'Set this in a hidden textbox above where you want to get the value

=Code.setValue(value)

'Get this where you want to get the value

=MyField.Value / Code.getValue()

Hopefully this gives an idea of how to do something like this. Apologies if the code doesn't work out of the box but the concept should be ok.

cheers,

Andrew

Refer to value of textbox?

Hi all,
How would I go about referring to the value of a TextBox within a report? I
have a TextBox that I named "txtCount", in which I use an IIf expression to
selectively count records when in a group. In the footer of the container
group, I'd like to refer to that TextBox's value. I have no idea how to do
it. I tried Fields!txtCount.Value and that didn't work. I can't even refer
to a TextBox's value in the same detail line, so I must be missing
something. Or is it not possible to refer to another TextBox's value?
Thanks in advance for any help!
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]You can get textbox value by refer to "ReportItems!<textboxname>.Value
I'm not sure it will work in your case: Report item expressions can only
refer to other report items within the same grouping scope or a containing
grouping scope.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jake Marx" <msnews@.longhead.com> wrote in message
news:%23rwU3vHjEHA.2456@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> How would I go about referring to the value of a TextBox within a report?
> I
> have a TextBox that I named "txtCount", in which I use an IIf expression
> to
> selectively count records when in a group. In the footer of the container
> group, I'd like to refer to that TextBox's value. I have no idea how to
> do
> it. I tried Fields!txtCount.Value and that didn't work. I can't even
> refer
> to a TextBox's value in the same detail line, so I must be missing
> something. Or is it not possible to refer to another TextBox's value?
> Thanks in advance for any help!
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>|||Jake Marx wrote:
> Hi all,
> How would I go about referring to the value of a TextBox within a
> report? I have a TextBox that I named "txtCount", in which I use an
> IIf expression to selectively count records when in a group. In the
> footer of the container group, I'd like to refer to that TextBox's
> value. I have no idea how to do it. I tried Fields!txtCount.Value
> and that didn't work. I can't even refer to a TextBox's value in the
> same detail line, so I must be missing something. Or is it not
> possible to refer to another TextBox's value?
OK - I found it online: ReportItems!txtCount.Value.
I can refer to a TextBox in the same group using that syntax.
However, what I'm looking to do is as follows:
Group 1: Client
Group 2 (inside Group 1): Status
Details: Claims
There are 4 statuses possible. What I'm trying to do is get the counts of
each Status *in the footer of Group 1*. I can't think of a good way to do
this. I can get the total Claims count within Group 1, and I can get counts
of each Status within Group 2. But I can't figure out how to get a count of
each Status type from Group 1. I need to do a calculation on the Client
level based on those counts. I tried the following, which didn't work:
1) created 4 textboxes in the Group 2 footer to hold the counts for each
status
2) tried summing the values of the textboxes created in step 1 from the
Group 1 footer
Any other ideas? Am I approaching this the wrong way?
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]|||Lev Semenets [MSFT] wrote:
> You can get textbox value by refer to "ReportItems!<textboxname>.Value
> I'm not sure it will work in your case: Report item expressions can
> only refer to other report items within the same grouping scope or a
> containing grouping scope.
Thanks, Lev. I composed my other post before I saw your reply. Do you have
any ideas on my other post?
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]|||I think, in step 2 you may put expressions into those 4 textboxes
for 1st status:
=Sum(iif(Fields!Status.Value == "Status1", 1, 0))
for 2nd
=Sum(iif(Fields!Status.Value == "Status2", 1, 0))
etc.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jake Marx" <msnews@.longhead.com> wrote in message
news:OXcqPNIjEHA.1776@.TK2MSFTNGP15.phx.gbl...
> Jake Marx wrote:
>> Hi all,
>> How would I go about referring to the value of a TextBox within a
>> report? I have a TextBox that I named "txtCount", in which I use an
>> IIf expression to selectively count records when in a group. In the
>> footer of the container group, I'd like to refer to that TextBox's
>> value. I have no idea how to do it. I tried Fields!txtCount.Value
>> and that didn't work. I can't even refer to a TextBox's value in the
>> same detail line, so I must be missing something. Or is it not
>> possible to refer to another TextBox's value?
> OK - I found it online: ReportItems!txtCount.Value.
> I can refer to a TextBox in the same group using that syntax.
> However, what I'm looking to do is as follows:
> Group 1: Client
> Group 2 (inside Group 1): Status
> Details: Claims
> There are 4 statuses possible. What I'm trying to do is get the counts of
> each Status *in the footer of Group 1*. I can't think of a good way to do
> this. I can get the total Claims count within Group 1, and I can get
> counts
> of each Status within Group 2. But I can't figure out how to get a count
> of
> each Status type from Group 1. I need to do a calculation on the Client
> level based on those counts. I tried the following, which didn't work:
> 1) created 4 textboxes in the Group 2 footer to hold the counts for each
> status
> 2) tried summing the values of the textboxes created in step 1 from the
> Group 1 footer
> Any other ideas? Am I approaching this the wrong way?
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>|||Lev Semenets [MSFT] wrote:
> I think, in step 2 you may put expressions into those 4 textboxes
> for 1st status:
> =Sum(iif(Fields!Status.Value == "Status1", 1, 0))
> for 2nd
> =Sum(iif(Fields!Status.Value == "Status2", 1, 0))
> etc.
Great - thanks, Lev!
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]

Refer to a field in a header

Ii,
I have a text box in the body of my report containing:
=Code.setMonth(ReportItems!textbox13.Value) but i want this to appear in
another textbox in my header. I have you read you can't refer directly to a
field. This is what I have in my Header textbox:
=ReportItems("textbox14").Value. Nothing shows up when i run the report. How
can I get this to appear?
Thanks in advance,
RhondaTo update this, it is actually a custom function I am calling, if I place th
e
call in the header textbox nothing appears.
"Rhonda" wrote:

> Ii,
> I have a text box in the body of my report containing:
> =Code.setMonth(ReportItems!textbox13.Value) but i want this to appear in
> another textbox in my header. I have you read you can't refer directly to
a
> field. This is what I have in my Header textbox:
> =ReportItems("textbox14").Value. Nothing shows up when i run the report. H
ow
> can I get this to appear?
> Thanks in advance,
> Rhonda