PDA

Click to See Complete Forum and Search --> : [RESOLVED] Is this possible with a VB6 datareport


Nitesh
May 27th, 2008, 07:36 AM
Hi Guys,

I have two tables. One stores people information and another stores numbers assigned to them. The numbers table has a foreign key that links to the primary key of the people table.


I want to display a persons name in the page header and then the numbers assigned to them in the details section of the report.

also:How can I filter the reportby a certain ID. do I use a parameter, and if so, how?

Please help

wes4dbt
May 27th, 2008, 12:38 PM
If your planning to use a DataEnvironment then,

Check out this thread
http://www.vbforums.com/showthread.php?t=502940


Also setup the DE with it grouped on "people", then set the group property to page break after each group.

If you don't want to use a DE the only other option for Grouping a DataReport is creating a MSDataShape recordset and setting it as the reports datasource, at least it's the only other way I know of.

Good Luck

Nitesh
May 28th, 2008, 06:47 AM
Thanks Wes,

I have a query like:

SELECT * FROM people where Id IN(?) for example.

when I had:


SELECT * FROM people where = ?, it worked great.

I want to send more than 1 id but im getting an error. Please help me

wes4dbt
May 28th, 2008, 11:58 AM
Do you mean a range of "Id"?

Setup two parameters, then
SELECT * FROM people where Id >= ? and Id <= ?
This is shown in the link I posted.

You could also try the "Like" claus but I have never used it in a DE SQL.

Nitesh
May 29th, 2008, 02:50 AM
Thanks again Wes4dbt,

How can I show a field in the details section like this:

1,2,3,4


instead of:

1
2
3
4

wes4dbt
May 29th, 2008, 11:03 AM
I don't think it can be done using a DE. You could use SQL to create an ADO recordset of the report data then create a new empty recordset and load it in the format you want. You can use the new rs for the reports datasource.

Nitesh
May 30th, 2008, 01:22 AM
thanks again Wes4dbt,

I needed my report in that format urgently. So I decided to do a report in HTML and display it in a webbrowser control. It was way easier that trying to figure it our with a DE. It took me just half and hour. Thanks for all your help:afrog:

wes4dbt
May 30th, 2008, 11:52 AM
Thats great, a DataReport can be very difficult to work with, if a hadn't already spent countless hours working with it I'd drop it like a hot rock and learn Crystal Reports. Hopefully, some day I will.