Solved

serial no in datareport

Posted on 2000-05-16
3
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
Visual_Basic_ earned 20 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

691 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