![]() |
Examples |
Post Reply ![]() |
Author | |
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
wlcabral ![]() Groupie ![]() ![]() Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
Will this work in VB6 ?
|
|
![]() |
|
wlcabral ![]() Groupie ![]() ![]() Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
![]() ![]() ![]() ![]() ![]() |
No, but is very similar.
|
|
wlcabral
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
Got the columns sorted, problem is the rows.
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
Must be someone out there who can give me an example in VB6 of how to easily add a row to a report.
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
Must be someone who can help
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1354 |
![]() ![]() ![]() ![]() ![]() |
What is the problem that you are having? Did you call the Populate method of the ReportControl after you added all of the rows?
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
I cant even figure out how to add the rows, feeling really thick here. Any chance of a small (very easy) example.
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1354 |
![]() ![]() ![]() ![]() ![]() |
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:
|
|
![]() |
|
XpatTech ![]() Groupie ![]() ![]() Joined: 26 November 2007 Location: United Kingdom Status: Offline Points: 37 |
![]() ![]() ![]() ![]() ![]() |
Going to try it later today, will let you know if i have any hair left
![]() |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1354 |
![]() ![]() ![]() ![]() ![]() |
Good luck!
|
|
![]() |
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 |