Hi All,
Plz explain the use of Integer in reports creation as one of the data items . I’ve not used this functionality as yet & want to learn if it could give good results & save my time too .Thx in adv.
Cheers,
Navitech
Hi All,
Plz explain the use of Integer in reports creation as one of the data items . I’ve not used this functionality as yet & want to learn if it could give good results & save my time too .Thx in adv.
Cheers,
Navitech
It’s a normal practice to use integers in reports when you use temporary tables or when you want to control loops in data items.
For example in sales invoices, pages numbers are controlled using this way.
Hi,
That means the other loop controlling functions are dumped if we go for this thing …I mean to say what’s the use of other loop control statements then ?
Cheers,
Navitech
Which loop controlling functions? Might you, please, explain yourself?
Using integer is the same as using any other dataitem.
The system uses the same triggers as it would with any other dataitem.
You can use it to loop through a temporary record set as specified above.
To define how many times the system will loop through the integer you use a setrange
Integer.Setrange(number, start, end);
So for example if I had imported a load of records into the Excel Buffer Table which I had set to Temporary then I cannot just add an Excel Buffer data item and loop through it as the data is stored locally to me because it is temporary.
So instead on the OnPreDataItem of the integer I would put something like
Setrange(Number,1,XLBuffer.Count); this means I know the integer data item will end, and will have looped through every record.
Then on the OnAfterGetRecord I can say
If Number = 1 then
XlBuffer.FindFirst
Else
XlBuffer.next;
Then I can play with the correct Excel Buffer record by using XLBuffer and I know the pointer is on the correct record.
Hope that helps
/TH
Hi All,
tht was a gud response frm all u Gurus out there [:D] … I’ll try n use this functionality frm now on …!
Cheers,
Navitech
Check also this link: http://www.mibuso.com/howtoinfo.asp?FileID=6
Link Blurb :
How To create a report which is based on a temporary table?
Author: Luc Van Dyck
When you normally create a report, it is based on one or more tables.
Sometimes you need to create a temporary table (eg. to combine or sort data) and you want that data to appear in a report. The problem is that you can’t use a temporary table directly in the DataItem-property of the report. It only accepts “real” tables. The solution for this is to use the virtual table Integer instead, and write code to simulate the OnAfterGetRecord-trigger…
Hey Kriki,
Thanks for the post, I realised my explanantion was a bit of a ramble, my excuse is that I have been sick.
If you post a direct link like that do you think you could also right a bit of a blurb about what’s at the end of the link.
The reason I ask is that if in future that page moves, the link will no longer be valid. And if someone comes and searches, sess this “link” they won’t get their answer as it will no longer be there.
Cool
Ta
/TH
Hi Kriki,
That was a pretty cool link … thx a lot . It justifies the use of Integer as a data item.
Cheers,
Navitech
I use this system a lot.
Also in cases I have to filter in 1 way and sort in another. So I can read the data in a fast way, put them in temptables and then print them.
Also when I have a report with a lot of calculations. In this way I can separate the calculating logic from the output logic and the report becomes a lot easier to program and maintain.