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

Examples

 Post Reply Post Reply
Author
Message
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Topic: Examples
    Posted: 09 March 2008 at 8:12am
Newbie question...

I need to create a report from a list which has 4 columns. Are there any examples because none came with the demo I got.

Any other examples would be great as well.


Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 11:12am

This very simple code (MS Foxpro) can give you a basic idea how to create the columns and populate with some records…

 

RESIZABLE = TRUE

With xTremeReportControl

 

.Columns.DeleteAll()

.PaintManager.NoItemsText = "wait..."

.redraw()           

 

oCol0 = .Columns.Add(0,”Caption 01”, 300, RESIZABLE)

oCol1 = .Columns.Add(1,”Caption 02”, 300, RESIZABLE)

oCol2 = .Columns.Add(2,”Caption 03”, 300, RESIZABLE)

oCol3 = .Columns.Add(3,”Caption 04”, 300, RESIZABLE)

 

.Records.DeleteAll()

                .populate ()

 

                For i = 1 to 10

 

                               oRecord = .Records.Add()

 

                                oItem0 = oRecord.AddItem( “value “ + str(i) )

                                oItem1 = oRecord.AddItem( “value “ + str(i) )

                                oItem2 = oRecord.AddItem( “value “ + str(i) )

                                oItem3 = oRecord.AddItem( “value “ + str(i) )

next

 

.populate()       

 

endWith

wlcabral
Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 11:18am
Will this work in VB6 ?
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 11:52am
No, but is very similar.
wlcabral
Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 12:18pm
Got the columns sorted, problem is the rows.
Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 5:43am
Must be someone out there who can give me an example in VB6 of how to easily add a row to a report.
Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 5:44am
Must be someone who can help
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 10:21am
What is the problem that you are having? Did you call the Populate method of the ReportControl after you added all of the rows?

Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 10:28am
I cant even figure out how to add the rows, feeling really thick here. Any chance of a small (very easy) example.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 10:50am
I don't use the ReportControl much myself, but basically you have to add rows to the ReportControl using the ReportControl.Records.Add method. Once you have the record object, you can then add cells using the Record.AddItem method. The cells should match you column definitions. Once you have created all of your records, call ReportControl.Populate to display them (this is for efficient repainting).

This code is adapted from the CodeJock ReportControl sample:



    Dim Record As ReportRecord
    'Adds a new Record to the ReportControl's collection of records, this record will
    'automatically be attached to a row and displayed with the Populate method
    Set Record = Me.ReportControl1.Records.Add()
   
    ' Add Cells to the record
    Record.AddItem "Cell1 Text"
    Record.AddItem "Cell2 Text"   ' Etc...

    Me.ReportControl1.Populate   ' Show the record you just added
 
Back to Top
XpatTech View Drop Down
Groupie
Groupie
Avatar

Joined: 26 November 2007
Location: United Kingdom
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote XpatTech Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 11:01am
Going to try it later today, will let you know if i have any hair left 
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 11:08am
Good luck!
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.219 seconds.