|
What do you mean by "scan"???
The basic framework is a recursive function (one that calls itself) with a path to "scan". You'll get the list of files in that path (directory, folder, what have you) and do whatever you need to on those files. You'll then get the list of subfolders in that path, build a new path with each of those subfolder names, and the function will call itself with each new path. A little pseudo-code:
Private Sub ScanFolder(ByVal path As String)
' Get list of files in "path" and process them.
' Get list of folders in "path"
For Each subFolderName In SubFolders
newPath = path + "\" + subFolderName
ScanFolder subFolderName
Next
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks i got the solution
Thanks
|
|
|
|
|
Hi,
I'am looking for a code to refresh crystal reports at runtime.One code I used is :
crviewer1.refresh
where crviewer1 is the name of the crystal report object in VB6.But I'am getting the following error :
" Method refresh of the object crviewer1 is invalid. "
Can anyone help me out.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
-- modified at 2:14 Monday 27th March, 2006
|
|
|
|
|
Its been a very long time since I've used VB6 and/or CR, but IIRC, the ReportViewer object doesn't have a Refresh method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, Dave
Thanx for ur response.
Is there any way to put new values in the report at runtime.
I am facing a small problem.
What I want to do is that if the value in a combobox is changed then the report should show data related to that changed value without exiting the appl.
When I generate the reports, by selecting an item from the list of a combobox, for the very first time, it displays the expected results.But when I change the selection from the list of the combobox, the CRViewer shows me the previous results.When I click the REFRESH button on the toolbar of the CRViewer then only the new values related to that selected list item are displayed.I want that, without clicking the REFRESH button the report should display the expected results.
Is there an alternative for this problem ?
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
I haven't used CR in about 8 years now, but looking through the documentation on MSDN, it looks like you can accomplish what you want by calling the RefreshReport method on your CrystalReportViewer object. Depending on how your report is written, you might have to change a parameter in the Viewers ParameterFieldInfo collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanx for ur response.
I tried the RefreshReport method but unfortunately it didn't work.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
Hi Dave,
Thanx for ur response.
I tried RefreshReport method, but unfortunately it didn't work.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
Hi,
I have a table with ID, col_name1, col_name2 and so on.
i am building a dataTable with ID
another datatable with all the columns that contains that id
now i am passing ID as a parameter in the second datalist and building a dataview. which gives me a block of data with just one specific ID. please refer to my code below:
-----------------------------
objConn = New SqlConnection(dbPath)
Try
'select the table with only distinct ID based
cmd = New SqlCommand("select distinct measure_id from measuredata m, textdata t where t.ScoreCardId = m.ScoreCardId", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")
da.Fill(dtId)
'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select * from measureData", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")
da1.Fill(dt)
Dim myView As New DataView(dt)
Dim datarow As DataRow
Dim listitem As System.Web.UI.WebControls.ListItem
For Each datarow In dtId.Rows
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
'######## checking if the dataview works #########
DataGrid1.DataSource = myView
DataGrid1.DataBind()
Next datarow
Catch ex As Exception
Response.Write("OOPs what went wrong:" + ex.ToString)
Finally
End Try
-----------------------------
now Datagrid1 is picking up only the block of record with last ID as it can only hold i set of data.
how can i programatically populate a chart inside that loop so that i can build a chart if there is data related to specific ID.
my aim is to generate a separate webchart for each ID in run time. do i need to declare those webchart control before i actually bind the data to it.
hope its not complex. I did post this question lots of time but i am not getting any response. is it too hard? I am happy to buy a third party software if could automate what i want to achieve.
many thanks again for all your help.
|
|
|
|
|
foremorecoast1 wrote: is this achievable?
Yep.
foremorecoast1 wrote: hope its not complex.
It's about a medium level of difficulty.
foremorecoast1 wrote: I did post this question lots of time but i am not getting any response.
Your not getting a response because you weren't listening the first 8 times you asked the same question.
I'll say it again. Get a table containing the UNIQUE ID's in your dataset. Then get a table containing all the records using those ID's. Now, how about a little pseudo-code:
For Each ID in the table
Create a new DataView object on that table, filtering by that ID number
Create a new webchart control and place it where you need it in the web page
Bind the new DataView to the WebChart control
Next
If you want more information on dynamically creating controls in ASP.NET, a little Google goes a long way. "dynamically create controls in ASP.NET"[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
I did already post my code and explained my problem. I did understand what you said and i did implement it which i posted earlier. my problem is.
------
For Each datarow In dtId.Rows
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
'######## checking if the dataview works #########
MycosChartWeb1.DataSource = myView
MycosChartWeb1.DataBind()
'#checking if we are getting data with test datagrid
'or
'DataGrid1.DataSource = myView
'DataGrid1.DataBind()
Next datarow
------
there are 10 IDs so the loop runs 10 time but myView can only hold one set of data so it only returns the last set of record and binds it to webchart or datagrid but i want to have 10 webcharts created if there is 10IDs hope you understand what i am trying to acheive. or if you think there is any webcharting tool which can fix my problem happy to buy that.
thanks
Bikash
|
|
|
|
|
I refer you back to the pseudo-code in this[^] post, and the links after it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was tring to get information from the text file but not sucess i wonder maybe is it didnt read the next line...
------
Dim strmw As StreamReader
Dim myInputString As String
Dim filePath As String = Path.GetDirectoryName(Application.ExecutablePath) & "\save\testing.txt"
Dim game As New Form1
Dim x As Integer
Dim respond As MsgBoxResult
Dim name, num As String
Dim position, counter, whoturn As Integer
respond = MsgBox("Load Pervious game ???", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
If respond = MsgBoxResult.Yes Then
strmw = File.OpenText(filePath)
'loop all the player status
num = strmw.ReadLine()
If num = "1" Then
game.Pname1.Text = strmw.ReadLine()
game.PP1.Text = strmw.ReadLine()
game.counter1.Text = strmw.ReadLine()
game.PTurn.Text = strmw.ReadLine() 'get whos turn
ElseIf num = "2" Then
game.Pname1.Text = strmw.ReadLine()
game.PP1.Text = strmw.ReadLine()
game.counter1.Text = strmw.ReadLine()
game.Pname2.Text = strmw.ReadLine()
game.PP2.Text = strmw.ReadLine()
game.counter2.Text = strmw.ReadLine()
game.PTurn.Text = strmw.ReadLine() 'get whos turn
ElseIf num = "3" Then
game.Pname1.Text = strmw.ReadLine()
game.PP1.Text = strmw.ReadLine()
game.counter1.Text = strmw.ReadLine()
game.Pname2.Text = strmw.ReadLine()
game.PP2.Text = strmw.ReadLine()
game.counter2.Text = strmw.ReadLine()
game.Pname3.Text = strmw.ReadLine()
game.PP3.Text = strmw.ReadLine()
game.counter3.Text = strmw.ReadLine()
game.PTurn.Text = strmw.ReadLine() 'get whos turn
ElseIf num = "4" Then
game.Pname1.Text = strmw.ReadLine()
game.PP1.Text = strmw.ReadLine()
game.counter1.Text = strmw.ReadLine()
game.Pname2.Text = strmw.ReadLine()
game.PP2.Text = strmw.ReadLine()
game.counter2.Text = strmw.ReadLine()
game.Pname3.Text = strmw.ReadLine()
game.PP3.Text = strmw.ReadLine()
game.counter3.Text = strmw.ReadLine()
game.Pname4.Text = strmw.ReadLine()
game.PP4.Text = strmw.ReadLine()
game.counter4.Text = strmw.ReadLine()
game.PTurn.Text = strmw.ReadLine() 'get whos turn
End If
strmw.Close()
MsgBox("Loading sucess", MsgBoxStyle.OKOnly)
game.Show()
Me.Hide()
Else : Exit Sub
End If
End Sub
|
|
|
|
|
This is a mess. There's no way anyone can tell you if you read a particular line based on this, without seeing the file format. Even then, 'not sucess' is not very descriptive. What's going wrong ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how to read next line?
vb.net
is .txt file
i want to read those line deatail and pass to the label.
i jsut have to make it read accroding wat my coding then will be ok, casue i know how i save the file in the txt file.
example:
3
1
namea
10
2
|
|
|
|
|
You're reading the next line in your code. I don't understand the question. What's going wrong with the code you have ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
oh ic.. i dunno whether my code have error when it run is smooth but the label just didnt show anything, like it didnt have any information, i check the txt.file which have contain inside...hmm
|
|
|
|
|
If you go to the top of your code and press F9, you will set a break point. Then when you press F5 to run your code, it will stop at the break point and you can step through the code to see what is happening.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have notice a problem where the system only read the first line, only the first line was read and pass to the system but it pass to the last line of my code which is
game.PTurn.Text = strmw.ReadLine()
the whole coding for like this
If num = "1" Then
game.Pname1.Text = strmw.ReadLine()
game.PP1.Text = strmw.ReadLine()
game.counter1.Text = strmw.ReadLine()
game.PTurn.Text = strmw.ReadLine()
|
|
|
|
|
lol you have compicated it isnt it battter that u use "For" and "Next"?
or "Substring"?
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
then use substring in timer with interval (1) .... its fast :->
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
it will even worse cause the problem is with the hardware memory
|
|
|
|
|
If you had a hardware problem with the memory, your code, not to mention Windows wouldn't even run. Ever hear of the Blue Screen of Death?? That's what you get when you have hardware RAM problems...
Look, your code is a total mess and now your making up reasons, that you don't understand yourself, for why your doing it the hard way.
I showed you how to store player information in an array of class objects and how to serialize that array out to an XML file and read it back in. The biggest problem you have right now is that you don't understand how to represent and store your games data properly. Storing your games data in a bunch of TextBoxes is NOT the way to do it. The user interface you put on that form should only be used to display the current game state that you have stored. The controls, and the code behind them, should be used to tell your game how to manipulate the game state. The should NOT be used to store the actual data!!!
By NOT storing your game's data in a well thought-out structure, that has no dependancy on user controls what-so-ever, your actually making the rest of the game 100 times harder to write, and more importantly, 100 times harder to support!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
oh is it i dunno that my friend r telling me i have less ram cause low memory problem.
y i still want to find other solution cause i still havent figure out how the xml u told me.
ACtually i had already to store the data in the text file which when i check the file it was in there, and now i want to retrieve all the information and show it on the textbox, and i'm not sotring the data in the TEXTBOX because when exit the system everything sure will gone.
|
|
|
|
|
campbells wrote: my friend r telling me i have less ram cause low memory problem.
Entirely possible, but this has nothing to do with your problem. Actually, the way your doing it now uses more memory than doing it properly, but it's only by maybe 1-2K Bytes...
campbells wrote: i still want to find other solution cause i still havent figure out how the xml u told me
I practically wrote the bloody thing for you. Your biggest problem is how you represent data inside your application.
campbells wrote: now i want to retrieve all the information
How you wrote the file in the first place is what's making it such a pain in the a$$ to read it back in!!!
campbells wrote: and i'm not sotring the data in the TEXTBOX because when exit the system everything sure will gone
You don't have a single clue about what you're doing, do you?? I highly suggest picking up a beginners book on VB.NET. Save yourself 3 more months of beating your head against a wall getting this to work. Learn to do it the correct way from the start. Right now, you've got much bigger problems than just how to read a text file...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|