I have a Datagrid that is generated as a report. When it's printed, the last line of evey page is split onto the next page(top half on the preceding page). Is there a way to control this? thanks
lupin68
Posts
-
Printing Datagrid report -
from DateTime to IntThanks to all. DateTime.Today.ToString("ddMMyyyy") did the trick!
-
from DateTime to IntDoes anyone know how to convert a datetime format(dd/mm/yyyy) to a string (i.e removing the "/") Thx
-
Unable to read NULL DateTime valueHere's my problem. I have a SQL db Table with a DateTime column. On my web app, I have a DataGrid that displays a list of info from that table (Order, Customer, Date of Delivery, etc..) When I read the DB, if the Date of Delivery doesn't exist I display nothing in the Cell. Alternately, When the order is delivered, the Date is displayed in that cell. The problem is this one: When there is no delivery date in the DB, the default on the DB is "01/01/1900 12:00AM". Now in my app, if I get the 01/01/1900 string for the Date, I don't display the value in the Cell. This was working fine until I installed the app and DB at the Customer. After running the app, the value for undelivered orders was displayed in the cell as 1/1/1900. So I changed my code again to check for the 01/01/1900 AND 1/1/1900 string and not display the value. This worked fine but I am not happy the way I check for the value of the date. After posting my problem in tan SQL forum, someone suggested to put the default value of that column to NULL, which is the logical thing to do. The only problem is that when I do that, I get an casting ERROR of my DateTime value (which is normal because NULL is not a Date value:zzz:) I'm reading from the DB. Here's my code to get the list of orders:sigh:: public static ArrayList GetAllOrders() { SqlDataReader reader = null; ArrayList orders = null; try { reader = SqlHelper.ExecuteReader(Resource.ConnectionString, CommandType.StoredProcedure, SP_GET_ORDERS, null); if (reader.HasRows) { orders = new ArrayList(); while (reader.Read()) { Order order = new Order(); order.WayBill = reader["WayBill"] as string; order.OrderDate = (DateTime)reader["OrderDate"]; order.Shipper.name = reader["Shipper"] as string; order.Items = (int)reader["Items"]; order.Weight = (int)reader["Weight"]; orders.Add(order); order = null; } } return orders; } This code reads a Stored Procedure where my order object has a OrderDate property casted to DateTime. Can anyone offer a suggestion/workaround for this problem.. Thanks a lot Pat
-
Question about hiding duplicatesIn Your insert command change INSERT INTO MODEL(ModelName,ModelID) to INSERT INTO MODEL(ModelName,MakeID) as you can't insert a primary key value. When you update, you should update one table only (usually the primary table that holds all the info). If you have made the relationships between the tables correctly it will work. I don't know what you want to modify exactly, it seems you're modifying all the tables, even Make. Send me a screen capture of your user intereface flyboylb@yahoo.fr so I understand better what this app does. It seems that it can all be simplified easily.;)
-
display different item in the cell under same columnThis looks like a Cool app Dr X. I'm just wondering about the DataGrid functionality in here. Is Column 1 static or is it something you're reading from a table? How many tables are involved? Just for personal info
-
Question about hiding duplicatesPlease post your query. I guess you're using access: Open the quey, on the menu bar select View / SQL view, Copy and Paste it here. It's all based on how you're updating the tables.
-
display different item in the cell under same columnWhat are you trying to achieve? Datagrid is usually used as a list to display and edit data from a DB. Based on what your saying, you're probably better of building a Table dynamically and insert whatever dontrols you want wherever you want. Then again it all depends on what you want to do. P.
-
Question about hiding duplicatesWhat I don't understand is How and Why you can the same model number more than once? Is this data that you are displaying only or is it data that was entered by users? Anyways, a good DB design would be to decompose your DB as much as possible. This is very important because it will allow you to easily modify everything in the future (expand, etc.). Again, presuming that you are displaying a catalog data (not data entered by use) here's an example (I will take only Make and Model for this example): You should have 2 tables tMake and tModel tMake should have 2 columns: MakeID, MakeName Make ID will be the primary key Make will be the name of the Make (Buick, etc.) tModel should have 3 columns: ModelID, ModelName and MakeID ModelID is the Primary Key ModelName is the Name of the Model (impala, suburban) MakeID id the Primary key of the tMake table (you should make a relation between this column and the MakeID column of your tMake table) Hope this helps, tell me what you think
-
Question about hiding duplicatesYour problem is not much of an ASP.NET problem but probably more of a DataBase design issue. Please explain a bit more what the application is supposed to do: 1) People buy cars? 2) How many tables in you DB do you have? Basically Models and Makes should be unique and should not be repeated in your DB. Explain to me also in which case you would have 2 entries for a model "593b" In general (and I don't know what you want to do exactly, but)the Model of a car should be referred to the Car as a ModelID..
-
Regular ExpressionGood site for consulting RegExp. and building your own http://regexlib.com
-
storing pages in an arrayI am not vey sure I entirely understand, but you are trying to retreive all the info of a particular Customer/Category etc. (from a DB I presume?) How do you display the info in the 3 pages (Customer, category, etc.)? You use a DataGrid?
-
Regular ExpressionVery easy, try this ^([a-zA-Z0-9@*#]{4,60})$ If you don't want the wild characters (@*#) you can remove them. Let me know Patrick
-
DataGrid binding and Viewstate problemNeat! thx PayBack works well.;)
-
DataGrid binding and Viewstate problemThanks guys, PayBack, this sounds great but I am not quite sure I understand how to do it. By the way, I don't use a DataTable, nor a DataSet. My search (let's say OrderNo.) goes like this { Order order = new Order(); ArrayList ordernumber = order.GetOrders(txtOrderno.Text, etc...) DataGrid.DataSource = ordernumber; DataGrid.DataBind(); } For another search (let's say the Customer ID), the ArrayList would be populated using a different method. The DB query (Storedprocedure) is called in another CS called by the GetOrders method. I am not sure how I could apply the ViewState("SearchParameter") = "_msg_date" in this context. Thanks again
-
DataGrid binding and Viewstate problemHi folks, here's the problem I have been stuck on: After I modify a row in my Datagrid, I want to reload just the row that was modified. I still want to issue a DataBind but I dont want to get the entire list that is displayed in the Datagrid. Just Update the row that was modified. The reason for that is that the datagrid can display a different list based on different searches that the user submits. So when the Modify button is pressed (the modify button is not an ItemCommand), I cannot do a databind based on what his initial search was, because I don't know what parameters to pass(to the query). Someone told me I could use the ViewState to store my DG and the issue a rebind. Is this possible? How would it work? Thanks for ANY help. :(( Patrick