|
Thank you very much~
Cappie
|
|
|
|
|
Dear friends
how can i export data from datagrid into html file or word file.Actualy i have some varibales in vb.net which i need to display in tabular format either in word or in html.
help me pls.............
uttam
share the knowledge
|
|
|
|
|
Open question and several possibilities.....
1) Reference the Office DLL, learn to use the object (methods) and use it. Create a Word file and insert in it your data
2) Output from your program a "simple format", like a pure CSV text file and then import it in to word.
3) Learn HTML tags (quite easy) and then output your data to a text file, rather easy using pre-built FW classes.
You can choose your favourite way.
briga
|
|
|
|
|
Hi all,
Can you please let me know how to create .exe file in vb6, there can be only single instance is running at a time?
For example if i double click on exe file, it start running. I minimize that exe and again double click on same exe file, it should display me message that program is already running.
Can anyone help?
Thanks.
Atul
-- modified at 1:33 Wednesday 23rd November, 2005
|
|
|
|
|
For me one of the best code to answer your question is the following but you need to rewrite it in VB6 (you'll learn something in the meantime):
http://www.codeproject.com/threads/singleinstance.asp
Otherwise you can look here a find it already done, how to create a mutex in VB6:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/Registering_File_Associations/VB6_Startup_Demonstration_zip_mMain_bas.asp
If you'll move to FW 1.x then it's much easier:
http://www.codeproject.com/vb/net/ActivateSingleAppInstance.asp
And with VS2005 and FW 2.x then even more beacuse you just need to tick a box!
|
|
|
|
|
Hi Briga,
Thanks a lot for your suggestion.
Atul
|
|
|
|
|
>And with VS2005 and FW 2.x then even more beacuse you just need to tick a box!
Where?
|
|
|
|
|
Go under the Project Properties, then Application tab.
Enable the Application Framework and one of the options is: Make Single Instance Application. Tick the box.
|
|
|
|
|
It has been staring me in the face for hours!!
It seems to work well. If I try to run the program again there is a short delay and then the first instance comes bak in foucus.
|
|
|
|
|
In vb6 this couldnt be any easier.
There is an app object which has a property called PrevInstance.
In the form load event of your startup form simply check it as follows:
If app.previnstance then
msgbox "I really Should google for simple stuff like this"
'To do it properly you should put code here to set focus to the
'existing instance
else
' code to either do something or leave blank to continue
end if
Jon
|
|
|
|
|
Hi Jon,
Thank you very much for your valuable suggestion.
Atul.
|
|
|
|
|
Yes, although I don't know why, but lot of programmes consider that object unreliable and that's the reason why some of them use a mutex and also a market has opened up (i.e. the activex oneonly, but there are more around).
|
|
|
|
|
Hello all
I want to create a sub that takes an integer as a parameter like so:
<br />
public sub foo(inNumber as integer)<br />
...<br />
end sub<br />
what I want is, at design time, to limit the range of inNumber.
for example, if the acceptable range is [2..5] then foo(1) would not compile but foo(3) would compile correctly
How would I go about doing this?
/jason
|
|
|
|
|
There isnt a way to do that. Use a select case statement inside your sub.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
You're trying to limit a runtime value at design time. This can only be done by the designer including code to validate the parameters at runtime.
AFAIK the standard tools and addon third party tools don't do this. You'll need to add the code to your functions manually and trap any errors.
...Steve
|
|
|
|
|
Hello,
I have a datagrid which is databound.Users enter the data into the webform which is saved into the database and this data is later retrieved and viewed in a Datagrid. As of now about 200 records have been created and they are all visible in the datagrid.
The next step is that on the datagrid page, there is a textbox to enter monthly exchange rate on the top of the page i.e. outside the datagrid, users will enter a value in this textbox and based on that value 3 columns in the datagrid need to be recalculated.
eg: enter EOMRate: ____________ (this is a textbox)
|
V This is the datagrid
____________________________________________________
regno buyamt sellamt bankname SpotRate Range
____________________________________________________
1 20000 30000 DBAL 0.65 Within Range
2
3
--
--
200
_________________________________________________________
Once the EOM rate is entered in the textbox then buyamt and sellamt will be recalculated in the datagrid for all 200 records.
Is it possible to achieve this?Any help, guidelines?
Thankyou very much for kindly sparing your time to read this post and help me solve it.
Aartee.
...HE is watching Us All!
|
|
|
|
|
I assume the datagrid is connected to a database. Once the Exchange rate is specified you can recalculate the the Buyamt ans sellamt and store in the database. Refreshing the Datagrid should pick up the latest values from the database.
If its not directly connected to the database, taking into acct the volume of records i don't see any better solution than going in for a temp datatable to store these buyamt and sellamt and binding it to the datagrid.
|
|
|
|
|
Hi Pratibha,
Thankyou for your Reply.Yes the datagrid is connected to the database. so as per your solution it also means I will need to introduce EOMRate as a new field in the datatable right? or maybe I don't need to and then I can calculate the buyamt and sellamt in the code behind the 'Calculate' button and call Refreshgrid() which will display the new values. So I do not really need to touch the datagrid(geeee that's great!)
well, it does sound quite straightforward...I will go ahead with this solution and see how it works.
Thanks a lot.
Aartee.
...HE is watching Us All!
|
|
|
|
|
i want to implement an ASP.net web apllication, when i change the dropdown list i want to textbox text change by itsself
i have a event on the dropdown box which is selectedindexchanged
code is
Select Case Me.DropDownList1.SelectedItem.Text.ToUpper
Case "TODAY"
Me.TextBox1.Text = Now.Date & " 06:00:00 AM"
Me.TextBox2.Text = Now.Date.AddDays(1) & " 05:59:59 AM"
Case "YESTERDAY"
Me.TextBox1.Text = Now.Date.AddDays(2) & " 05:59:59 AM"
Me.TextBox2.Text = Now.Date & " 06:00:00 AM"
End Select
but it is not working even this event is not fired
I am Entry level person
|
|
|
|
|
Your TextBox text MUST be changing, it must be getting set again somewhere. Given that the prerender is the only event that fires after this, is there any code in there to set the text ?
That's assuming that you've stepped through and these case statements are working ( i.e. one is being caught every time ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
make sure that the dropdown box has the AutoPostback Property set to true
/jason
-- modified at 1:33 Wednesday 23rd November, 2005
[edit]
do this by going to the design view of the Form, viewing the properties of the selected the DropDown box and setting the property there
[/edit]
|
|
|
|
|
I want to format a column so that all the cells in that column are percentage. Instead of doing this manually (highlight a column, right=click and select Format Cells..., and then change the Category to Percentage) I want to do it programmatically.
Here is an example of how I did some formatting”
'WORD WRAP
oWorkSheet.Cells.WrapText = True
'BOLD COLUMN HEADERS
oWorkSheet.Range("A1", "CC1").Font.Bold() = True
'COLUMN WIDTH
oWorkSheet.Columns(1).columnWidth() = 16.5
Thanks
|
|
|
|
|
How does this work for you?
Columns("A").NumberFormat = "0.00%"
I've always found that if I have to do some VBA, then I create and record a new macro, do what I want, then edit the macro to find out how Excel creates the code.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
The following routine, which successfully "splits" the desired search string into two parts, works to give me the proper results from my database in my datagrid:
= = = = =
Sub Page_Load(sender As Object, e As EventArgs)
Dim strName, strLastName, strFirstName, strIdNmbr as String
if not page.isPostBack() then
strSearch = SESSION("search") 'e.g., "Typ1 Typ2"
Dim strCriteria01, strCriteria02 As String
'Dim strString03 as String
Dim intPos As Integer
If Len(strSearch) > 0 Then
intPos = InStr(strSearch, " ")
If intPos > 0 Then
'Retrieve Criteria Info
strCriteria01 = Left(strSearch, intPos - 1)
'Retrieve win_option
strCriteria02 = Mid(strSearch, intPos + 1)
strString03 = "'" & strCriteria01 & "', '" & strCriteria02 & "'"
End If
End If
strLastName = UCase(TRIM(Request("LastName")))
strFirstName = UCase(TRIM(Request("FirstName")))
strIdNmbr = TRIM(Request("IdNmbr"))
strName = strLastName & "%" & strFirstName & "%" & strIdNmbr & "%"
strName = Replace(strName, "%%", "%")
strName = Replace(strName, "%%", "%")
strSql = "select /*+ FIRST_ROWS */ node_id, name " & _
" from doc_node d" & _
" where " & _
" name like '" & strName & "' and node_type = 'folder'" & _
" and exists (select 1 from doc_node c where c.grp_cd IN (" & strString03 & ") " & _
" and c.parent_node_id = d.node_id)"
end if
BindGrid (CreateDataSource())
End Sub
Sub Page_Unload(sender As Object, e As EventArgs)
'con = nothing
End Sub
= = = = =
But I also need to get the value of variable strString03 into the hyperlink text in the datagrid. In my datagrid, if I use, say:
[ItemTemplate]
[asp:HyperLink runat="server" NavigateUrl= '[%# "docs.aspx?NAME=" + etc., etc... %]' Text='See Details' ]
[/asp:HyperLink]
[/ItemTemplate]
I can click on each occurance of "See Details" and it links through perfectly to the various results I want to see. But now I need to get the value of strString03 (e.g., Typ1 or Typ2) to display as the Text for the HyperLink instead of just displaying the words 'See Details'. I need to do something like:
[ItemTemplate]
[asp:HyperLink runat="server" NavigateUrl= '[%# "docs.aspx?NAME=" + etc., etc... %]' Text=[%# "actual.value.of.strString03 %]' ]
[/asp:HyperLink]
[/ItemTemplate]
Or whatever needs to be done in order to display the link text I want.
Anyone??
Thanks much!!!
|
|
|
|
|
Hi, I have a problem validating with a XmlValidatingReader and a .xsd file
the validation breaks when the importDate attribute is parsed
< Info importDate = "1967-08-13" />
in the .xsd is defined as
< xs:attribute name="importDate" type="xs:date" use="required" />
and the error message is
"The 'importDate' attribute has an invalid value accordint to its data type. An error occurred at, (12, 44)"
Anyone has an idea why this happens, when I validate the same XML file in the XMLSpy it works fine, then i run my program and it breaks in that line, if I remove the line then everything works
Thanks in Advance
Isaac B
|
|
|
|