Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Creating Groups manually
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating Groups manually

 Post Reply Post Reply
Author
Message
BoboP View Drop Down
Groupie
Groupie


Joined: 21 March 2008
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoboP Quote  Post ReplyReply Direct Link To This Post Topic: Creating Groups manually
    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?


Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
BoboP View Drop Down
Groupie
Groupie


Joined: 21 March 2008
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoboP Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post 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

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.


Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post 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 
Back to Top
BoboP View Drop Down
Groupie
Groupie


Joined: 21 March 2008
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoboP Quote  Post ReplyReply Direct Link To This Post 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,

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.