Creating Groups manually |
Post Reply |
Author | |
BoboP
Groupie Joined: 21 March 2008 Status: Offline Points: 25 |
Post Options
Thanks(0)
Posted: 17 June 2008 at 10:45am |
Hi !
In my application , I needed to show records in report control in sorted and grouped way in same way it was at time application was exited. That is storing last sorted groups and showing them on starting the application. So i can store column name on which it was grouped . But on loading of report control i needed to create the groups manually and not on column click How can I do that? I am using following statement . But it is throwing some exception ReportControl.GroupsOrder.Add(ReportControl.Columns[6]) Anyone can suggest anything? |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
hi!
you can try using the LoadSettings and SaveSettings property of the reportcontrol. Sample Code: Private Sub Form_Load() 'create report control here i.e. define columns and the content data 'after you created the report control you can use the LoadSettings 'property of the report control. Dim sReportSetting as String sReportSetting = GetSetting(param1, param2, param3, param4) rptControl.LoadSettings sReportSetting End Sub Private Sub Form_Unload(Cancel As Integer) 'save the report settings here SaveSetting param1, param2, param3, rptControl.SaveSettings End Sub fill up the required values for the param1-param4 here is the settings that is being saved in the registry Report Control: Column order, sort order, group order, column visibility, GroupBox visibility, Column Width, and Alignment. hope this helps |
|
BoboP
Groupie Joined: 21 March 2008 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
hi ! Younicke!
Thanks for replying. I was happy as I thought This was the perfect solution. Only In my case I am not finding ReportControl.Getsetting method. I'm using C#. Will it make a difference there ?.... Also Codejock 11.2.** version... Or else Can get the setting from registry myself.... By reading registry values n all. Please let me know, Thanks again... for such gr88 hint.. |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
u didnt look closely on the sample code that i posted. there is no ReportControl.GetSetting method that i wrote there.
i am attaching the report sample from the 11.2 uploads/20080618_013930_ReportSample.zip please note carefully: i have comment out the lines in the Form_Load Event wndReportControl.GroupsOrder.Add wndReportControl.GroupsOrder(0).SortAscending = True and i have inserted some code in the last part of the Form_Load Event Dim sSettings As String sSettings = GetSetting("CJReportSample", "Settings", "ReportSetting", "") wndReportControl.LoadSettings sSettings and also in the Form_Unload Event SaveSetting "CJReportSample", "Settings", "ReportSetting", wndReportControl.SaveSettings please try to run the sample attached and give me feedback. im sorry i dont know how to do it in C# as i dont have VS.net installed here. |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
great. that's what ive been trying to tell you... just save the profile to the registry and load it in the form event
|
|
BoboP
Groupie Joined: 21 March 2008 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
Hiee!! Younicke!
Yes I have downloaded the file. This sample seems really useful , It will be helpful for me . But I cant open solution file... I have visual studio 2005 with me , For time being , regards toGetSetting: I employed following approach. I stored the profile string in registry while closing the form , Just retrieved it by reading the registry on form Shown event ... Used LoadSetting(string profile).. I could do w/o GetSettings. It worked . MANY THANKS, |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |