Displaying Data Table Queries

  • Thread starter Thread starter jp2msft
  • Start date Start date
J

jp2msft

I have several basic queries that seem to add up to a very intricate query.

I need to create a report to display the results of these queries, but I
don't know the best way.

The old VB5 program this new application is replacing wrote the document in
a very painful, line-by-line format to a VSPrinter object. Should I do this
again, using the PrintDocument object instead?

I can't get Crystal Reports to display data for me, so I guess it is out.
I've asked questions on how to use it, but I don't get replies. I guess
others don't use it either.

I suppose I could use an HTML page. This seems the simplest, but also would
not give nice headers/footers between page breaks.

Any thoughts?
 
You're in luck. There are a number of new, and far easier to use reporting
systems now. If you have VS2008 you can use the ReportViewer control and
create a sample report with the Reports Application template. With VS 2005
you can still leverage the ReportViewer control that can easily create a
report on a DataTable with very little trouble. Yes, Crystal is a PIA IMHO
so I'm sure you'll be happier with the ReportViewer approach. Chapter 14 (?)
of my new book is a long chapter on how to setup and use the RV control.

hth
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
Well, I hope this book does the trick. I just ordered one after seeing it had
almost 5 stars on Amazon.

Still, I would have liked to have gotten this report done this week, so I'll
keep Googling.
 
No offense, but your book doesn't help me. It is just too big. The
chapter/book is very wordy, and I can't stay focused that long.

What makes it worse is that you build on information from earlier parts of
the book without referencing how to get to them, like saying you're going to
use a stored procedure developed like you showed us how to do earlier in the
book.

Also, the 'chat room' style of writing is difficult to follow, especially
for people like me that don't use chat rooms. I know what IMHO means, but I
couldn't see where it was ever defined. Acronyms like this are used all over
the book, which is not what one would expect to see in a published works.

That's too vague for me, and I'm not that skilled in SQL. I'm a software guy
that knows a little about SQL, not the other way around. I'm sure I would be
a SQL guy if I read through your book, but at 1100 pages, I just don't have
time for that.

I'm sorry, but I really wasn't that impressed with your Hitchhiker's Guide.

With that said, I am still looking for a way to produce my report.

Instead of it being a standard report that returns 3 columns from the
database, I need to return columns A, B, and C from Shift 1, columns A, B,
and C from Shift 2, and columns A, B, and C from Shift 3. The catch is, I
need to display the report as:

| Col A | Col B-Shift1 | Col C-Shift1 | Col B-Shift2 | Col C-Shift2 | Col
B-Shift3 | Col C-Shift3 |

Is there a way to do this?

In other words, is there a way to construct an SQL statement that groups
into columns, or do I need to call multiple SQL statements?

And, if I have to use multiple SQL statements, how do I then turn around and
output this type of report?

Currently, I am displaying everything using an HTML Table, but this is an
internal company application, and the group really does not like the report
generating in a web browser.

Still looking for answers.
~Joe
 
I just got your question. Sorry :-)

You cannot do this with standard SQL. Some vendors may allow you to do this
with specialized SQL functions, but that depends on what database you're
using.

You may wanna checkout out of the box products that seem to do exactly what
you're trying to code yourself. Check out the address on the bottom.

Elad
http://www.sisense.com
"This was written in .Net?! Unbelievable!"

Elad said:
Hi,

Can you join the three tables on [Col A]?

Elad
http://www.sisense.com
"This was written in .Net?! Unbelievable!"

jp2msft said:
Instead of it being a standard report that returns 3 columns from the
database, I need to return columns A, B, and C from Shift 1, columns A,
B,
and C from Shift 2, and columns A, B, and C from Shift 3. The catch is, I
need to display the report as:

| Col A | Col B-Shift1 | Col C-Shift1 | Col B-Shift2 | Col C-Shift2 | Col
B-Shift3 | Col C-Shift3 |

Is there a way to do this?

In other words, is there a way to construct an SQL statement that groups
into columns, or do I need to call multiple SQL statements?

And, if I have to use multiple SQL statements, how do I then turn around
and
output this type of report?

Currently, I am displaying everything using an HTML Table, but this is an
internal company application, and the group really does not like the
report
generating in a web browser.

Still looking for answers.
~Joe
 
Back
Top