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

Wednesday, March 28, 2012

How to make textbox Invisible when viewed on screen but visible when printed?

I have a couple reports that have parameters on them. Problem is when the report is printed, the parameters are not displayed.

To solve this, I have added the selected values to the header section of the report in a text box. I now want to find away to hide these values when the report is being viewed on screen but visible when printed. Any suggestions are welcome. Thanks

Does anybody have any suggestions on this or a workaround. I want the user to be able to know the parameters they selected when they print the report.

Thanks

|||

Hello,

You could have another parameter called "Show Parameters" (defaulted to False), then set the visibility of your textbox based on this value. Of course, your users would have to check that box to show them before they printed/exported.

Hope this helps.

Jarret

|||Thanks, interesting and simple work around. I have implemented it. Let's see if the clients like it.

How to make some textboxes repeat with a table across pages

In the Body portion of a report I have a List. Within the List I have a
textbox. Under the textbox I have a table with various columns. It's
possible that the table spans more than one page, which is OK - it just
depends on how much data I have. What I'm having trouble doing is the
following:
When the table spans multiple pages, I want the textbox to print as well.
The textbox is like header info for the table. I have a client with
invoices. The invoice data is shown in the table. The client name in the
textbox.
I've tried the RepeatWith property on the textbox and set the value to the
name of the table, however, it still doesn't repeat. What am I missing'
ThxSo Adrian,
Did you ever get an answer or figure this issue out?
I could certainly use a solution.
Thx,
Russell
"Adrian Maull (MCP)" <no_spam@.no_email.org> wrote in message
news:eKAdWqZxEHA.3896@.TK2MSFTNGP10.phx.gbl...
> In the Body portion of a report I have a List. Within the List I have a
> textbox. Under the textbox I have a table with various columns. It's
> possible that the table spans more than one page, which is OK - it just
> depends on how much data I have. What I'm having trouble doing is the
> following:
> When the table spans multiple pages, I want the textbox to print as well.
> The textbox is like header info for the table. I have a client with
> invoices. The invoice data is shown in the table. The client name in the
> textbox.
> I've tried the RepeatWith property on the textbox and set the value to the
> name of the table, however, it still doesn't repeat. What am I missing'
> Thx
>|||No answer yet. I'm currently looking for other Report Services newsgroups.
This one doesn't seem to be monitored very well.
"Russell Hardie" <russell_hardie@.cranevalve.com> wrote in message
news:%23ex51%23pxEHA.1308@.TK2MSFTNGP09.phx.gbl...
> So Adrian,
> Did you ever get an answer or figure this issue out?
> I could certainly use a solution.
> Thx,
> Russell
> "Adrian Maull (MCP)" <no_spam@.no_email.org> wrote in message
> news:eKAdWqZxEHA.3896@.TK2MSFTNGP10.phx.gbl...
> > In the Body portion of a report I have a List. Within the List I have a
> > textbox. Under the textbox I have a table with various columns. It's
> > possible that the table spans more than one page, which is OK - it just
> > depends on how much data I have. What I'm having trouble doing is the
> > following:
> >
> > When the table spans multiple pages, I want the textbox to print as
well.
> > The textbox is like header info for the table. I have a client with
> > invoices. The invoice data is shown in the table. The client name in
the
> > textbox.
> >
> > I've tried the RepeatWith property on the textbox and set the value to
the
> > name of the table, however, it still doesn't repeat. What am I
missing'
> >
> > Thx
> >
> >
>|||I understand. My valid email address is in my profile, so if you wouldn't
mind contacting me via email to discuss this further, please do.
Thx,
Russell
"Adrian Maull (MCP)" <no_spam@.no_email.org> wrote in message
news:exFpbU2xEHA.1400@.TK2MSFTNGP11.phx.gbl...
> No answer yet. I'm currently looking for other Report Services
> newsgroups.
> This one doesn't seem to be monitored very well.
> "Russell Hardie" <russell_hardie@.cranevalve.com> wrote in message
> news:%23ex51%23pxEHA.1308@.TK2MSFTNGP09.phx.gbl...
>> So Adrian,
>> Did you ever get an answer or figure this issue out?
>> I could certainly use a solution.
>> Thx,
>> Russell
>> "Adrian Maull (MCP)" <no_spam@.no_email.org> wrote in message
>> news:eKAdWqZxEHA.3896@.TK2MSFTNGP10.phx.gbl...
>> > In the Body portion of a report I have a List. Within the List I have
>> > a
>> > textbox. Under the textbox I have a table with various columns. It's
>> > possible that the table spans more than one page, which is OK - it just
>> > depends on how much data I have. What I'm having trouble doing is the
>> > following:
>> >
>> > When the table spans multiple pages, I want the textbox to print as
> well.
>> > The textbox is like header info for the table. I have a client with
>> > invoices. The invoice data is shown in the table. The client name in
> the
>> > textbox.
>> >
>> > I've tried the RepeatWith property on the textbox and set the value to
> the
>> > name of the table, however, it still doesn't repeat. What am I
> missing'
>> >
>> > Thx
>> >
>> >
>>
>

Friday, March 23, 2012

how to make a textbox invisible

