473,769 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report formating

vp
Hi all,

I need to create a report by extracting data from a table. I am using
the utility EXPORT to pull data from table to a file.

I will need to get the column heading and also if I want to add some
text and report date ..etc

can you please let me know how to create a report..

thanks

Feb 24 '06 #1
4 1480
Easy way is add such information by yourself in select-statement.

For example:
export to report_formatin g_sample.txt of del modified by nochardel
coldel:
VALUES (' Created', CHAR(CURRENT DATE))
UNION ALL
VALUES (' EMPNO ', CHAR('Full Name',20))
UNION ALL
VALUES ('------ ', '--------------------')
UNION ALL
SELECT CHAR(empno,8), CHAR(lastname || ', ' || firstnme, 20) FROM
Employee
ORDER BY 1

This command produce like following text file.
Created:2006-02-26
EMPNO :Full Name
------ :--------------------
000010 :HAAS, CHRISTINE
000020 :THOMPSON, MICHAEL
000030 :KWAN, SALLY
000050 :GEYER, JOHN
000060 :STERN, IRVING
000070 :PULASKI, EVA
000090 :HENDERSON, EILEEN
000100 :SPENSER, THEODORE
000110 :LUCCHESSI, VINCENZO
000120 :O'CONNELL, SEAN
000130 :QUINTANA, DOLORES
000140 :NICHOLLS, HEATHER
000150 :ADAMSON, BRUCE
.......

Feb 26 '06 #2
Another example:
export to report_formatin g_sample2.txt of del modified by nochardel
VALUES (' Created:'||CHAR (CURRENT DATE))
UNION ALL
VALUES (' EMPNO Full Name Salary')
UNION ALL
VALUES ('------- -------------------- ----------')
UNION ALL
SELECT CHAR(empno,8) || CHAR(lastname || ', ' || firstnme, 20)
||SUBSTR(RIGHT( '
'||TRANSLATE(LT RIM(TRANSLATE(R TRIM(CHAR(salar y)),' ','0')),'0', '
'),11),1,11)
FROM Employee
ORDER BY 1;
------------------------------------------------------------------------------
SQL3104N The Export utility is beginning to export data to file
"report_formati ng_sample2.txt" .

SQL3105N The Export utility has finished exporting "35" rows.
Number of rows exported: 35
Copy of output file "report_formati ng_sample2.txt" is followings.

Created:2006-02-26
EMPNO Full Name Salary
------- -------------------- ----------
000010 HAAS, CHRISTINE 52750.00
000020 THOMPSON, MICHAEL 41250.00
000030 KWAN, SALLY 38250.00
000050 GEYER, JOHN 40175.00
000060 STERN, IRVING 32250.00
000070 PULASKI, EVA 36170.00
000090 HENDERSON, EILEEN 29750.00
000100 SPENSER, THEODORE 26150.00
000110 LUCCHESSI, VINCENZO 46500.00
000120 O'CONNELL, SEAN 29250.00
000130 QUINTANA, DOLORES 23800.00
000140 NICHOLLS, HEATHER 28420.00
000150 ADAMSON, BRUCE 25280.00
.......

Feb 26 '06 #3
The basic principle of a tiered architecture is that you do reporting
and display function in the front end. This has nothing to do with the
database.

Feb 26 '06 #4
--CELKO-- wrote:
The basic principle of a tiered architecture is that you do reporting
and display function in the front end. This has nothing to do with the
database.


Sure, but everyone should know how to make the occasional report out of
the database - if only because once in a while you'll want a single
fully automated report, and won't feel like trying to get a
cognos/brio/crystal/whatever purchase pushed through purchasing. In
this case the economics are clearly in favor of doing something small
mostly in the database.

But having said that, i still find it easier to do the formatting
outside of sql:
1. export data in pipe-delimited format
2. use a generic script (python, perl, etc) to convert data file to
html
3. wrap process in ksh/bash script that also emails
4. schedule script via cron

It's very low-tech, but extremely simple way to put together simple
static reports.

ken

Feb 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4711
by: Dave Smithz | last post by:
Hi there, A client of mine wants to start generating some reports from their PHP / MYSQL database. They were previously gathering data from the screen and cutting and pasting it into a Word document template. They now just want to generate it. My initial thoughts are to just format the information in a table and then they print it out. But due to the dynamic nature of the reports and what is
6
2700
by: David B | last post by:
I have a report with 2 sub reports on it. The report is an invoice and the sub reports are dropping data onto the invoice. This worked fine if generating 1 invoice at a time. I am trying to create a run of invoices. I would like the appropriate data for each custid from each sub report to be on the same page. The nearest I can get is 2 pages for each customer Any Thoughts TIA David B Hexham UK
2
5527
by: Lee | last post by:
As the subject states, I have been playing in the system trying to figure out a method of using a report as the email body text. So far, the closest I have come is the acFormatHTML. However, when the report is more than one page, it autoformats the report to multiple pages. I need one document. Reason for doing this as text vs. attachment is in order to make the message easier to view for the reader/receipent.
2
2819
by: Michael S. Montoya | last post by:
I have a report which has 3 sub-reports in the detail section. Everything (subforms, detail section) is set to Can Grow and Can Shrink as True. I have one record in which one of the subforms has about 7 detail items and the other subforms have several detail items. When I try and print this record it does not get past "Formating - Hit Control-Break" in the status line. When I delete a couple of the 7 line items, it prints fine. Is...
4
12182
by: jaYPee | last post by:
I have a report created in crystal report. My problem is on how can I remove the decimal point without converting the value. say for example if I have this data: Unit 2 1.5 2 3
4
1713
by: BrianDH | last post by:
Hi I am working on a C# Windows Application that builds an invoice (CR) converts to PDF and attach to email one at a time. This works untill my invoice count get over 40 to 50 invoices then I start getting errors. The errors vairy. sometimes IO sometime "unable to load report". Has anyone here had a need to creat reports in mass?
3
2098
by: pv1 | last post by:
Hello, I am somewhat new to Access and vba, but am trying to complete a request that has been made of me. Access version 2002 WindowsXP. At this point these text boxes are bound to the table memo field. I have located Stephen Lebans code to limit enter of text field based on characters entered and code to limit text based upon width of a text box (this seems to be most applicable for single line text box). I am have trouble putting...
12
3113
by: kabradley | last post by:
Hello, Thanks for looking at my post and hopefully having an answer or at least a suggestion to my problem. I currently work at a financial planning office that deals with many clients and accounts. Each client may have multiple accounts such as an individual, IRA, and possibly a joint tenant account. Each one of these accounts for the particular client is contained in a 'Portfolio'. For example, Joe Smith may have 3 accounts: Joe Smith...
2
1554
by: FNA access | last post by:
I have a request to highlight any entries in a report that have the same date. The report is sorted by date so the records would be one after the other. I cannot find any events for the report that I would be able to add any code to. Any input or advice would be appreciated I would like to figure the code myself as I find I learn better that way, I just can't find an event to put the code into. My report is based on a saved query,...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.