Print Page | Close Window

Examples

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=9831
Printed Date: 04 May 2024 at 2:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Examples
Posted By: XpatTech
Subject: Examples
Date 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.





Replies:
Posted By: wlcabral
Date 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


Posted By: XpatTech
Date Posted: 09 March 2008 at 11:18am
Will this work in VB6 ?


Posted By: wlcabral
Date Posted: 09 March 2008 at 11:52am
No, but is very similar.

-------------
wlcabral


Posted By: XpatTech
Date Posted: 09 March 2008 at 12:18pm
Got the columns sorted, problem is the rows.


Posted By: XpatTech
Date 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.


Posted By: XpatTech
Date Posted: 10 March 2008 at 5:44am
Must be someone who can help


Posted By: jpbro
Date 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?



Posted By: XpatTech
Date 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.


Posted By: jpbro
Date 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
 


Posted By: XpatTech
Date Posted: 10 March 2008 at 11:01am
Going to try it later today, will let you know if i have any hair left 


Posted By: jpbro
Date Posted: 10 March 2008 at 11:08am
Good luck!



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