hi
how can i make a textbox invisible ?
here is the scenario.
i have a textbox to remind user to select some parameters to view the graph.
once the user selects the paramteters - the graph shows up.
once the graph shows up -the textbox should disappear.
how can i do thatright click the text box, select Properties
click Advanced >>
in the Advanced Textbox Properties
click the Visibility tab
in the Initial visibility radio button group check the Visible radio button
and below check the Visibility can be toggled by another report item
in the Report item drop down list pick your chart
i haven't tried this, it's off the top of my head, but i hope it's a good
first step,
regards,
kowlasky
"RP" wrote:
> hi
> how can i make a textbox invisible ?
> here is the scenario.
> i have a textbox to remind user to select some parameters to view the graph.
> once the user selects the paramteters - the graph shows up.
> once the graph shows up -the textbox should disappear.
> how can i do that|||But we can only see textboxes in the dropdown of "visibility can be toggled
by another report item"
:-( any other suggestions ''''
Thanks
"kowalsky" wrote:
> right click the text box, select Properties
> click Advanced >>
> in the Advanced Textbox Properties
> click the Visibility tab
> in the Initial visibility radio button group check the Visible radio button
> and below check the Visibility can be toggled by another report item
> in the Report item drop down list pick your chart
> i haven't tried this, it's off the top of my head, but i hope it's a good
> first step,
> regards,
> kowlasky
>
> "RP" wrote:
> > hi
> > how can i make a textbox invisible ?
> > here is the scenario.
> > i have a textbox to remind user to select some parameters to view the graph.
> > once the user selects the paramteters - the graph shows up.
> > once the graph shows up -the textbox should disappear.
> > how can i do thatsql

Wednesday, March 7, 2012

how to leave the focus in a control when click in any part of the form.

Hi there,

I have a form with textbox, combos, ect... I'd like to know how I can make to leave the focus of one of this control when i click in any part of the form that is not a control, and so it's not focusable.

cheers.

Is this SQL Server Reporting Services related? You may want to try one of the .NET forums.

Sunday, February 19, 2012

How to know if a record exists

Hello,

I have a TextBox and an Insert Button, it works like this:

protected void Button1_Click(object sender, EventArgs e)
{
String strConn=SqlDataSource1.ConnectionString;
SqlCommand cmd =new SqlCommand("INSERT INTO My_Table_1 (Column_1) VALUES ("+TextBox1.Text+")",new SqlConnection(strConn));

cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
}


But,what code i must write for checking, if the value i am trying to insert already exists ??

I mean something like this:

if (TextBox1.Text does not Exists on any Record in My_Table_1) then
Insert it
else
Show Message : "Already exists a record with this value"

Thank you SO MUCH, guys,

Carlos.you can execute "select count(*) from My_Table_1 whereColumn_1='"+TextBox1.Text+"'" before insert and get value of the firstcolumn, then use if to determine whether it is bigger than 0|||

you could write a stored procedure and pass the insert parameters to it. In the stored proc you could do a check as follows:

IF NOT EXISTS(SELECT * FROM <table> WHERE <Condition>)

BEGIN

INSERT INTO <table> (<columns>) VALUES (<Values>)

END

If you want to return an appropriate message back to the front end you could include a return value as an OUTPUT parameter and return a code appropriately.

|||Hello Tony and Ndinakar:

thanks for the replies ;)

I will try first Tony's method...

BUT, how can i get the value of the first column ?

Please, can you write some code? i am REALLY new on this, and i can't find the answer :(

Thank you so much,

Carlos.|||code sample for you:)

//open connection
SqlConnection m_conn=new SqlConnection(ConnectionString);
m_conn.Open();
//run sql
sqlstring="select count(*) from My_Table_1 whereColumn_1='"+TextBox1.Text+"'" ";
SqlCommand sqlcmd=new SqlCommand(sqlstring,m_Conn);
SqlDataReader sdr=sqlcmd.ExecuteReader();
sdr.Read();
int rowcount=(int)sdr[0]; //here, you get what you need!
sdr.Close();
//determine whether record exist
if(rowcount==0)
{
//insert a new record
}
//close you connection
m_conn.Close();|||With all due respect... The second solution will give you better performance. It is essentiall the same as the first, except the exists contraint tells the query to stop executing after it finds a single match, whereas the count(*) method continues to aggregate the entire selection.|||Yes, you will be making 2 trips to insert a record which is unnecessary.|||Thank you guys for all your replies.

Tony, your code works 100% for what i am looking for, thank you ;)

In a few days i will study stored procedures, and i will try the second solution, and i will post my results here.

Thanks again,

Carlos.

How to know how many databasefields or formulas in one textbox...?

Dear Kabu,
Can you show me how to know how many databasefields or formulas in one textbox when you read the report from VB via CrystalDesigner?.. and can you reply me as soon as possible please ?
ThanksDo you want to know how many formulae are used in the Crystal Report?|||Hi , Madhi
When you design, you can drag some fields or some formulas into just only 1 textbox(a empty textbox), OK? My problem is that I want to know how many fields or formulas name in that textbox when you open it from CrystalDesigner , not at design time.
Thanks.|||I dont think this is possible. Why do you want this?