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

Monday, March 26, 2012

Replace string inside value

Hi all, i have a question, i'm making a report in visual studio, where
i have a textbox which i fill with a value from a database and i wanna
know how you can change certain strings withing the filled value...
example:
This is the expression for the textbox:
=First(Fields!MyFieldName.Value, "Parametri")
=Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
So, the thing is, i've filled my textbox with a value from a database,
which is in my case, the value is a simple sentence...which has a word
'date' in it...so my question is how can i search that value
(sentence) and find the word "date" and replace it with something, for
example, today's date..?
That means if my textbox value is "bla bla bla date bla bla bla", i
wanna be able to change the word "date" to today's date or any other
word...so that in the report preview instead of "date" it says today's
date...
THANX!On Jun 28, 4:23 am, ApeX <mmo...@.gmail.com> wrote:
> Hi all, i have a question, i'm making a report in visual studio, where
> i have a textbox which i fill with a value from a database and i wanna
> know how you can change certain strings withing the filled value...
> example:
> This is the expression for the textbox:
> =First(Fields!MyFieldName.Value, "Parametri")
> =Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
> So, the thing is, i've filled my textbox with a value from a database,
> which is in my case, the value is a simple sentence...which has a word
> 'date' in it...so my question is how can i search that value
> (sentence) and find the word "date" and replace it with something, for
> example, today's date..?
> That means if my textbox value is "bla bla bla date bla bla bla", i
> wanna be able to change the word "date" to today's date or any other
> word...so that in the report preview instead of "date" it says today's
> date...
> THANX!
What you have is pretty close to correct. You should be able to use
something like this:
=Replace(CStr(Fields!MyFieldName.Value), "date", "current date") -or-
if you want the actual date time, you could use:
=Replace(CStr(Fields!MyFieldName.Value), "date", CStr(Now()))
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Tuesday, March 20, 2012

Repeating Textbox

