Sql to generate a report.

Hi All,
I need to prepare a report having monthly data. For this i am using query to pull data from the table having monthly data. Below are the complete details.
Table Details:
column_name data_type
status varchar2(5)
description varchar2(35)
report_date date
member_count number
It have the sample data like below:
status Description Report_date member_count
0     Voluntary Disenrollment     7/1/2012     
1     Regular     7/1/2012     96540
5     HOLD - Medi-Cal Ineligibility     7/1/2012     57
55     Unmet Share of Cost     7/1/2012     6074
59     HOLD - HCP Coverage Limits     7/1/2012     699
P4     Pending Enrollment     7/1/2012     
S0     Retro - Voluntary Disenrollment     7/1/2012     
S1     Retro - Add     7/1/2012     
S9     Retro - Mandatory Disenrollment     7/1/2012     
similarly it have data for different report_date's. I need to pull data from this table like below.
Status      Description     7/1/2012     6/1/2012     5/1/2012     4/1/2012
00     Voluntary Disenrollment          1          3
01     Regular     96,540     96,620     96,500     96,429
05     HOLD - Medi-Cal Ineligibility     57               
55     Unmet Share of Cost     6,074     6,652     6,899     6,922
59     HOLD - HCP Coverage Limits     699               
P4     Pending Enrollment               1     
S0     Retro - Voluntary Disenrollment          14     13     24
S1     Retro - Add     4,587     7,200     8,288
S9     Retro - Mandatory Disenrollment          2     4     1
i need to get all the details like above from 07/01/2012 to 07/01/2011. Similarly if i pull the data next month it should have all details form 08/01/2012 to 08/01/2011.
I am using below query i am not able to get the result as intended.
select status,description,
max(decode(TO_CHAR(report_date,'MON'),'JAN',member_count,0)) jan,
max(decode(TO_CHAR(report_date,'MON'),'FEB',member_count,0)) feb,
max(decode(TO_CHAR(report_date,'MON'),'MAR',member_count,0)) mar,
max(decode(TO_CHAR(report_date,'MON'),'APR',member_count,0)) apr,
max(decode(TO_CHAR(report_date,'MON'),'JUN',member_count,0)) may,
max(decode(TO_CHAR(report_date,'MON'),'JUL',member_count,0)) jun,
max(decode(TO_CHAR(report_date,'MON'),'AUG',member_count,0)) jul,
max(decode(TO_CHAR(report_date,'MON'),'SEP',member_count,0)) aug
from MONTHLY_MEMBERSHIP_REPORT_834
where report_date >=to_date('2012/01/01','yyyy/dd/mm')
group by description,status
order by status;
Can some one help me on this..?

Please ignore this post

