Column headers in SQLPLUS query

Hi I am running a simple SQL query in SQLPLUS, and I want the column headers to appear just once at the top.
If I set the 'SET PAGESIZE' to 50000 (which I thought was the max) it repeats the column headers evert 50000 lines.
If I set 'SET PAGESIZE 50001', the column header appears every 14 lines
Anyone help ?
Thanks
Mike
Here is my SQLPLUS statement
SET HEADING ON
SET PAGESIZE 50001
SET LINESIZE 80
SET TERMOUT OFF
SET VERIFY OFF
SET FEEDBACK OFF
SET TRIMS OFF
SET COLSEP "|"
SET CONCAT "."
SET CONCAT "!"
set newpage none
set underline off
SPOOL &1
column Product format a4
column Division format a3
column Company format a4
column Geography format a4
column Customer format a12
column Currency format a3
column Year format a4
column Account format a7
column Period format a3
SELECT /*+ index(GB,GL_BALANCES_N2) */
'P'||GCC.SEGMENT8 Product,
'D'||GCC.SEGMENT4 Division,
'C'||GCC.SEGMENT1 Company,
'G'||GCC.SEGMENT5 Geography,
'G'||GCC.SEGMENT7 Customer,
'&2' Currency,
'FY'||substr(GB.PERIOD_NAME,5,2) Year,
'A'||GCC.SEGMENT2 Account,
substr(GB.PERIOD_NAME, 1, 3) Period,
trim(to_char(SUM((NVL(GB.PERIOD_NET_DR,0)-NVL(GB.PERIOD_NET_CR,0))*DECODE(SUBSTR(GCC.SEGMENT2,1,1),'4',(-1),1)),'999999999990.99')) VALUE
FROM
GL.GL_BALANCES GB,
GL.GL_CODE_COMBINATIONS GCC
WHERE GCC.CHART_OF_ACCOUNTS_ID=101
AND GB.CODE_COMBINATION_ID=GCC.CODE_COMBINATION_ID
AND GB.SET_OF_BOOKS_ID = &3
AND GB.ACTUAL_FLAG = 'A'
AND GB.CURRENCY_CODE = '&2'
AND GCC.SEGMENT2 BETWEEN '400000' AND '999999'
AND NOT (GCC.SEGMENT2 BETWEEN '899501' AND '899506')
AND GCC.SEGMENT2 != '899999'
AND GB.PERIOD_NAME in &4
GROUP BY
'P'||GCC.SEGMENT8,
'D'||GCC.SEGMENT4,
'C'||GCC.SEGMENT1,
'G'||GCC.SEGMENT5,
'G'||GCC.SEGMENT7,
'&2',
'FY'||substr(GB.PERIOD_NAME,5,2),
'A'||GCC.SEGMENT2,
substr(GB.PERIOD_NAME, 1, 3)
HAVING SUM(NVL(GB.PERIOD_NET_DR,0)) - SUM(NVL(GB.PERIOD_NET_CR,0)) <> 0
ORDER BY
'P'||GCC.SEGMENT8,
'D'||GCC.SEGMENT4,
'C'||GCC.SEGMENT1,
'G'||GCC.SEGMENT5,
'G'||GCC.SEGMENT7,
'&2',
'FY'||substr(GB.PERIOD_NAME,5,2),
'A'||GCC.SEGMENT2,
substr(GB.PERIOD_NAME, 1, 3);
spool off
exit

Hi,
Ranzalman wrote:
Hi I am running a simple SQL query in SQLPLUS, and I want the column headers to appear just once at the top.
If I set the 'SET PAGESIZE' to 50000 (which I thought was the max) it repeats the column headers evert 50000 lines.
If I set 'SET PAGESIZE 50001', the column header appears every 14 linesApparantly, 50,000 lines is the max. If you try to set PEGESIZE higher than that, you get the default, which is 14.
The best thing might be to SET PAGESIZE 0, which turns off paging. Unfortunately, that turns off the automatic headers, too, so you'll have to supply your own header, manually, like this:
SPOOL  &1
SET   PAGESIZE    0
PROMPT  PROD|DIV|COMP|GEOG|CUSTOMER    |CUR|YEAR|ACCOUNT|PER|VALUE
SELECT /*+ index(GB,GL_BALANCES_N2) */
...