I'm creating a form which will enter all the information from the database
onto the form when the user enters a paramter. The problem is that I can't
get it to display more than one form.
Let say that the user wants all information from a certain company on the
form such as employees. The user enters the company name as parameter, and
then click view. There are about 25 employees, and that should generate 25
forms.
So can anyone point me to how to go about setting the form so that it will
generate all 25 forms with each employee's information on that form?Read up on subforms.
Do the following.
1.Create a report that just shows data for a single employee. Use a query
parameter that accepts employee id. Test and make sure it works
2. Create a report that just lists the employee ids based on the company
query parameter
3. Embed the first report as a subreport, right click on the embedded
subreport and map the employee id parameter to employee id in the company
report.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"chang" <chang@.discussions.microsoft.com> wrote in message
news:9CAFDA8D-84F0-45FA-AADF-E3403992D1F8@.microsoft.com...
> I'm creating a form which will enter all the information from the database
> onto the form when the user enters a paramter. The problem is that I
can't
> get it to display more than one form.
> Let say that the user wants all information from a certain company on the
> form such as employees. The user enters the company name as parameter,
and
> then click view. There are about 25 employees, and that should generate
25
> forms.
> So can anyone point me to how to go about setting the form so that it will
> generate all 25 forms with each employee's information on that form?
>|||Thank you Bruce. This works and saves me a lot of time trying to figure it
out.
If I wanted to say do the same thing, but now not using parameter. Do I
just set it like what you went over without the paramter part? The reason is
I also need to create report that will allow the user to do a mass print of
all employees information within all the companies.
"Bruce L-C [MVP]" wrote:
> Read up on subforms.
> Do the following.
> 1.Create a report that just shows data for a single employee. Use a query
> parameter that accepts employee id. Test and make sure it works
> 2. Create a report that just lists the employee ids based on the company
> query parameter
> 3. Embed the first report as a subreport, right click on the embedded
> subreport and map the employee id parameter to employee id in the company
> report.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "chang" <chang@.discussions.microsoft.com> wrote in message
> news:9CAFDA8D-84F0-45FA-AADF-E3403992D1F8@.microsoft.com...
> > I'm creating a form which will enter all the information from the database
> > onto the form when the user enters a paramter. The problem is that I
> can't
> > get it to display more than one form.
> >
> > Let say that the user wants all information from a certain company on the
> > form such as employees. The user enters the company name as parameter,
> and
> > then click view. There are about 25 employees, and that should generate
> 25
> > forms.
> >
> > So can anyone point me to how to go about setting the form so that it will
> > generate all 25 forms with each employee's information on that form?
> >
>
>|||Instead of using = use like and have the parameter value be %. Try it with
the employee report.
Bruce Loehle-Conger
"chang" <chang@.discussions.microsoft.com> wrote in message
news:57B79B63-0809-4FCB-AA90-9483EDEA7461@.microsoft.com...
> Thank you Bruce. This works and saves me a lot of time trying to figure
> it
> out.
> If I wanted to say do the same thing, but now not using parameter. Do I
> just set it like what you went over without the paramter part? The reason
> is
> I also need to create report that will allow the user to do a mass print
> of
> all employees information within all the companies.
>
> "Bruce L-C [MVP]" wrote:
>> Read up on subforms.
>> Do the following.
>> 1.Create a report that just shows data for a single employee. Use a query
>> parameter that accepts employee id. Test and make sure it works
>> 2. Create a report that just lists the employee ids based on the company
>> query parameter
>> 3. Embed the first report as a subreport, right click on the embedded
>> subreport and map the employee id parameter to employee id in the company
>> report.
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "chang" <chang@.discussions.microsoft.com> wrote in message
>> news:9CAFDA8D-84F0-45FA-AADF-E3403992D1F8@.microsoft.com...
>> > I'm creating a form which will enter all the information from the
>> > database
>> > onto the form when the user enters a paramter. The problem is that I
>> can't
>> > get it to display more than one form.
>> >
>> > Let say that the user wants all information from a certain company on
>> > the
>> > form such as employees. The user enters the company name as parameter,
>> and
>> > then click view. There are about 25 employees, and that should
>> > generate
>> 25
>> > forms.
>> >
>> > So can anyone point me to how to go about setting the form so that it
>> > will
>> > generate all 25 forms with each employee's information on that form?
>> >
>>|||Bruce,
I did as what you mentioned about creating the first report with just one
information and then create that query to have a parameter.
I then create the second report with just the parameter(employee id).
I then embedded the first report into the second report and went to the
properties of the embedded report(the first one) and set the parameter.
This is the error that i get:
"An error occurred while executing the subreport 'subreport1': The
expressoin referenced a non-existing field in the fields collection."
I got nothing in the subreport field...not sure what I did wrong. Please
advise.
Thanks.
"Bruce L-C [MVP]" wrote:
> Instead of using = use like and have the parameter value be %. Try it with
> the employee report.
> Bruce Loehle-Conger
>
> "chang" <chang@.discussions.microsoft.com> wrote in message
> news:57B79B63-0809-4FCB-AA90-9483EDEA7461@.microsoft.com...
> > Thank you Bruce. This works and saves me a lot of time trying to figure
> > it
> > out.
> >
> > If I wanted to say do the same thing, but now not using parameter. Do I
> > just set it like what you went over without the paramter part? The reason
> > is
> > I also need to create report that will allow the user to do a mass print
> > of
> > all employees information within all the companies.
> >
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> Read up on subforms.
> >> Do the following.
> >> 1.Create a report that just shows data for a single employee. Use a query
> >> parameter that accepts employee id. Test and make sure it works
> >> 2. Create a report that just lists the employee ids based on the company
> >> query parameter
> >> 3. Embed the first report as a subreport, right click on the embedded
> >> subreport and map the employee id parameter to employee id in the company
> >> report.
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "chang" <chang@.discussions.microsoft.com> wrote in message
> >> news:9CAFDA8D-84F0-45FA-AADF-E3403992D1F8@.microsoft.com...
> >> > I'm creating a form which will enter all the information from the
> >> > database
> >> > onto the form when the user enters a paramter. The problem is that I
> >> can't
> >> > get it to display more than one form.
> >> >
> >> > Let say that the user wants all information from a certain company on
> >> > the
> >> > form such as employees. The user enters the company name as parameter,
> >> and
> >> > then click view. There are about 25 employees, and that should
> >> > generate
> >> 25
> >> > forms.
> >> >
> >> > So can anyone point me to how to go about setting the form so that it
> >> > will
> >> > generate all 25 forms with each employee's information on that form?
> >> >
> >>
> >>
> >>
>
>|||Bruce,
I did what you have, and I shouldn't say it didn't work. It does work, but
I can only get one contact per a parameter.
If possible, I want to get the parameter to dynamically display all company
and the user can select that company to have it display all the employees.
Thanks.
"chang" wrote:
> Bruce,
> I did as what you mentioned about creating the first report with just one
> information and then create that query to have a parameter.
> I then create the second report with just the parameter(employee id).
> I then embedded the first report into the second report and went to the
> properties of the embedded report(the first one) and set the parameter.
> This is the error that i get:
> "An error occurred while executing the subreport 'subreport1': The
> expressoin referenced a non-existing field in the fields collection."
> I got nothing in the subreport field...not sure what I did wrong. Please
> advise.
> Thanks.
> "Bruce L-C [MVP]" wrote:
> > Instead of using = use like and have the parameter value be %. Try it with
> > the employee report.
> >
> > Bruce Loehle-Conger
> >
> >
> > "chang" <chang@.discussions.microsoft.com> wrote in message
> > news:57B79B63-0809-4FCB-AA90-9483EDEA7461@.microsoft.com...
> > > Thank you Bruce. This works and saves me a lot of time trying to figure
> > > it
> > > out.
> > >
> > > If I wanted to say do the same thing, but now not using parameter. Do I
> > > just set it like what you went over without the paramter part? The reason
> > > is
> > > I also need to create report that will allow the user to do a mass print
> > > of
> > > all employees information within all the companies.
> > >
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > >> Read up on subforms.
> > >> Do the following.
> > >> 1.Create a report that just shows data for a single employee. Use a query
> > >> parameter that accepts employee id. Test and make sure it works
> > >> 2. Create a report that just lists the employee ids based on the company
> > >> query parameter
> > >> 3. Embed the first report as a subreport, right click on the embedded
> > >> subreport and map the employee id parameter to employee id in the company
> > >> report.
> > >>
> > >> --
> > >> Bruce Loehle-Conger
> > >> MVP SQL Server Reporting Services
> > >>
> > >> "chang" <chang@.discussions.microsoft.com> wrote in message
> > >> news:9CAFDA8D-84F0-45FA-AADF-E3403992D1F8@.microsoft.com...
> > >> > I'm creating a form which will enter all the information from the
> > >> > database
> > >> > onto the form when the user enters a paramter. The problem is that I
> > >> can't
> > >> > get it to display more than one form.
> > >> >
> > >> > Let say that the user wants all information from a certain company on
> > >> > the
> > >> > form such as employees. The user enters the company name as parameter,
> > >> and
> > >> > then click view. There are about 25 employees, and that should
> > >> > generate
> > >> 25
> > >> > forms.
> > >> >
> > >> > So can anyone point me to how to go about setting the form so that it
> > >> > will
> > >> > generate all 25 forms with each employee's information on that form?
> > >> >
> > >>
> > >>
> > >>
> >
> >
> >

