Solved

serial no in datareport

Posted on 2000-05-16
3
261 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 20 total points
Comment Utility
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
Comment Utility
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_
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now