|
Since you're adding different kind of nodes (AG, SETT...) in that loop, why not simply use counters and calculate each item count.
Although if that's the whole logic, won't you have as many AG nodes as there are records in RSSQL2.
|
|
|
|
|
Hi All,
I have a problem regarding Threading. Actually i m executing diffrent function using thread in Timer.
So it takes max cpu Usages.
Pls tell me how to resolve it.
Thanks
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Most likely you execute so much in each timer interval taht it deplets your cpu. For example if you have 1 second as a timer interval and you execute code that takes 2 seconds, you'll have problems.
So the main point is to tune the code you execute using the thread and/or increase timer interval. Without actually seeing the code, it's quite hard to say more.
|
|
|
|
|
How can it resolve by removing Thread or Using only timer.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
It's hard to say how to exactly solve the problem without seeing the code. But if you execute a time consuming function regurarly (let's say every second) and it takes more time, it will consume all CPU. So you would have two options, execute it less often and/or try to improve the performance of the function. I'm not able to say how to improve the performance of the function since you have not provided any code.
|
|
|
|
|
I have a form with other forms added to it as controls.
I am using the anchoring property of the forms so that when i maxmize the main form,the embedded form maxmizes as well.This works fine when both the main form and chid form are open at same time and in normal window state and then i maximize the main form.
However,when only the main form is maximized first and then i open the child form in it,it doesn't open as maxmized,it opens in normail window state.
What is going wrong here?How can i make the form autmotically resize it self depending on the window state of the main form.
|
|
|
|
|
Sohaib_A wrote: when only the main form is maximized first and then i open the child form in it,it doesn't open as maxmized,it opens in normail window state
If you're using MDI, this expected behaviour. MDI children are not sized based on MDI parent when opening. You control the window state of a MDI child independently.
If you want you can set the windowstate to maximized when you create the child window if the parent is maximized.
However if the child window is always taking all the space in MDI container, it isn't acting like a MDI application. It sounds more like a SDI application, like Visual Studio editor.
|
|
|
|
|
I am not using mdi.
Just adding the form as a control to the main form.
Dim as new form1
Me.controls.add(f)
'I also set the anchor properties for form1 here
this is how i am doing it.
|
|
|
|
|
'If you want you can set the windowstate to maximized when you create the child window if the parent is maximized.'
I tried this but then the form cover the entire area of the main form.I have a menu strip on the left which gets covered by it.The menu strip has to be seen all the time.
|
|
|
|
|
Ok, so this is more like SDI. Instead of using forms, could you create a user control and place the contents you now have in a form to the user control. Then add the user control to the form you're using as a main form. Possibly add a tab where you place the user control if you want to have several tabs at the same time etc.
|
|
|
|
|
Thanks for the suggestion,i could use it for my later projects.But the thing right now is that I have already made the forms ,there are several and converting them to a user control would take time.Is there any other method in you opinion?
|
|
|
|
|
Well you could try to reset the anchoring in the code. Set anchoring to none in design time and set it after creating the form. Not sure, but it could help.
|
|
|
|
|
Hello,
I have a requirement of modifying the datasource of crystal report as per user select option from form. As records per each selection are too much which reduces the performance of application, so I need to do in this way. I tried to change the datasource by setting setdatasource command but it doesn't refresh the data in report.
Thanks in advance
Regards
Ali Raza
|
|
|
|
|
Have you tried using Refresh on the report document. If that's not working, could you post the code since it would be easier to see the problem.
|
|
|
|
|
Hi,
Thanks for your reply. Basically I need to change the datasource of an On-demand sub report in the Drill event of Group in the crystal report viewer.
The first time when I set datasource to On-demand subreport it works perfectly and sub report load with the data. But next time when I set datasource to subreport the subreport doesn't come up with the new data.
The code I m using to set datasource is :
Private Sub crView_Drill(ByVal source As Object, ByVal e As CrystalDecisions.Windows.Forms.DrillEventArgs) Handles crView.Drill
Dim strsql As String
Dim objUtil As New clsReportUtil
Dim rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ds As New DataSet
rpt = Me.crView.ReportSource
strsql = "Select * From tblDeliveryOrderHead " _
& "INNER JOIN tblCustomer ON tblDeliveryOrderHead.CustomerID = tblCustomer.CustomerID " _
& "Where CustomerName = '" & e.NewGroupName & "' "
ds = objUtil.GetDataSet(IBS_Utility.clsUtLib.GetConnectionString, strsql)
rpt.Subreports(0).SetDataSource(ds)
Dim subc As New CrystalDecisions.Shared.SubreportContext()
subc.SubreportName = rpt.Subreports(0).Name
subc.PageNumber = CType(source, CrystalDecisions.Windows.Forms.PageView).GetCurrentPageNumber
subc.Position = New System.Drawing.Point(1827, 2889)
tN.GroupLevel = e.NewGroupLevel
tN.GroupName = e.NewGroupName
tN.GroupNamePath = e.NewGroupNamePath
tN.GroupPath = New Integer() {e.NewGroupPath}
subc.ContainingGroupInfo = tN
CTyp(source,CrystalDecisions.Windows.Forms.PageView).DrillDownOnSubreport(subc)
rpt.Refresh()
End Sub
Regards
|
|
|
|
|
Just had a quick look but the first thing I noticed is that you don't set e.Handled to true . This prevents the default actions for drilling. Could that be the cause.
|
|
|
|
|
I have also tried this but it doesn't make any effect.
|
|
|
|
|
It's been a really long time since I last used Crystal so I don't remember the details accurately.
However another thing is that you don't really use source parameter. I'm wondering that are you actually creating a new subreport, but the one that you see is the one already defined in the main report. I didn't find what's the type of source in this case, but you could use debugger to see if you can take that as a starting point (use source for rpt variable instead of Me.crView.ReportSource) and so own.
|
|
|
|
|
Thanks for your suggestions. I am not creating new sub report. Sub report already exist in main report. The source parameter in this event is PageView.
Regards
|
|
|
|
|
Not sure about this, but it seems that the main report and the subreport are connected so the subreport is linked to the data in the main report datasource. Try if you can break the subreport connection (or link) in the designer with linking expert.
Another approach could be that you set and refresh both datasources (for the main report and the subreport):
...
rpt.Subreports(0).SetDataSource(ds)
rpt.SetDataSource(someOtherDs)
...
|
|
|
|
|
I've tried both the ways i.e linked & Unlinked Subreport.
The other approach I have not tried coz in case of main report I will need to hold a large dataset which holds some memory.
Regards
|
|
|
|
|
I think you should give it a try. Even if it's not the final solution, it could tell if that would solve the problem and if the problem is actually related to the main report.
|
|
|
|
|
Pl anyone Forward vb program for creating IE Toolbar with dropdown menu and icons
|
|
|
|
|
LMGTFY[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'll swap you, if you come and paint my house
I are troll
|
|
|
|