Monday, March 12, 2012

Repeating footer data from a field

I have a data field called RunStatus that I place into a hidden textbox on my
report. I created a textbox in the footer and set the expression to
=ReportItems("RunStatusTextBox").Value. The footer does not repeat this
value on all pages. I am assuming it is because the hidden textbox is on the
first page only. How do I get my run status to show in the footer for all
pages?On Apr 29, 7:16 pm, Bruce Parker <bpar...@.nospam.nospam> wrote:
> I have a data field called RunStatus that I place into a hidden textbox on my
> report. I created a textbox in the footer and set the expression to
> =ReportItems("RunStatusTextBox").Value. The footer does not repeat this
> value on all pages. I am assuming it is because the hidden textbox is on the
> first page only. How do I get my run status to show in the footer for all
> pages?
You could try creating a hidden parameter and add it in the report
footer in a textbox control. Something like this should work:
=Parameters!RunStatus.Value
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi Bruce,
As for the TextBox in report footer, though you can assign it the value
from another reportItem in report body, however, sincce that reportItem in
body area won't repeat as the ones in report footer, you'll find that the
value got from the reportItem is identical to where it displays in the
report body. For your scenario, I think you can consider Enrique's
suggestion about define a report parameter and dirctly reference that
parameter in footer. Is there any particular code logic for caculating the
value for this repeated textbox in footer?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||in vs2005
right click table select property.
click repeat header or repeat footer in the property.
"Bruce Parker" <bparker@.nospam.nospam> дÈëÏûÏ¢ÐÂÎÅ:C5FA9C95-A781-41B4-8F47-51F531F96AD5@.microsoft.com...
>I have a data field called RunStatus that I place into a hidden textbox on
>my
> report. I created a textbox in the footer and set the expression to
> =ReportItems("RunStatusTextBox").Value. The footer does not repeat this
> value on all pages. I am assuming it is because the hidden textbox is on
> the
> first page only. How do I get my run status to show in the footer for all
> pages?|||That did the trick. Thanks guys.
"Steven Cheng[MSFT]" wrote:
> Hi Bruce,
> As for the TextBox in report footer, though you can assign it the value
> from another reportItem in report body, however, sincce that reportItem in
> body area won't repeat as the ones in report footer, you'll find that the
> value got from the reportItem is identical to where it displays in the
> report body. For your scenario, I think you can consider Enrique's
> suggestion about define a report parameter and dirctly reference that
> parameter in footer. Is there any particular code logic for caculating the
> value for this repeated textbox in footer?
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

