|
I am developing a project which gives excel files as output. I have tested this application on three different machines.
Out of three, on one machine files gets created with size in kbs. which is correct. other two machines generate same files with size in mbs.
for example
one file say abc.excel which contains only 3 records gets generated on machine with size 24kb, but the same file on other two machines gets genreated with size 2016kb.
What could be the possible reason?
Please help.
Thanks in advance.
|
|
|
|
|
Are they all running the same version of Excel?
|
|
|
|
|
Yes, all the machines have ms office 2007.
|
|
|
|
|
How are the files being generated?
Is the server machine doing the generation and then simply pushing the file to the client?
Is the server machine generating the files dependent on a bunch of options posted?
At the end of the day, if the server is doing the generation, and the request is identical from each client, then the output should be the same.
If on the other hand the client are then opening a file and converting for example from a CSV file, then saving, it is possible configuration options are slightly different on the odd machine which is resulting in larger files at the client end.
|
|
|
|
|
Hi All,
How to UPDATE entries of a column in SQL database ? e.g. I have a database named "clients", with a column "payment", with following entries:
payment
-------
100
200
300
Now I want these values to be updated next time when i calculate the new values that has to updated in the payment column.e.g. new values will be 500, 800, 900.
I have used following commands to update the entries:
cmd = New SqlCommand("Insert Into clients([Payment])Values(@calpay)", con)
cmd.Parameters.AddWithValue("@calpay", PaymentValue)
Where "PaymentValue" are the new values calculated.
Using the above code I found that the values are getting added below the old one, these new values doesnt replace the old values in column... I am getting finally :
payment
-------
100
200
300
500
800
900
Please help me with a piece of code. I think we have to use :
cmd = New SqlCommand(UPDATE clients SET... WHERE...
Kindy suggest me how to go ahead with this?
Thanks
R.S
|
|
|
|
|
Hi all,
I have published an application, when installed is in start-->programs-->Company Name(name of the company i'm employed)-->Application Name.
I want to publish the application in start-->programs-->Application Name.
How to obtain this?
I'm not sure on which field to change in the publish menu of the application properties.
Any help will be helpful.
Thanks in Advance.
|
|
|
|
|
Okay guys so I am allowing a user to enter in values into a text box and then click a button to have them display
in a listbox. My array for saving the input from the textbox into the list box is working perfectly.
But the problem I am having is that I know my code for displaying the array's indexices(elements) is not correct at all
I know there has to be a smarter way of doing this but I am lost, PLEASE HELP!!!!!! I COMMENT THE PART I NEED HELP WITH
Private Sub btnCal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCal.Click
'Variables
Dim StrArr() As String
Dim Str As String
Dim count As Integer
Dim lblStack() As Label
Dim i As Integer
Str = txtInput.Text 'store string into variable
StrArr = Str.Split(" ") 'use split to seperate words by space
For count = 0 To StrArr.Length - 1
'add user entered values to list box
lstDisplay.Items.Add(StrArr(count))
Next 'end for
count = 0 'set counter back to 0
For i = 0 To StrArr.Length - 1
lblDis1.Text = StrArr(0) 'gets the first value from the array
lblDis2.Text = StrArr(1) 'gets the second value from the array
lblDis3.Text = StrArr(2) ' and so on and so on...........
lblDis4.Text = StrArr(3)
lblDis5.Text = StrArr(4)
Next 'OKAY THIS IS WHERE I KNOW IF THE USER ENTER ONLY 3 VALUES IN THE TEXT BOX MY PROGRAM WOULD CRASH
'BECAUSE THE ARRAY ONLY HAS 3 ITEMS BEING STORED IN (0)(1)AND (2) SO WHAT IS A BETTER WAY OF
'DOING THIS LOOP AND SENDING OUT EACH ELEMENT TO THE LABELS.
End Sub
|
|
|
|
|
Your basic issue is that you have a dynamic array and a static number of labels. This means you have an upper limit to the number of items you can accept, which you do not enforce. Creating the labels dynamically might make more sense.
Your for loop is ridiculous. You don't use i anywhere in the loop, it's just a waste of time. You COULD built an array of label controls, so that you can step through the correct number of strings, so long as it's not more than the number of labels, and use a loop that way. You could even write some code that goes through the controls collection of the form and dynamically builds a list of how ever many labels you happen to put on there, if you like.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
PAguilar09 wrote: For i = 0 To StrArr.Length - 1 lblDis1.Text = StrArr(0) 'gets the first value from the array lblDis2.Text = StrArr(1) 'gets the second value from the array lblDis3.Text = StrArr(2) ' and so on and so on........... lblDis4.Text = StrArr(3) lblDis5.Text = StrArr(4) Next
PAguilar09 wrote: For count = 0 To StrArr.Length - 1 'add user entered values to list box lstDisplay.Items.Add(StrArr(count)) Next
1. Why are you displaying same thing twice in the UI? Even if you need to, why not have a single loop instead of two.
2. How did you decided the number of labels when at design time you don't know how many will be required?
3. Why do you bother to set count as 0 after the loop? I don't see you using it anymore. Declare that inside for loop itself.
4. Why do you need variable Str when you can directly split the textbox text?
5. In the second loop, you are not using "i" anywhere.
For adding text to the listbox, I would use following code (c#):
listBox.Items.AddRange(this.textBox1.Text.Split(new char[1] { ' ' }));
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Ok let me explain again what I am trying to figure out how to do.
I know my code that I have for a label array is incorrect. I am trying to find out how i can
write code for this:
for i = 0 to array.getupperbound(0)
'then for each element in the array i want to push it out into a label that will display
'that single value, then get the next element in the array push it out into another label
'to display and so on and son until it has reach the end of the array
next
|
|
|
|
|
You still have the problem that the number of items will not match the number of labels and will crash at some point because of that. This is why controls such as the listbox exist.
Why bother populating labels when you already have the data in a listbox?
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Its because it is a program for a programming course, I need to show a visual representation of stacks, thus why I thought i could just pop each element(indexice) from the array into a label, but i had heard of some type of label array that allows you to populate each individual label with the values from the array, without doing it the way i was passing the data to each label individualy.
|
|
|
|
|
Why not add a label at runtime?
Private Sub btnCal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCal.Click
Dim StrArr() As String
Dim Str As String
Dim i As Integer
Str = txtInput.Text
StrArr = Str.Split(" ")
For i = 0 To StrArr.Length - 1
'Add a label at runtime
Dim MyLabel As New Label
Me.Controls.Add(MyLabel)
With MyLabel
.Left = 100
.Top = 50 + i * 20
.Visible = True
End With
MyLabel.Text = StrArr(i) 'gets the first, second etc value from the array
Next
End Sub
Sigurd Johansen
|
|
|
|
|
Hey Sigurd Johansen, THANKS the code worked perfectly! I have one question what would i need to change to display the labels like this:
So user enters into a textbox this: 1 2 3 4 5 6 then he hits the calculate button
once it is clicked display the labels at runtime like this:
6
5
4
3
2
1
Thanks for the help
|
|
|
|
|
I'm glad I was abel to help you, but I can't be your coder. You can use the same code as last time but change the For - next to this: For i = StrArr.Length - 1 To 0 Step -1 and also change the Top code to this: .Top = 170 - i * 20
Sigurd Johansen
|
|
|
|
|
Thanks for all your help. I did try to figure it out on my own b4 asking again its just that I was leaving out STEP -1 so it wasn't working the correct way. Sorry
|
|
|
|
|
If it is for a programming course, then the answer will be almost certainly be in the course notes, just probably written is a slightly different way.
|
|
|
|
|
Hello Everybody
I am creating an outlook add-in in vb.net. I want to get the path of contact picture. I have successfully add contact picture in outlook programmatic ally but i want to check the path programmatic ally also, where picture is added(saved) in outlook and want to show this path on a label control.
I am using vb.net 2005 and outlook 2003.
Thanks and Regards
Dharmchand Dhingra
|
|
|
|
|
I have this program where I need to use multiple forms. Which hasn't been a problem. The program also needs to include a module in order to create a procedure to keep a running total of a number which is added in two different forms. It then needs to be displayed on the third form.
I am having problems making this number calculate on my display. Can anyone help?
Here is the module
'This is the Standard Module'
Option Strict On
Module Module1
Public Sub AddToOrder(ByVal intTotalSales As Integer, ByRef dblSubtotal As Double)
dblSubtotal = dblSubtotal + intTotalSales
End Sub
Public Function Taxes() As Double
Dim dbltaxRate As Double = 0.07
Dim dblSubtotal As Double
Return CDbl(dblSubtotal * dbltaxRate)
End Function
End Module
Here is the Display Form:
Option Strict On
Public Class frmDisplay
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
'Closes the Bill
Me.Close()
End Sub
Private Sub frmDisplay_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'When the form is loaded, the date is going to appear as well as the total amount due for all coffee ordered'
Dim todayDate As Date = Today
txtBoxDate.Text = todayDate.ToString
'declare'
Dim decSalesTax As Decimal
Dim decSubtotal As Decimal
Dim dblSubtotal As Double
Dim intTotalSales As Integer
'calculate'
decSalesTax = CDec(Taxes())
decSubtotal = AddToOrder(intTotalSales, dblSubtotal)
'display'
txtBoxSubtotal.Text = decSubtotal.ToString
txtBoxTax.Text = decSalesTax.ToString
txtBoxTotal.Text = txtBoxSubtotal.Text + txtBoxTax.Text
End Sub
End Class
|
|
|
|
|
bphoopstar wrote: Public Sub AddToOrder(ByVal intTotalSales As Integer, ByRef dblSubtotal As Double)
This seems like such a waste of time to me. Why not just place delegates between the forms to communicate between them. Passing two values, one by ref, so they can be added together makes no sense at all.
bphoopstar wrote: Dim intTotalSales As Integer
'calculate'
decSalesTax = CDec(Taxes())
decSubtotal = AddToOrder(intTotalSales, dblSubtotal)
intTotalSales is obviously 0 at this point. Therefore, I don't see how this can do anything useful.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hello ! can you tell how to read data from store procedure in Dataset that have read from DATABASE by wizard ? i have a dataset that have bound data from SQL server by wizard. so this Dataset have all tables and views n store procedure, but i can't read data from it. speceilly i don kno how to get data from store procedure in that dataset . so please tell how to do ...?
hortpitou
|
|
|
|
|
What have you tried ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i have a store procedure in sql server. and i created a dataset by wizard, so i can see in my dataset has Store procedure. but i don kno how to get data from that store procedure. so can u tell me how can i do ... ?
hortpitou
|
|
|
|
|
Pitou HORT wrote: and i created a dataset by wizard,
Perhaps if you wrote code, you'd have some idea of what you're doing. Why on earth do you need a wizard to create a dataset, if that wizard hasn't filled it from a data source ?
What have you tried ? Did you read any books ? Did you google for info and examples ? Where did this stored proc come from ? Surely you didn't write it ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
because of i have some reason have to use dataset by wizard. so can u show me or give me some guidline ? i have searched in google ready. but didn't find any idea.
my store procedure is get from sqlserver to dataset. please help me.....
hortpitou
|
|
|
|