Similar Messages

  • Column Headers of Masterdata Query

    Hello experts,
    in a Masterdata Query based on an InfoObject there are many Attributes.
    These Attributes are now listed in the Rows of the Query:
    InfoObject
    Attribut 1
    Attribut 2
    Attribut 3
    Therefore the Query will look like this:
    InfoObject        Attribut 1      Attribut 2     Attribut 3    
    Company A     New York     USA            Industry
    Company B     Toronto         Canada       Healthcare
    Company C     Mexico City   Mexico        Industry
    Now the problem is, that the real column headers are very long (60 chars) and therefore the column with is too wide so that the report shown in Web Reporting is far too wide.
    Question: How can the column header be separated into 2 or more lines so that each column will not be so wide?
    I know that this can be done with Keyfigure-Column-Headers .... unfortunately the report is based on Attributes (chars) of the InfoObject and not on Keyfiugres.
    Thank you for your help!
    Angie

    The following did the trick for the header lines only:
    Note 1292696 - Analysis modification: Fixed column width and line break
                                <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" >
                                    <bi:MOD_GENERIC_MODULE type="COMPOSITE" >
                                        <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" />
                                        <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" >
                                            <bi:MOD_PARAMETER type="COMPOSITE" index="1" >
                                                <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" />
                                                <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" >
                                                    <bi:INTEGER value="75" />
                                                </bi:MOD_PARAM_VALUE>
                                                &lt;
                                            </bi:MOD_PARAMETER>
                                            <bi:MOD_PARAMETER type="COMPOSITE" index="2" >
                                                <bi:MOD_PARAM_NAME value="WRAPPING" />
                                                <bi:MOD_PARAM_VALUE type="CHOICE" value="BOOLEAN" >
                                                    <bi:BOOLEAN value="X" />
                                                </bi:MOD_PARAM_VALUE>
                                            </bi:MOD_PARAMETER>
                                        </bi:MOD_PARAMETER_LIST>
                                    </bi:MOD_GENERIC_MODULE>
                                </bi:MOD_SELECT>
                            </bi:MOD_SINGLE_MODULE>
                        </bi:MODIFICATION>

  • Displaying dates as column headers for BEx Query

    Hi all,
    I have to display dates in sequence as descriptions for 15 columns based on the keyed in date in Bex Query Analyser. I'm able to display date as column heading for one column using text variable with replacement path.I could not able to increment date for other descriptions.Could you please help me to solve this issue.
    Ex: Input Date 05/09/2007 then in the out put column headers should be 0509 0609    0709   ............ 1909
    These are only column headers, values for the columns are quantities calculated using formulas.
    It is urgent.
    Thanks in advance.
    Regards,
    Mandadi.

    hi mandadi,
    if u want dates as headers only then u should use a text variable .
    as a rule u can not set off set for text variable so u create restricted key figure with date restricted and set off set.
    now u use this rkf to populate the text variable using replacement path.
    text variable can use replacement path for replacing from any variable and characteristics.
    bye

  • Spooling column headers correctly

    Hi,
    Im trying spooling a file in DB with below mentioned details.
    SET SERVEROUTPUT OFF
    set heading on
    SET PAUSE OFF
    SET FEED OFF
    SET PAGES 0
    SET LINE 5000
    SET VERI OFF
    SET TERM OFF
    SET TERMOUT OFF
    SET TIME OFF
    SET UNDERLINE OFF
    SET COLSEP ','
    SET ECHO OFF
    SET TRIM ON
    SET TRIMOUT ON
    SET TRIMSPOOL ON
    set newpage none
    spool ${OUTPUT_PATH}/${REPORT_NAME}/${REPORT}_${START_DATE}.csv
    @${SCRIPT_PATH}/${REPORT_NAME}/my_query.sql
    spool off
    exit;
    EOF
    file .sql has 20 odd columns.
    When file is spooled, it shows no columns headers at the top, why is it happening, I dont want to spool column headers separately.

    but is it possible to change the format of multiple columns in one goNo, not possible. You will have to write 20 column format <column_names> A<N> for all the required columns. Here column name and column alias both are same i.e. column format command works same for column alias.
    also tell me one thinng why "set heading on" does not work with "set pagesize 0"?The best thing might be to SET PAGESIZE 0, which turns off paging. Unfortunately, that turns off the automatic headers, too, so you'll have to supply your own header, manually, like this:
    Frank @ Column headers in SQLPLUS query

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • Incomplete List of Values in Interactive Report Column Headers

    Oracle Database 11g 64-bit
    Apex 3.1.1.00.09
    I created an interactive report that results in over 10,000 records, and several of the columns have incomplete filter values when you click on the column header. It's not even close in some instances. It's not even showing the values that are loaded in the visible page.
    I have tried recreating the report on a new page, as well as creating a database view with the query and then just querying the view (in case there was a problem with query complexity).
    I'm at my wits end as to why this is happening. Have any of you seen this happen, and is there any way to get around it? I know I can write my own LOV query for the column headers, but those won't be dynamic like they are supposed to be out of the box taking applied filters into account.
    Thanks in advance.

    Tim,
    Did you find a solution to this. I have the same problem.
    Cheers
    Yog

  • Dates in column headers based on passed-in parameters

    I am trying to display a query that views performance data for a specified time range, with one day per column and the day's notation ('MON-DD') in the column header. Instead of giving myself a nightmarish query with a variable number of columns, I am starting with just 2 weeks worth and using DATE, DATE-1, DATE-2, etc. to derive the column data.
    I can get everything to display just fine if I use SYSDATE, or just DATE, but I can't seem to figure out how to use DATE -1, etc. in the column headers. I have even tried creating hidden page items to calculate DATE -1 and referencing those in the column headers, but while the references work fine, the calculations error out. Again, the data is fine, it is just the column headers I am struggling with.
    Thanks for any ideas.

    The SYSDATE - 1, SYDATE -2 works great in the report I have that goes back two weeks from the current day. The one I am stuck on is an alternate version of the report where I need it to go back 2 weeks from a date I let the user supply. This is the part that is killing me. SYSDATE -1 etc, processes just fine, but I can't figure out the syntax, etc. for using a page item instead of a constant/predefined SQL query.
    The posted idea is also what I currently use in the working report and is brilliant. What I can't seem to get figured out is how to populate the hidden items with calculated values based on a page item (the passed in date).

  • Format Column Header in Crosstab Query in Crystal Reports for Enterprise

    Hi
    I am using Crystal reports for Enterprise and I would like to format the Column header of a crosstab query one block of colour say light blue.  However I cannot select the header in isolation to the rest of the cross tab.  All I can select is either column text boxes, which doesnu2019t look good formatted as a different colour to the background of the crosstab.  Or I can only select either entire column or the entire row, which kind of defeats the object of formatting just the column header itself.  Is there a way to isolate the column headers so I can format just the header, as the report is looking extremely bland all in white?
    Many Thanks in advance
    Regards
    Neil

    Alright, here's what you need to do:
    1) RIght-click one of the Column Headers and select 'Format Result Object Element' > Appearance > click on the formula button (fx) beside 'Fill' and use this code:
    if currentrowindex < 0 then crBlue
    You wanted light blue right? So, the rgb value for light blue or sky blue would be 135-206-250. So, you can change the color by modifying the formula like this:
    if currentrowindex < 0 then color(135,206,250)
    If this is not the exact blue you're after, just google!
    Hope this helps!
    -Abhilash

  • Display of  Row and Column Headers in NW2004s Bex Analyzer

    Hi all,
    when I open a query with the NW2004s Bex Analyzer (Excel)Frontend <b>Row and Column Headers are not visible</b>. I need to go to <b>"Tools-Options" and check the box  for "Row and Column Headers" which seems to be unchecked by default</b>.
    Is there <b>a possibility to make the Row and Column Headers visible by default when I open a query</b> so that I don't have to use Tools-Options every time.
    Thanks
    Alex

    This is fixed with SP8. The default template doesn't have this specified in SP7. It's a very easy fix. Just specify that the column headers are specified by default. Then save this new workbook as the global workbook template such that all queries use this new template. You can customize this standard template however you like!

  • SQL Developer: How do I copy data with Column Headers from the output grid?

    Hello,
    I am using Version 2.1.1.64.
    I run a SQL query, I get the results grid in the "Query Result" window down below. Say I get 10 rows returned, with 5 columns.
    I want to Copy this entire grid, plus the column headers/names, to the clipboard. So I can paste it under the original query to document the results of that query.
    I can't find any way to do this. I can copy/paste the results grid, but it doesn't copy the headers.
    The only way I see to do it is to go through numerous steps to Export to a TXT file, then paste that. Unfortunately, that is a lot of wasted steps if I need to do this over and over, plus, the output gets pasted in an ugly format with double quotes, etc.
    It seems like the simplest functionality is to copy/paste the entire results grid, and of course you might the headers. Why is this so complicated/impossible to do?
    (I believe Toad has the same problem. DBArtisan allows you to copy/paste the entire results, plus headers, though.)
    Any assistance would be appreciated!
    Thanks,
    John

    Ah, ok...
    I had tried that before, and it didn't work, it seemed to copy the path of filename I was using. But I think that was because I had clicked on a Column Header first, and it had asked me if I wanted to filter. I think then it lost track that it was in the grid. It's a little flukey.
    What I did now was to click on an individual cell in the output, then hit CTRL-A to select all, then hit SHIFT-CTRL-C. That gives me exactly what I want.
    Thanks very much for your quick solution, I appreciate it!
    John

  • Lookup column names with Power Query

    Hi,
    before I go ahead and change source files, I was wondering if I can use Power Query to get a model with the following data. To simplify the example, I have the following dataset in an Excel sheet:
    In another Excel sheet, the column names are defined, for example:
    What would like to have in Power Query is one table with the column names from the second screenshot in column B. Is there a way to link these two tables together in Power Query in order to use these names as column headers in the dataset?
    Thanks!
    - If a post answers your question, please click "Mark As Answer" on that post!

    You can filter the list of renames against the list of actual column names with something like
        FilteredColumns = Table.SelectRows(Columns, each List.Contains(Table.ColumnNames(Source), [Name])),
    Again, the working end-to-end:
    let
    Source = Table.FromRows({{"New York", 23, 51, 732}, {"Chicago", 25, 421, 23}, {"Los Angeles", 632, 22, 423}}, {"City", "Col 1", "Col 2", "Col 3"}),
    Columns = Table.FromRows({{"Col 1", "Column 1"}, {"Col 2", "Column 2"}, {"Col 3", "Column 3"}, {"Col 4", "Column 4"}}, {"Name", "Value"}),
    FilteredColumns = Table.SelectRows(Columns, each List.Contains(Table.ColumnNames(Source), [Name])),
    ColumnsAsRenames = Table.TransformRows(FilteredColumns, Record.FieldValues),
    RenamedColumns = Table.RenameColumns(Source, ColumnsAsRenames)
    in
    RenamedColumns

  • Showing Grid without column headers and Grid lines

    Hi all
    does anyone knows how can set a grid object to display without grid lines and without column headers?
    appreciate the help
    Yoav

    Hi Yechiel,
    When you work with the grid you just have to drag it into your srf and bind it with some table by specifying the table name in its properties.
    When the form launches the columns of the grid  will be created automatically as per the number of columns in the table.The caption of the column in the grid will be the same as that of the name of the column in the table.The only condition for this is that the table should contain some records, if the table is empty no grid lines and the column header will be displayed .
    I hope this meet your requirements.
    Below I am sending you the code segments with the help of which you can control the grid progamatically...
    //Declaring the grid object
    Grid oGrid;
    //Initializing the grid object
    oGrid=(SAPbouiCOM.Grid)oForm.Items.Item("MBS_Grid").Specific;
    //Adding a new data table to the form
    oSboApplication.Forms.ActiveForm.DataSources.DataTables.Add("MBS_DataTable");
    //Assigning the data table to the grid
    oGrid.DataTable = oSboApplication.Forms.ActiveForm.DataSources.DataTables.Item( "MBS_DataTable" );
    // This statement will clear the grid
    oGrid.DataTable.Rows.Clear();
    // In this way you can set the column properties
    oGrid.Columns.Item(0).Editable=false;
    oGrid.Columns.Item(1).Editable=false;
    oGrid.Columns.Item(2).Editable=false;
    oGrid.Columns.Item(3).Editable=false;
    oGrid.Columns.Item(4).Editable=false;
    oGrid.Columns.Item(5).Editable=false;
    // In this way you can set the column width
    oGrid.Columns.Item( 0 ).Width = 50;
    oGrid.Columns.Item( 1 ).Width = 60;
    oGrid.Columns.Item( 2 ).Width = 130;
    //This is the way you can set a user defined caption on the column header.
    query="select U_CTX_MOVCODE as 'Movie Code',U_CTX_MOVNAME as 'Movie Name',U_CTX_SHELF as 'Shelf Number',U_CTX_SPACE as 'Space Number',U_CTX_CARDCODE as 'Customer Code',U_CTX_RENTED as 'Rent Status' from [@CTX_VSTORE] order by Code";
    Regards,
    Prashant

  • How to set column size in sqlplus.exe ?

    SQL> select * from dba_cons_columns where user='USER1' and table_name='PARENT1';
    OWNER                          CONSTRAINT_NAME
    TABLE_NAME
    COLUMN_NAME
      POSITION
    USER1                          PARENT1_PK
    PARENT1
    COL2
             2
    OWNER                          CONSTRAINT_NAME
    TABLE_NAME
    COLUMN_NAME
      POSITION
    USER1                          PARENT1_PK
    PARENT1
    COL1
             1doesn't it seems bit ugly to see these data.Why length of columns is so long ?please tell how to set the length of columns and other parameters so that data that is displayed should come out in screen in a well managed and beautiful way.
    Like this:
    OWNER     CONSTRAINT_NAME     TABLE_NAME       COLUMN_NAME   POSITION
    USER1        PARENT1_PK              PARENT1             COL2                  2
    USER1        PARENT1_PK              PARENT1             COL1                  1I have written this by hand. How to get display in sqlplus.exe ?

    This command sets column size for all forthcoming commands. Suppose there is select command for different columns, and i want to set different size for different columns. e.g.,select name,address,zone from table1;
    How can i set column size for name to (say) 20 char, address to 30 char and zone to 3 char ?
    You need to do it in some sort of sql script which would set the column formatting before the query would start and then would clear the formatting after the query gets finished. See an example below,
    SQL> column ename format a20 heading emp_name
    SQL> select ename from emp
      2  ;
    emp_name
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    emp_name
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> column ename clear
    SQL> select ename from emp;
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL>So likehtis you have to format all the columns on individual lines and then clear the fomattings of each once th query isdone.
    HTH
    Aman....

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unable to turn column headers bold in Word table using VB Script

    I have created a table in Microsoft Word 2010 using VB Script (this is via the script engine that forms part of HP Quality Centre functionality).  The table itself is OK, 2 columns with centred headers.  However, I am unable to make the column
    headers bold.  I have spent hours searching the net and trying various options to no avail can somebody please help me.
    Set objWord = CreateObject("Word.Application")
    Set objDocument = objword.Documents.Open(Src_Dir & template_file
    Const wdAlignParagraphCenter = 1'var to control justification of the table columns
    Const NUMBER_OF_ROWS = 1 'number of rows in intial table
    Const NUMBER_OF_COLUMNS = 2 'number of colums in the intitial table
    'search for the "TAA_TABLE" bookmark embedded in the document template, this is where the table will be created
    Set objRange=objDocument.Bookmarks("TAA_TABLE").Range
    'create the table
    objDocument.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
    Set objTable = objDocument.Tables(2)
    'populate column headers
    objTable.Cell(1, 1).Range.Font.Bold = True
    objTable.Cell(1, 1).Range.Text = "Sub Contractor"
    objTable.Cell(1, 2).Range.text = "TAA Number"
    'centre the column headers
    objDocument.Tables(2).Rows(1).Select
    Set objSelection = objWord.Selection
    objSelection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    'format the table with plain grid lines
    objTable.AutoFormat(16)
    'set the column widths
    objTable.Columns(1).Setwidth 230,0
    objTable.Columns(2).Setwidth 230,0
    Any help is graetfully appreciated, as this is driving me wild.
    Cheers,

    Hi Citronax,
    I haved noticed that you used objTable.AutoFormat to format the table. Based on my understanding, this fuction will applie a predefined look to a table.
    After I move the code which bolder the text behind this line of code, it works well for me.
    'format the table with plain grid lines
    objTable.AutoFormat (16)
    objTable.Cell(1, 1).Range.Font.Bold = True
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • How to add a button in the view at a specific position

    Hi Gurus, We have a requirement : To add a button or image at a specific position in the view which is like an indicator showing different color based on another field . Example : Adding a button next to a drop down flield and changing the color of t

  • Data present in  internal table, now how to open it in PDF format

    Dear Friends, my Scenario is.. I have uploaded a pdf file in my database table through  GUI_UPLOAD. It is uploaded. Now when user click on some button then that file should be displayed again in pdf format directly. (No download to user PC using GUI_

  • Receive email attchmnt, store in SAP & link to PO

    Hi Experts, We have a requirement to convert PO to PDF and send it as an e-mail attachment which is possible . But the requirement is to add digital signature to the PO and  send it as E-mail attachment. Also once vendor confirms and signs the same d

  • Cannot trim a clip in Media Import window.

    Cannot trim a clip in the Media Import window once I copy the file to my desktop or external drive. However, I can trim the same clip from the original that is on an SD card. I get no "double arrow" icons but do see the entire clip highlighted with t

  • Mac Mini Server Backups

    Dear all, I am using a Mac Mini Server for filesharing, iCal, etc. I want to make sure all data is safe, so I want regular backups. The Mac Mini Server is set up to work on Disk 1 and backup on Disk 2. But in case the server is stolen, crashes or som