[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

serial no in datareport

Posted on 2000-05-16
3
Medium Priority
?
272 Views
Last Modified: 2010-05-02
how can i create serial no(1,2,3...) for each item in detail section?.How can i call a function in datareport? I am using sql statement to create group and detail.
0
Comment
Question by:shyma
  • 2
3 Comments
 

Accepted Solution

by:
Visual_Basic_ earned 40 total points
ID: 2828021
I had the same problem. This I have done is to open the recordset programmatically and set the field's value to its line number.

I did it via ADO.
I had an empty table. There were only the fields.
I filled it with a "Insert" query, which was filling one field with "0".
I named this field "RowCount".

Then I did so:

DE1.rsMyTable.MoveFirst
While DE1.rsMyTable.Eof=False
DE1.rsMyTable.fields("RowCount").value=DE1.rsMyTable.AbsolutePosition & "/" & DE1.rsMyTable.RecordCount
DE1.rsMyTable.Movenext
wend

I filled the "of xx"
e.g. The field was 0 and I did it "1/20","2/20","3/20"... and so on.

If you have trouble simply mail me.

0
 

Author Comment

by:shyma
ID: 2828289
I'm using sqlbuilder to select fields from different table.Is there any way to create serialno using sqlbuider.something like count(rowid) in oracle.As per visual basic reply ,are you creating a table to hold all values to be shown in datareport.
Okay then what you have written something like "of xx".   I don't understand.Can you explain me in detail?
0
 

Expert Comment

by:Visual_Basic_
ID: 2828822
I don't know about Oracle. In Sybase there is a system variable called @@rowcount. It returns the number of line.

When I say "...of xx" I mean that when I replace the zero values in the field "Rowcount" I add the line of the record and the total number of rows.

Like when you are printing and it says "Page 1 of 3"

In my first reply I replaced the word "of" with the slash "/". No matter, if you follow these instructions you can add everything. It's a string field, not a numeric one.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question