?
Solved

serial no in datareport

Posted on 2000-05-16
3
Medium Priority
?
270 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
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…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 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