Repeating a textbox on every page of the report

Hi,
I have something like this in the report body
>> TEXTBOX1 = Fields ! MyFieldName.Value <<
>> the table definition here <<
My problem is that I want to repeat TEXTBOX1 on all the pages if the table
has more than one page,
Right now only appear in the first page.
I tried to set TEXTBOX1.RepeatWith = TABLE1 but it has no effect.
In case it helps the value will not change of value in the report. I'm open
to use any other mean like a parameter, etcyou have to put this information in the table header himself
and setup this table header row to be repeated on each page.
"Ignacio Machin" <Ignacio Machin@.discussions.microsoft.com> wrote in message
news:DA36576E-D1C4-4112-B1C8-C7A0B20631EE@.microsoft.com...
> Hi,
> I have something like this in the report body
> >> TEXTBOX1 = Fields ! MyFieldName.Value <<
>> the table definition here <<
> My problem is that I want to repeat TEXTBOX1 on all the pages if the table
> has more than one page,
> Right now only appear in the first page.
> I tried to set TEXTBOX1.RepeatWith = TABLE1 but it has no effect.
> In case it helps the value will not change of value in the report. I'm
> open
> to use any other mean like a parameter, etc

Friday, March 9, 2012

Repeat Header? Anyone can solve it?

Problem 1:
Can anyone let me know how can I set a Fields!value inside the textbox in the header?
I have try to assign a value into the header textbox =ReportItems!textbox1.Value (where textbox1 is inside body of the repeat and hide it)
It works on Page 1 header, however, it shows nothing in Page 2 header.
------
Problem 2:
How can set the table header display on every page? It is not working although I install Reporting Service SP2 and also set the table header RepeatOnNewPage=true...
Can anyone let me know how to solve the problem please?I have the same problem as the first one above - anyone having a solution for this ?
BR
//Peter
|||Found a solution at last ...
http://support.microsoft.com/newsgroups/newsReader.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=0cddca0c-47b3-4e6f-8a96-3b698ecbca5a