Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I include the SQL script in a report? Thanks.

Status
Not open for further replies.

adhocUser

Programmer
Dec 18, 2003
3
US
Hi,

I have a simple problem (and I am hoping there is a simple solution as well)!

I need to include my SQL script in my report as a summary or a header. I can cut and paste it now, but is it possible to do this automatically so that my report contains both the SQL as well as the report data?

Thanks.
AdhocUser
 
From the menu select Report > Query > Profile to look at the SQL that is generated. If you select the items that are in your SQL script from the catalog then go back to your Profile to see what your SQL looks like. You can also create a report that is totally customize by select the database only approach but I'd try the first method first.

Mark

Consultants Club Corp.
 
Thanks Mark. However I am not sure if I explained my problem clearly or I have not understood your answer.

Let us say that I have a report and for now, assume it is from one folder which is based on one table and it is a simple report. When I look at the 'Report-Query-Profile-SQL' lets say the sql looks like:

select t1.key, t1.desc from some_keytable1 t1.

The report looks like:

Key Table Values
key desc

001 description one
002 description two
... and so on.

What I want is to include my sql script in my report and make the report look like:

Key Table Values
key desc

001 description one
002 description two
... and so on.

select t1.key, t1.desc from some_keytable1 t1

The position of the script is not important, but it needs to be included in the report itself and automatically. I should not have to cut and paste it from Profile into the report as a text insert.

Thanks for your answer.
 
Gotcha, apart from inserting the detail/summary filter information which doesn't like anything like SQL, I don't know. It sounds like it would be an insertable item but it doesn't seem to be.

Consultants Club Corp.
 
1. Insert a Text box in the Page header.

2. Highlight copy and paste the SQL into the text box.

This is the only way to view/keep the sql in your .imr report. Unfortunately, you will have to re-paste every time you change the report details. It is not a dynamic item.

CP [cook]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top