473,503 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding a Label and Textbox in DataReport

smartchap
236 New Member
I have a table having 3 fields viz. SNo, FName and LName. The table has 10 records having SNo from 1 to 10. In DataReport I have 3 labels and 3 textboxes. I want to display all records from 1 to 10 but not to show record No having SNo = 5, i.e. want to hide all label and textboxes in DataReport when SNo = 5. How to hide these on DataReport for a particular record? Please help me.

Always Believe in GOD!
Jan 30 '08 #1
9 2935
debasisdas
8,127 Recognized Expert Expert
That can be done by SQL query.
Jan 30 '08 #2
smartchap
236 New Member
Sorry I did not make requirement clear. I had already used WHERE SNo <>5 in my SQL statement. Actually I want to hide some labels and textboxes for record with SNo = 5 (not all).
Thanks.
Jan 30 '08 #3
debasisdas
8,127 Recognized Expert Expert
Sorry I did not make requirement clear. I had already used WHERE SNo <>5 in my SQL statement. Actually I want to hide some labels and textboxes for record with SNo = 5 (not all).
Thanks.
Are you using separate label for each record ?
Jan 30 '08 #4
Killer42
8,435 Recognized Expert Expert
Are you using separate label for each record ?
Isn't there an event which fires after the record is read (AfterRead or something) where you could turn the visibility on or off? (I haven't used a DataReport).
Jan 30 '08 #5
smartchap
236 New Member
Actually I am having 2 tables and appended them in one separate table. Both tables have different different fields and in new table I have created a new field 'SNo'. Suppose table1 has 10 records, they will be saved in new table from record No 1 to 10 having SNo= 1 to 10 respectively and if table2 has 5 records (with different fields than table1) then these records will be appended in new table from Record No 11 to 15 having SNo=11 to 15 respectively. New table has all the fields in table1 and table2 plus one additional field SNo. Now I want in DataReport that for SNo<=15 fields labels and textboxes associated with these fields to be displayed and labels and textboxes associated with table2 not to be displayed. Similarly for SNo>=11 AND <=15 labels and textboxes associated with table1 not to be displayed but associated with table2 only to be displayed. Please help me.
Thanks.
Feb 1 '08 #6
smartchap
236 New Member
There must be a messiah to help me.
Feb 5 '08 #7
debasisdas
8,127 Recognized Expert Expert
There must be a messiah to help me.
If there is no record ,is the report still showing you some data ?
Feb 5 '08 #8
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

In Such Cases, You have to Create a SQL Query like :
Say In NewTable, (SNO 1 to 10) , You are saving in Field1, Field2, Field3
and For Table2 You are Saving in Field4 , Field5 , Field6 (SNo 11 To 15)
and you need to display Field1 or Field4 (depending on SNo) ...

For that you have 2 approaches.. Change SQL Query Accordingly..
Some thing like this :

Select A.SNo, A.Field1 As FldX, A.Field2 As FldY, A.Field3 As FldZ From NewTable A Where SNO <=10
UNION ALL
Select B.SNo , B.Field4 As FldX, B.Field5 As FldY, B.Field6 As FldZ From NewTable B Where SNO > 10

Note : In above Query, you need to have Same Field Type for Field1 and Field4..

2 Method:

Select SNo, Trim(Field1 & Field4) As FldX, Trim(Field2 & Field5) As FldY,
Trim(Field3 & Field6) As FldZ From NewTable Order By SNo

In Above Query, If both the fields are different, you can use Explicit Conversions..
Say Field1 Is Text and Field4 is Numeric, then you can give this in access:

Select SNo, Trim(Field1 & Cstr(Field4)) As FldX, Trim(Field2 & Field5) As FldY,
Trim(Field3 & Field6) As FldZ From NewTable Order By SNo

Now Design the DataReport on FldX, FldY, FldZ.

These Kind of Reports are done a Lot More Easier in Crystal Reports (All Versions). Just Place Fields One above the other, and Suppress Blank Values For Numeric Fields..


Regards
Veena
Feb 5 '08 #9
smartchap
236 New Member
Sorry Veena for the delay in reply. Actually I am poor in SQL and specially in DataReport with SQL. I don't know how to play with records to be shown in DataReports. I don't have Crystal Reports and want output in DataReports. Please help me with an attachment which will guide me how to design Data Report on FldX, FldY, etc. It will be a great help for me. I hope u will take a little pain for me to attach an example as it is very much clear u understood my problem and have solution.
Thanks in advance.
Apr 26 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2121
by: Alexander | last post by:
I am building a little unique dialog editor and have derived some new classes like DButton, DLabel and DTextBox. The user adds these Controls to a panel which is part of a class Document which is...
4
17015
by: James | last post by:
Hello group: I'm trying to hide a panel control in javascript when a print button is clicked. On my web form, I have a button that fires a javascript function called doPrint(). No matter how I...
3
1599
by: MDB | last post by:
This may sound like a naive question, but that's only because I'm naive about most things ASP.NET, as my background is primarily Lotus Notes Development, and before that, DOS-based FoxPro. Is...
1
1894
by: Venki | last post by:
I have a textbox to enter an email address followed by a telephone textbox. The email has a regularexpressionvalidator and a requiredfieldvalidator. The ReqField works fine, but if I put in an...
9
3166
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens...
0
1582
by: CharlesA | last post by:
Hi folks, I'm using ASP.net 1.1 with C# I've got this kind of thing going <div class="row"> <label class="col1">Rm Name</label> <asp:textbox id="txtRM" runat="server" cssclass="col2"...
0
1653
by: Mark | last post by:
I want to create a user control inherited from a TextBox with an associated label (let's call it a LabelTextBox). The trick is that I want the control to inherit from TextBox and have all of its...
1
2632
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
4
1727
Fane
by: Fane | last post by:
I have a label in program showing that the textbox's text is copied to clipboard. At the start it is not visible, but after the button is clicked, it becomes visible. After this I would want it to...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.