Temporary Tables in Crystal Reports

A

airkart

Hello,

I've scoured groups and the web, and haven't found a question like mine
answered.

I'm using Visual Studio 2003 with the Crystal Reports it comes bundled
with and SQL Server 2000. Throughout the project I'm working on, I
often find I need a temporary table displayed in a report, something
that I cannot seem to do. Since temporary tables are so useful, I
cannot imagine Crystal Reports wouldn't have a way to get such
information in, so maybe I'm looking in the wrong places. Is there a
way to do it, or at least a workaround solution?

Thanks in advance,
Conrad Eaglehill
 
N

Norman Yuan

Saying "temprory table", do you mean that you collect data from different
tables, databases and put them into a temprory table and then use this temp
table as data source for your report? As far as Crystal Report goes, it does
not care the data for its reports is from temp table or not. It is not a
Crystal Report issue.

At least you have two ways to get your data into a "temprory table" and use
it for report data source:

1. Use temprory table in SQL Server. In SQL Server, you can easily write
some T-SQL code in SP to collect data from different tables/databases into a
temp table and return data in this temp table to a report. Since you use SQL
Server, it is one of the basic skill to learn.

2. Use Crystal Report's "PUSH" mode to get data for report. With "PUSH", you
can use ADO.NET to get all kind of data into a DataSet, whether they are
from the same database/table or not. In this sense, it is a temprory table
in memory of app-running computer. Then you use this DataSet as report's
data source (push it into a report).
 
A

airkart

Norman said:
Saying "temprory table", do you mean that you collect data from different
tables, databases and put them into a temprory table and then use this temp
table as data source for your report? As far as Crystal Report goes, it does
not care the data for its reports is from temp table or not. It is not a
Crystal Report issue.

Well, yes, that's what I'm saying, and no, it seems to matter since it
needs the name of the table, and clearly the tempORARY table has no
name during compile time since it's...temporary.
At least you have two ways to get your data into a "temprory table" and use
it for report data source:

1. Use temprory table in SQL Server. In SQL Server, you can easily write
some T-SQL code in SP to collect data from different tables/databases into a
temp table and return data in this temp table to a report. Since you use SQL
Server, it is one of the basic skill to learn.

I can create a temporary table in SQL Server, thank you very much.
Calling a Stored Procedure from Crystal Reports gives an "Unknown Query
Engine Error." If my stored procedure is called pTest, calling "pTest",
"EXEC pTest", amd "EXECUTE pTest," all succeed in the Query Analyzer,
but all give the "Unknown Query Engine Error" when I attempt to use it
in an SQL Expression Field. Is there some magic way to use stored
procedures in Crystal?
2. Use Crystal Report's "PUSH" mode to get data for report. With "PUSH", you
can use ADO.NET to get all kind of data into a DataSet, whether they are
from the same database/table or not. In this sense, it is a temprory table
in memory of app-running computer. Then you use this DataSet as report's
data source (push it into a report).

Well, though you give no example, this might be helpful. The "Complete
Reference" book on my desk has no mention of "PUSH" mode, but at least
this gives me a new avenue to pursue. I'll search for an example on the
web, I suppose.

Conrad Eaglehill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top