Print Page | Close Window

Creating Groups manually

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=11077
Printed Date: 10 November 2024 at 8:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Creating Groups manually
Posted By: BoboP
Subject: Creating Groups manually
Date 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?





Replies:
Posted By: younicke
Date Posted: 17 June 2008 at 11:00am
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



Posted By: BoboP
Date Posted: 18 June 2008 at 1:15am
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..


Posted By: younicke
Date Posted: 18 June 2008 at 1:43am
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 - 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.




Posted By: younicke
Date Posted: 18 June 2008 at 1:52am
great. that's what ive been trying to tell you... just save the profile to the registry and load it in the form event 


Posted By: BoboP
Date Posted: 18 June 2008 at 2:01am
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,




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net