Similar Messages

  • Using XML PIVOT clause in SQL to generate crosstab report BI Pub. Possible?

    I am trying to use the XML version of the Pivot Clause in an SQL query to generate the SQL needed for a cross tabular or Pivot report in BI Publisher. How can I use the output (e.g. below) in BI publisher as the SQL query? It is ignoring the XML column when I view the output in BI. IS this possible and has anyone tried this?
    for example
    SQL> SELECT *
    2 FROM (
    3 SELECT deptno, job, sal
    4 FROM emp
    5 )
    6 PIVOT XML
    7 (SUM(sal) FOR deptno IN (ANY));
    JOB DEPTNO_XML
    ANALYST <PivotSet><item><column name = "DEPTNO">20</column><column name = "SUM(SAL)
    ">6600</column></item></PivotSet>
    CLERK <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">1430</column></item><item><column name = "DEPTNO">20</column><column name
    = "SUM(SAL)">2090</column></item><item><column name = "DEPTNO">30</column>
    <column name = "SUM(SAL)">1045</column></item></PivotSet>
    MANAGER <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">2695</column></item><item><column name = "DEPTNO">20</column><column name
    = "SUM(SAL)">3272.5</column></item><item><column name = "DEPTNO">30</colum
    n><column name = "SUM(SAL)">3135</column></item></PivotSet>
    PRESIDENT <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">5500</column></item></PivotSet>
    SALESMAN <PivotSet><item><column name = "DEPTNO">30</column><column name = "SUM(SAL)
    ">6160</column></item></PivotSet>
    thanks
    Paul P

    Sorry Sunder, you're going to have to work a little harder to get points! I know how the PIVOT clause and all its options work so I don't need documentation on just the SQL. Its how it works in BI that I'm interested in.
    I want to use the XML option in the PIVOT clause as I don't want to hard code the crosstab columns. (see my code in the original posting)
    I want to know if BI Publisher is able to read the output of the script when creating a report based on an SQL query and generate something that actually looks a crosstab rather than a column of XML. I want my report in BI to look something like the output below. (Sorry about output. I can't get fixed width font working on this forum).
    PRODUCT INTERNET_Q1 INTERNET_Q4 PARTNERS_Q2
    Bounce 347 632 954
    Smash Up Boxing 129 280 560
    Comic Book Heroes 47 155 275
    thanks
    Paul P

  • Generating hourly report from oracle database using sql developer .Help

    I am working on SQL Developer 1.5.1, i need to prepare hourly record of the activity on the database, for that i have a sql query that gives me the report as per selected columns on hourly basis.I need to prepare 24 reports a day.
    Each time i have to go to the query , change the date as per hours like form 22:06:2011 10:00:00 to 22:06:2011 11:00:00 and get the report and export it in excel.
    I want to automate the script so that whenever i run the script , it just asks me the date and runs the script 24 times and fetch me the hourly report of whole day.
    the query syntax is something like this
    Select
    from
    where
    And.......................
    And...................
    And......................
    And req date between to-date( 22:06:2011 10:00:00) And to-date(22:06:2011 11:00:00)
    Order by 7,1,2,3,4,5
    Is there any possibility that i can automate the script to automatically change the hour itself and generate a report in excel 24 times?please share if you have any idea on this.
    Looking forward for a response.

    This gives you data for the whole day and the first column tells you which hour data it is,
    SELECT 'HOUR' || TO_CHAR ( req_date, 'HH24') AS hour_num,
           col1,
           col2,
           col3
      FROM table_name
    WHERE TRUNC (req_date) = TO_DATE ( '22/06/2011', 'DD/MM/YYYY')G.

  • Can one generate a report in Word document using PL/SQL?

    We have a weekly status report application created in APEX, is there a way to generate a report in MS Word document (including formatting the doc) using PL/SQL by pulling data from Oracle database? Please shed some lights on this and any info and experience would be greatly appreciated.
    We use Oracle11g and apex version 3.1.1.00.09
    Thanks!

    Hi Tony,
    you are right, the NEW format isn't necessarily improved, also the user would need at least Office 2007 or higher.
    Still it is possible to do that ;-)
    And yes, there are other possibilities, but this question is dealing with Word documents (.doc i assume).
    Also my Statement "docx = XML" isn't clear enough. Docx is a zipped file which contains a xml file. Details: http://en.wikipedia.org/wiki/Docx
    sorry for the confusions,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

  • Generate Sql Trace in oracle reports

    Hi,
    My Reports version is 10.1.2.0.2 and I would like to see the trace files of the sql queries that are executed while generating a report using rwbuilder.
    I tried using a Formula column, with
    SRW.DO_SQL('ALTER SESSION SET SQL_TRACE=TRUE');
    return(1);
    Also, I enable system level trace to capture anything and everything that is being fired into DB from reports.
    I tried,
    ksh rwthinclient.sh report=$REPORT_FILE_PATH/Journal.rdf server=$REPORT_SERVER userid=$ORAUSERID/$ORAPASSWD@$REPORT_DATABASE destype=cache desformat=pdf TRACEFILE=ver1.trc TRACEOPTS=trace_all TRACEMODE=trace_replace RUN_DATE=$CurDate;
    I do not get trace at all. Kindly help me out.

    Hi,
    Maybe have a look at this MOS note: Running SQL*Trace on an Applications Report [ID 1019231.6]
    Regards Peter

  • SQL Query involved to Generate the reports

    Hi,
    I have created Vendor report which internally refers two tables from the vendor and store table (Both the tables are not directly Joined each other)
    i want to see the SQL Query involved to generate the report.
    where can i see that?
    Regards,
    Prasanthi

    in nqquery.log file:
    10g -> $BI_ORACLE_HOME/server/Log
    11g -> $ORACLE_INSTANCE/diagnostics/logs/OracleBIServerComponent/coreapplication_obis1

  • Error while generating the report on Test env (for divide condition)

    Hi All,
    I am facing the below error while generating the report in test environment while the same report is working fine on Prod environment.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression. [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression. [nQSError: 16015] SQL statement execution failed. (HY000)
    Actually the error is coming for the below logics:
    COUNT(DISTINCT RMA.RMA)/COUNT(DISTINCT User."User Name")
    "RMA Fact"."Module Backlog"/COUNT(DISTINCT User."User Name")
    Can anyone please tell if I need to make any configuration changes as the same logic works perfectly fine on production but not on test.
    Thanks in advance

    Is anyone having any idea about it...

  • How to generate jasper report in pdf format using swing

    hi all,
    im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
    1)delegate:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
    return generateReportDto;
    2)sessionBean:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    //Map parameters = new HashMap();
    ReportManager reportManager = new ReportManager();
    3)ReportManager()
    public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
              Connection conn = null;
              try {
                   conn = dataSource.getConnection();
                   //Generate the report to bytes
                   File reportFile = new File(fileName);               
                   byte[] bytes =
                        JasperRunManager.runReportToPdf(
                             reportFile.getPath(),
                             parameters,
                             conn
              //conn.close();
              //Write the bytes to a file
              ByteBuffer buf = ByteBuffer.wrap(bytes);
              File file = new File(outputFileName);
              // (if the file exists)
              boolean append = false;
              // Create a writable file channel
              FileChannel wChannel = new FileOutputStream(file, append).getChannel();
              // Write the ByteBuffer contents; the bytes between the ByteBuffer's
              // position and the limit is written to the file
              wChannel.write(buf);
              // Close the file
              wChannel.close();
              } finally {
                   if (conn != null) {
    conn.close();
    Any help would be highly appreciated. Thanks in advance

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

  • SQL Server 2000 std Report Performance Issue

    Dear All,
    I have a VB based desktop application with back end MS SQL server 2000 database with server machine ibmx5650 with specs intel xeon 2.7GHz (24 CPU's) & 24GB RAM.
    There are two things i need help:
    Recently we have upgrade the SQL server from 2000 personal edition to the 2000 standard edition. There comes a problem with one of the Report in the application. The report took almost 30 mins previously in SQL 2000 personal edition.But after the upgrade
     to Standard edition we are unable to view report before 3 hours even sometimes it doesn't appear after several hours.
    Secondly for brief testing i have installed the personal edition on a simple PC rather then a server PC specs are corei5 & 4 GB of RAM. The same report is generated in only 15 mins from the application with this desktop machine as DB server.
    Please help me out i have gone through all SQL Server & system performance log of my server machine everything is normal but the report is taking too long & i can only generate that report from personal edition.
    Is there the difference due the higher corei5 processor in desktop machine or there is any other issue behind this.
    Your prompt response is highly appreciated.
    Regards,
    Rashid Ali

    Hello,
    SQL Server 2000 is not support since 2013. Please upgrade to SQL Server 2012 to get better performance and support.
    Thanks for your understanding and support.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Problem Generating a Report by passing a Resultset as a datasource

    I am having troubles generating a report using CR for Eclipse 2.0.
    I used the example that shows how do a simple select SQL query to the database and pass the resultset from the query to the report to generate a report from here: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201084dc-be66-2b10-64bf-dde4970c9b90
    I used a simple rpt file that simply shows the content of two columns from a table: TXN_TYPE_CD and TXN_STATUS_CD from a POLICY_TXN table.
    Using the code above, and just modifying it a bit to include my jdbc connection details as well as my select query, I was able to view the report which populated data from my database (Oracle 10g) at runtime of the application.  This test proved positive.
    However, the problem I am having is that I am trying to make this code into a Servlet for use in a Java EE application running on Websphere 6.1.0.17 using JVM 1.5.0_15  64-bit.  Instead of using the DHTML thick client, I export to PDF.  When I do this, the crystal report shows as a PDF, but the data is missing for some reason.  Only the headers for the two db columns are shown.  I don't see any startling differences between the code and am 100% positive that my resultset is being returned with data (I output the data returned in the result set as shown in the code).
    Here is the code I am using:
    public class CrystalReportGeneratorServlet_WOW extends Servlet {
         private static final long serialVersionUID = 768970549082466125L;
         protected HttpSession session;
         private final String EXPORT_FILE = "myExportedReport.pdf";
         private final String CUSTOM_PATH = "/custom/resource/crystalReport/";
         private String REPORT_NAME;
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException {
              Properties loParms = new Properties();
              ResultSet resultSet = null;
              //Obtain current JDBC Connection
              Connection loConn = AppEnvironment.getJDBCConnection();
              Statement statement = null;
              try {
                   REPORT_NAME = "Test.rpt";
                   //Open report
                   ReportClientDocument reportClientDoc = new ReportClientDocument();
                   reportClientDoc.open(SystemConfig.getAppHome() + CUSTOM_PATH + REPORT_NAME, 0);
                   //Create SQL query.    
                   String query = "SELECT \"POLICY_TXN\".\"TXN_TYPE_CD\", \"POLICY_TXN\".\"TXN_STATUS_CD\"" + "FROM   \"POLICY_TXN\"";
                   //Query database and obtain the Resultset that will be pushed into the report.  
                   statement = loConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                   //Execute query and return result set.
                   resultSet = statement.executeQuery(query);
                   //Look up existing table in the report to set the datasource for and obtain its alias.  This table must
                   //have the same schema as the Resultset that is being pushed in at runtime.  The table could be created
                   //from a Field Definition File, a Command Object, or regular database table.  As long the Resultset
                   //schema has the same field names and types, then the Resultset can be used as the datasource for the table.
                   String tableAlias = reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();
                   /////TESTING: OUTPUT contents of resultSet
                   while (resultSet.next()) {
                        System.out.println("TXN_STATUS_CD = " + resultSet.getString("TXN_STATUS_CD"));
                        System.out.println("TXN_TYPE_CD = " + resultSet.getString("TXN_TYPE_CD"));
                   //Push the Java ResultSet into the report.  This will then be the datasource of the report.
                   DatabaseController dbc = reportClientDoc.getDatabaseController();
                   dbc.setDataSource(resultSet, tableAlias , "resultsetTable");
                   //Export to PDF
                   ExportToPDF(reportClientDoc, response);
              catch(ReportSDKException ex) {     
                   System.out.println(ex);
              catch(Exception ex) {
                   System.out.println(ex);               
              } finally {
                   try {
                        resultSet.close();
                   } catch (SQLException e) {
                             e.printStackTrace();
                        } finally {
                             AppEnvironment.returnStatement(statement);
                             AppEnvironment.returnConnection ( loConn ) ;
         private void ExportToPDF(ReportClientDocument rcd, HttpServletResponse response)
              try {
                   ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)rcd.getPrintOutputController().export(ReportExportFormat.PDF);
                   rcd.close();
                   writeToBrowser(byteArrayInputStream, response, "application/pdf", EXPORT_FILE);
              catch(ReportSDKException ex) {
                   System.out.println(ex);
              catch(Exception ex) {
                   System.out.println(ex);
         * Utility method that demonstrates how to write an input stream to the server's local file system.
         private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse response, String mimetype, String exportFile) throws Exception {
              //Create a byte[] the same size as the exported ByteArrayInputStream.
              byte[] buffer = new byte[byteArrayInputStream.available()];
              int bytesRead = 0;
              try{
                   //Set response headers to indicate mime type and inline file.
                   response.setHeader("Content-disposition", "inline;filename=" + exportFile);
                   response.setContentType(mimetype);
                   //Stream the byte array to the client.
                   while((bytesRead = byteArrayInputStream.read(buffer)) != -1) {
                   response.getOutputStream().write(buffer, 0, bytesRead);
                   //Flush and close the output stream.
                   response.getOutputStream().flush();
                   response.getOutputStream().close();
              } catch (Exception e){
                        e.printStackTrace();
         public static Servlet getInstance()
            return new CrystalReportGeneratorServlet_WOW();
    Any help would greatly be appreciated.

    Actually Uzair I came across this thread in trying to find a resolution to my problem.  I was wondering if you were able to resolve this issue as it appears as though I may have the same problem.
    Thanks.

  • Generate PDF report with HTML data

    Hi All,
    I am using BI Publisher to generate my reports but I stumbled on a big problem...
    I have a table with a column TASK_DESCRIPTION. This column is a CLOB containing a simple HTML coded page. When a user works with the application he sees a nicely formatted page but when I generate a report I get all the html tags in it (< html > < h4 > ...etc...)
    Is it possible to somehow convert the source data from the table (which is html code) into readable formatted text when generating the report?
    ANY ideas are very welcome!
    Regards,
    Pawel.

    Yes you can do this with an XSL template converting HTML to Formatting objects.
    There are a few catches however. First, you must be sure your markup-fragment is valid XHTML, that is all tags must be closed. Luckily the builtin standard HTML-editor does this.
    I wasn't able to call BI-publisher from within Apex without the XHTML-fragment being escaped, but i managed to create a query on a table containing the fragment within BI-publisher itself. This leaves the fragment intact, producing a valid XML-document.
    This is very important because the XSL attached to the RTF-template must be able to match and convert the XHTML-tags to FO.
    Basic setup :
    Create a datasource (query) within BIP.
    Create the RTF-template and add an extra field (at the top) containing : <?import:file:///C:\xhtml-to-xslfo.xsl?> or whatever location the XSL-file resides.
    Now, layout your report using the wizard and change the field containing the XHTML-fragment into <xsl:apply-templates select="TASK_DESRIPTION"/>
    There are a few XSL-templates out there converting XHTML to FO. One I found particularly useful : http://www.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
    You might want to change the .xsl so it matches tags case insensitive (eg. <xsl:template match="a|A"> )
    Another caveat is the html-entities for special characters. When the XML from the datasource is parsed by BIP it doesn't recognise entities like &Agrave ; .
    This can be solved by creating a pl/sql function converting these characters to numeric entities like &#192 ;. and use this function in the select statement of your datasource. see http://www.w3schools.com/tags/ref_entities.asp
    Now you can call the report from Apex using an URL to the report definiton (see BIP docs for URL syntax and parameter passing)
    Not a 'really' integrated solution but I had some nice results.
    It would be nice though if we could specify a .dtd containing the references for HTML-entities and a sort of flag wheter the report column should be escaped or not, from within Apex. This would allow us to embed XML-fragments within the XML that Apex produces, resulting in a valid XML doc. Using XSL, you can then match the tags of the XML-fragment and convert it to FO.
    Good luck !
    Maarten

  • How to generate a report in swing

    Hi
    I Would like to generate a report in the following formate. Could you please help me By providing some Sample code.
              BOSCO COLLEGE LIBRARY
                Book Details
    BookID | Book Name |  Book Author| Refrence/Non Reference
    ---------------------------------------------------------here the details should come from the Database.
    Thank you very much

    hi
    i tried out your idea, It is working well But here with me the Problem is I am not able to align the Page with in the A4 Sheet and then Roport Heading is shown at the CENTER on the Screen But while Printing at the Papar it is going to the Top Right Corner. Here i am posting My code please check it and give me Solution for it
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.util.Vector;
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    import java.io.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.DefaultTableModel;
    public class Report extends JFrame implements Printable, ActionListener{
         JPanel headerPanel,titlePanel,dataPanel,btnPanel,masterPanel;
         String headerStr,titleStr;
         JTable table;
         DefaultTableModel dtm;
         Vector dataVector,temp,colVec;
         JScrollPane scrollPane;
         JLabel headerLabel,titleLabel;
         private JButton btnprint, btncancel;
         private Connection con;
         private Statement st;
         // Founction FOR PRINTING
           public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
            if (page > 0) { /* We have only one page, and 'page' is zero-based */
                return NO_SUCH_PAGE;
            /* User (0,0) is typically outside the imageable area, so we must
             * translate by the X and Y values in the PageFormat to avoid clipping
            Graphics2D g2d = (Graphics2D)g;
            g2d.translate(pf.getImageableX(), pf.getImageableY());
            /* Now print the window and its visible contents */
            masterPanel.printAll(g);
            /* tell the caller that this page is part of the printed document */
            return PAGE_EXISTS;
         public Report(Connection con){
              headerPanel=new JPanel();
              headerPanel.setLayout(new BorderLayout());
              titlePanel=new JPanel();
              titlePanel.setLayout(new BorderLayout());
              dataPanel=new JPanel();
              dataPanel.setLayout(new BorderLayout());
              //you can take dynamic values here..
              headerStr="DON BOSCO SCHOOL LIBRARY";
              this.setSize(750,500);
              titleStr="Book Details";
              //Creating button for print
              btnprint= new JButton("Print");
              btnprint.addActionListener(this);
              btncancel = new JButton("Cancel");
              btncancel.addActionListener(this);
              btnPanel = new JPanel();
              btnPanel.add(btnprint);
              btnPanel.add(btncancel);
              //getContentPane().add(btnPanel,BorderLayout.SOUTH);
              colVec=new Vector();
              dataVector=new Vector();
              headerLabel=new JLabel(headerStr);
              headerLabel.setHorizontalAlignment(SwingConstants.CENTER);
              titleLabel=new JLabel(titleStr);
              titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
              headerPanel.add(headerLabel,BorderLayout.NORTH);
              headerPanel.add(titleLabel,BorderLayout.CENTER);
              table=new JTable();
              //table=new JTable();
              //write your code to get details from database and return in vector if possible
              //I am giving static values here it here
              try
                   st=con.createStatement();
                   ResultSet rs=st.executeQuery("Select * from Books");
                   ResultSetMetaData md= rs.getMetaData();
                   int columns =md.getColumnCount();
                   String booktblheading[]={"BOOK ID","BOOK NAME","AUTHOR","REFERENCE","CATEGORY"};
                   for(int i=1; i<= booktblheading.length;i++)
                        colVec.addElement(booktblheading[i-1]);
                   while(rs.next())
                        Vector row = new Vector(columns);
                        for(int i=1;i<=columns;i++)
                             row.addElement(rs.getObject(i));
                        dataVector.addElement(row);
                   ((DefaultTableModel)table.getModel()).setDataVector(dataVector,colVec);
                   rs.close();
                   st.close();
              catch(Exception e)
                   System.out.println(e);
              /**dtm=new DefaultTableModel();
              dtm.setDataVector(dataVector,colVec);*/
              table.setShowHorizontalLines(false);
              table.setEnabled(false);
              table.getTableHeader().setBackground(Color.WHITE);
              scrollPane=new JScrollPane(table);
              scrollPane.setAutoscrolls(false);
              masterPanel = new JPanel();
              dataPanel.add(scrollPane,BorderLayout.CENTER);
              dataPanel.setPreferredSize(scrollPane.getPreferredSize());
              dataPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
              getContentPane().setPreferredSize(new Dimension(750,500));
              getContentPane().setLayout(new BorderLayout());
              headerPanel.setBackground(Color.WHITE);
              dataPanel.setBackground(Color.WHITE);
              masterPanel.setLayout(new BorderLayout());
              masterPanel.add(headerPanel,BorderLayout.NORTH);
              masterPanel.add(dataPanel,BorderLayout.CENTER);
              getContentPane().add(masterPanel,BorderLayout.CENTER);
              //getContentPane().setBackground(Color.WHITE);
              getContentPane().add(btnPanel,BorderLayout.SOUTH);
              pack();
              setVisible(true);
    public void actionPerformed(ActionEvent ae)
         Object obj = ae.getSource();
         if(obj==btnprint)
              PrinterJob job = PrinterJob.getPrinterJob();
                  job.setPrintable(this);
                  boolean ok = job.printDialog();
                  if (ok)
                      try {
                           job.print();
                   catch (PrinterException ex)
                            /* The job did not successfully complete */
         else if(obj== btncancel)
              setVisible (false);
              dispose();
    }Thank you very much

  • How to generate a report in pdf from a stored proc

    Hi, i need guidance on how to generate a report in pdf from an oracle stored proc.
    The environment is oracle 10gas + 10gdb.
    On a specific event, a PL/SQL stored procedure is called to do some processing and at the end of the processing to generate report which has to be sent to the printer (and optionally previewed by the user).
    Can anyone assist me with this?

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

  • How to run multiple sqls in one jasper report

    Hello!
    Is there any one that can help me in integrating/ viewing my xml file to the web. I have my GUI in jsp format, the jsp makes a call to the bean class and then finally bean class hit my reports java class.The report java class generates the report and shows it in the new window.
    The problem is with writing mutiple sql queries and showing the result from multiple sql queires in one report.
    I do not know how to write multiple queries for just 1 report. I can give a simple example of my problem also.
    My report is as follows:
    First Name Middle Name Last name
    Sandeep               Pathak
    Now First and Middle Name come from 1st sql query and Last Name comes from 2nd sql query.
    I want to join the result obtained from both the sql queries in one Jasper Report (not as 2 separate sections but as one section).
    My problem is how to view my report in the web. furthermore, how to make complex query in jasperassistant, like multiple table in one query, because i�m integrating multiple query in one form or sheets of paper.
    Please help me in this.
    Thanks
    Sandeep
    Calance
    India

    Hi Sheldon,
    we never have issues when we combine standard objects, like a cliear with a load inforprovider, or the master data integration you mentioned in your document. However, from the moment we combine a script logic with a standard package (like a move) it does not work .The data package contains the task needed for the script and for the move. the process chain is called up but always comes in error in the first step (BPC modify dynamically ) ... there is also no log when checking the view status ...
    I can sent you some screenshots if you like ...
    D

  • How to generate a report from stored procedure

    I would like to generate a report from stored procedure.
    I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure.
    The resule can be displayed on the development IDE, like sql developer or consume by Java JDBC client.
    is there equivalent way to do this in Oracle stored procedure?

    Hi,
    What type of report you are looking..for.. ??
    As you said that "I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure. "
    When you execute it will return the result set and you will display directly on the FrontEnd.. Is my Understanding is correct Up to here.
    See, In oracle you have call some custom stored procedures as you did in SQL Sever, but you have return the Results Sets, with help of Out put paramter, Either Cursors or Varrays..
    or Else you can generate the Html reports based on your requirement, HTML can be used in the stored procedures of Oracle which will generate for your, you need to code it.
    I could not able get the relevant link for your reference.
    I will get back to you on this.
    - Pavan Kumar N

Maybe you are looking for

  • ABAP Debug Mode in SAP and webMethods

    HI, Can anyone help resolve why I am receiving this message when I set the ABAP debug mode to yes on the SAP server? com.sap.mw.jco.JCO$Exception: (105) ERROR_NO_DIALOG_USER: ERROR_NO_DIALOG

  • What does the code mean? not the security code the other one?

    im siging up for the Apple ID and I'm doing my visa card and it's telling me something about a code for iTunes? I dont know how I get the code, or its on my card?

  • Participating in the CinemaDNG Initiative

    Over fifty companies are now participating in the CinemaDNG Initiative. Most recently we met at NAB 2010. Adobe continues to engage partners to join the CinemaDNG Initiative. Critical for the success of the CinemaDNG Initiative is the active particip

  • I want to install ZCM 11 : unable to update primary server

    According to ZCC "Last Contact" 8/17/11 Host Name: zcm1as2 IP Address 10.39.0.15 Last Full Refresh: 8/17/11 Last Contact: 8/17/11 ZCM Version: 10.3.0.0 ZCM Agent Verson: 10.3.0.27649 OS: Microsoft Windows Server 2008 R2 Enterprise Edition (full insta

  • IPhone5 won't connect to iTunes

    Visited the Apple store today and got my broken iPhone5 replaced. They gave me a new iPhone5. The iPhone5 connects to my computer (shows it charging) but does not appear in iTunes. I need to restore my backup onto this phone. I've restarted the compu