Changing font of txt depending on query result

Hi guys,
I have a report in which a column in that report will bring back a value of either yes or no. What I want to do is if the column returns yes I then want to make this field and the text used for the column header appear in capitals and bold. Is there a way to do this iin reports and if so how would I go about doing this. Any help on this would be greatly appreciated.
Thank you.

Hi!
You can use SRW and format trigger.
Example in a format trigger:
if (:column_1 = 'yes')
then
srw.set_foreground_border_color('black');
srw.set_border_pattern('solid');
srw.set_foreground_fill_color('gray12');
srw.set_fill_pattern('solid');
srw.set_font_face('Courier New');
srw.set_font_size(7);
srw.set_font_weight(srw.bold_weight);
srw.set_font_style(srw.plain_style);
end if;
more info on SRW: http://docs.oracle.com/html/A73172_01/output/bawor_co.htm

Similar Messages

  • Change cell color of query results,font size,style

    Change cell color of query results,font size,style
    Hello
    I have this code below and I want to know if it is possible
    to make the column header a font style different
    Example:
    Font size =12
    Verdena
    blue
    And the cell of the column name a different color for ex
    Yellow
    Can this be done here and where in this code do I put it??
    Thank you so much
    <cfquery name="gelov datasource="kl90">
    SELECT
    FROM
    WHERE
    ORDER BY
    <cfswitch expression="#Form.orderBy#">
    <cfks value="KSNUMBER">
    KS.KS_NBR
    </cfks>
    <cfks value="CREATIONDATE">
    KS.KREATDAT
    </cfks>
    </cfswitch>
    </cfquery>
    <!---html report--->
    <cfswitch expression="#Form.outputFormat#">
    <cfks value="HTML">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Ctwye Kss Report</title>
    </head>
    <style type="text/css">
    table{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    td{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    h2{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    h3{
    font-family:Arial, Helvetica, sans-serif;
    font-size:13px;
    </style>
    <body>
    <cfoutput>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td align="center">
    <h3>Ctwye Kss
    Report</h3><br><br></td>
    </tr>
    <tr>
    <td align="center">
    </h2>report returned #getCtwyeKss.RecordCount#
    records</h2></td>
    </tr>
    <tr>
    <td>
    <table border="1" cellpadding="2" cellspacing="0">
    <tr>
    <td width="160">Ks Number</td>
    <td>K-date</td>
    <!--- <td class="dataField">Address</td>
    <td class="dataField">Type</td>
    <td class="dataField">Description</td>--->
    </tr>
    <cfloop query="getCtwyeKss">
    <tr bgcolor="<cfif currentrow mod
    2>GHOSTWHITE<cfelse>WHITE</cfif>">
    <td>#KS_NBR#</td>
    <td>#dateformat(KREATDAT,"mm/dd/yyyy")#</td>
    </tr>
    </cfloop>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    </cfoutput>
    </cfks>
    <cfks value="CSV">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=ctwye.csv">
    <cfcontent type="application/msexcel">"Ks
    Number","K-date"
    <cfoutput
    query="getCtwyeKss">#ltrim(KS_NBR)#,"#dateformat(KREATDAT,"mm/dd/yyyy")#"
    <tr #IIF(getCtwyeKss.CurrentRow MOD
    2,DE(''),DE('backgroundColor="##999"'))#>
    <!---<tr bgcolor="<cfif currentrow mod
    2>##808080<cfelse>##ffffff</cfif>"> --->
    </cfoutput>
    </cfks>
    </cfswitch>

    By using <TH> instead of <TD> on your header row
    you can then specify different font type and size in your CSS code.
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    I'm guessing this is your header?
    <tr>
    <td width="160">Ks Number</td>
    <td>K-date</td>
    <!--- <td class="dataField">Address</td>
    <td class="dataField">Type</td>
    <td class="dataField">Description</td>--->
    </tr>
    If so, change these <TD> to <TH>
    <tr>
    <th width="160">Ks Number</th>
    <th>K-date</th>
    <!--- <th class="dataField">Address</th>
    <th class="dataField">Type</th>
    <th class="dataField">Description</th>--->
    </tr>

  • How to execute a procedure depending on the result of a query?

    Hello, I'm new in ODI.
    I want to execute a procedure depending on the result of a query Oracle table.
    We have a Oracle Table whit a column that contains two possibles values.
    I want read the table, row by row, and depending on this value, execute a Procedure or execute another.
    How can i do?

    what you need to do is
    1. create a variable which "new_var2" which has the count of the number of rows you want to process. must be data type numeric.
    2. copy "new_var2" to the package screen.
    3. duplicate the "new_var2" on the package screen and evaluate the variable and test for "> 0" zero, call it "new_var2_E"
    3. create a new odi variable "new_var1" with a refresh of "select field1 fom (select field1,rownum as rownumber from tablex) where rownumber = #new_var2" in the relevant schema and technology.
    4. copy "new_var1" into your package (some where in the flow)
    5. right click the "new_var1" variable in you package screen and you should get the option duplicate step (click on that)
    6. select the the duplicate "new_var1" on the package screen and correct the the name to something meaning full to you "new_var1_E", also change the "type" to "evaluate variable" then you should see a "value" box. enter one of the values you want to test in the box (remember do not put in quotes ' )
    7. now back on the package screen join the "new_var1" to the "new_var1_E" with an OK line
    8 you now join "new_var2" to "new_var2_E" with OK
    9 you join "new_var2_E" to "new_var1"
    10. you then join the "new_var1_E" with an OK or a KO line to the relevant procedure.
    12. you need to duplicate "new_var2" in the package screen one more time this time and call it "new_var2_D" set the type to evaluate and then select the increment of -1
    13. the relevant procedure to "new_var2_D" with an OK
    14. join the "new_var2_D" to the "new_var2_E" with an OK
    15. this should close off the loop now the exit point is "new_var2_E" with a KO line to the next part of your process....
    Basically you should end up with a loop on new_var2 decementing, and it is used to get a specific next record row from your table.
    Hope this helps, sorry it is a little long winded..
    Edited by: DavidGD on Feb 8, 2009 3:29 PM

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • Change Font size of Query Title in PDF Output

    Hi Experts
    I want to change font size of Query title when its exported to PDF format .
    I change the text properites     to  Header size 1 ,  but still its not reflected in Output in PDF .
    Any suggestions,
    Regards,
    Jawad

    Hello Jawad,
    Please tell me the solution for this.

  • Export query result to txt file

    Hello,
    I'm trying to export a query result to txt file but I facing some problems.
    I'm using the comand below:
    set echo off newpage 0 space 0 pagesize 0 feed off head off trimspool on
    set colsep ,
    spool C:\estados.txt
    select id_estado,cod_estado,nme_estado from tb_estado;
    spool off
    First problem: My select statement is being writen on my estados.txt
    Second problem: The results are being writen with a lot of blank spaces in start of line, for example, instead of write "1,AC,Acre" the line is write as " 1,AC,Acre".
    Third problem: The "spool off" statement is being written on my estados.txt
    How could I solve it?
    Thanks

    1. Works here - what version of SQL*PLUS are you using?
    2. If you want to prevent spaces, you have to write your SELECT like this:
    select id_estado || ',' || cod_estado || ',' || nme_estado from tb_estado;Note: not tested.
    3. See 1.
    C.

  • Change font size in reports

    Hi friends,
             I want to change the font size in  reports.
    i want example program for that.

    Hi,
    You can create workbook. Change the font size of the displayed result and save it. So every time you open the workbook and refresh the query output, the result will be displayed in the changed font size.
    Regards,
    Dinesh D

  • Can we change font size and font type in reports

    Hi All Technical/Functional Masters,
    We are developing some transactional reports in ISU. this report has 20 columns to be printed. On screen, display is not a problem but client has a requirement to download this report in PDF format and wants to print on A4-paper in Landscape. Although we have managed to accommodate all the columns on A4 paper but have to compromise with font size that are very small and not visible. If we download the report in excel format we are able to maintain the font size 8 and accommodate all columns after little format but same in PDF is a problem.
    Can anyone tell whether we can increase the font size and change font type(from SAP standard to 'Arial') before sending the output in PDF ? Is there any property or utility that can be changed or used for this purpose.

    Function Module : CONVERT_ABAPSPOOLJOB_2_PDF
    Include : THSTXWFPL
      for modify font size
    decrease fontsze foncharacter will increase
    fontsize = 120.     <-- Change
    fontsize = 100.  or fontsize = 80
    Depend on your logon lang. My case logon 'TH' or 2.  I modified font ZCORDIA (refer CordiaNEW thai font)
    if is_cascading is initial.
      case language.
      when '0'. "Serbian
        font = 'COURCYR'.  devtype = 'SAPWIN'.
      when '1'. "simpl.Chinese
        font = 'CNHEI'.    devtype = 'CNSAPWIN'. cjklang = 'X'.
      when '2'. "Thai
      font = 'THDRAFT'.  devtype = 'THPDF'.
       font = 'ZCORDIA'.  devtype = 'ZMTHSWNU'.
        font = 'THANGSAN'.  devtype = 'ZPDFUC'.
      when '3'. "Korean
        font = 'KPSAMMUL'. devtype = 'KPSAPWIN'. cjklang = 'X'.
      when '4'. "Romanian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '5'. "Slovenian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '6'. "Croatian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '8'. "Ukranian
        font = 'COURCYR'.  devtype = 'SAPWIN'.
    Add font Cordia Thai
    SE73 --> Fon familia --> ZCORDIA
    Load Font Cordia thai to system
    SE38 --> RSTXPDF2UC
    load CORDIA.TTF
    SE73 --> printer font --> 'ZMTHSWNU'
    Add ZCORDIA font and copy AFM Metric from = 'THDRAFT'.  devtype = 'THPDF'.
    Modify AFM
    example
    *----- OLD--
    StartFontMetrics 2.0
    sapFamily ZCORDIA
    sapHeight 000
    sapBold false
    sapItalic false
    StartCharMetrics 0183
    WX 0500 ; N space                          ;
    WX 0500 ; N exclam                         ;
    WX 0500 ; N quotedbl                       ;
    WX 0500 ; N numbersign                     ;
    WX 0500 ; N dollar                         ;
    WX 0500 ; N percent                        ;
    WX 0500 ; N ampersand                      ;
    *--NEW--
    StartFontMetrics 2.0
    sapFamily ZCORDIA
    sapHeight 000
    sapBold false
    sapItalic false
    StartCharMetrics 0183
    WX 0375 ; N space                          ;
    WX 0375 ; N exclam                         ;
    WX 0375 ; N quotedbl                       ;
    WX 0375 ; N numbersign                     ;
    WX 0375 ; N dollar                         ;
    WX 0375 ; N percent                        ;
    WX 0375 ; N ampersand                      ;
    Result : decrease space between character.   Then Your PDF will have BIGGER FONT.
    Rdgs,
    Suwatchai

  • SQL Query results to CSV as two worksheets

    I'm trying to take two SQL queries and get the results sent to a CSV file on two worksheets.  Looking online I have not found a solid example of using the Excel ComObject to create a CSV then add a new worksheet to the CSV file.  An added bonus
    would be using AutoFit on the columns so everything is easily visible.
    Code found online got me the following script which does work, however it takes 12 minutes to pipe the SQL queries to Excel.  Switching to a CSV and the script executes in 5 seconds.
    This is another nice to have, I was also looking the best way to look at the results (only 1 column) and depending on the length of the data, insert what Excel would call a Cell thereby shifting cells RIGHT but so far have found no clear examples of how
    to accomplish that.  My guess would be modifying my SQL queries but I've posted a question on StackOverFlow and someone suggested modifying the PowerShell Table created from the SQL dataset.Tables
    Code:
    $docs = "C:\Scripts\Output.xlsx"
    If (Test-Path $docs){Remove-Item $docs}
    Function Run-Query {
    param([string[]]$queries,[string[]]$sheetnames)
    ## - Create an Excel Application instance:
    $xlsObj = New-Object -ComObject Excel.Application
    $xlsObj.DisplayAlerts = $false
    $xlsWb = $xlsobj.Workbooks.Add(1)
    ## - Create new Workbook and Sheet (Visible = 1 / 0 not visible)
    $xlsObj.Visible = 0
    $time = 2
    for ($i = 0; $i -lt $queries.Count; $i++){
    $percentage = $i / $time
    $remaining = New-TimeSpan -Seconds ($time - $i)
    $message = "{0:p0} complete" -f $percentage, $remaining
    Write-Progress -Activity "Creating Daily Reboot Spreadsheet" -status $message -PercentComplete ($percentage * 100)
    $query = $queries[$i]
    $sheetname = $sheetnames[$i]
    $xlsSh = $xlsWb.Worksheets.Add([System.Reflection.Missing]::Value, $xlsWb.Worksheets.Item($xlsWb.Worksheets.Count))
    $xlsSh.Name = $sheetname
    ### SQL query results sent to Excel
    $SQLServer = 'ServerName'
    $Database = 'DataBase'
    ## - Connect to SQL Server using non-SMO class 'System.Data':
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server = $SQLServer; Database = $Database; Integrated Security = True"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $query
    $SqlCmd.Connection = $SqlConnection
    ## - Extract and build the SQL data object '$Table2':
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $SqlConnection.Close()
    $Table1 = $DataSet.Tables["Table"]
    ## - Build the Excel column heading:
    [Array] $getColumnNames = $Table1.Columns | SELECT ColumnName
    ## - Build column header:
    [Int] $RowHeader = 1
    foreach ($ColH in $getColumnNames)
    $xlsSh.Cells.item(1, $RowHeader).font.bold = $true
    $xlsSh.Cells.item(1, $RowHeader) = $ColH.ColumnName
    $RowHeader++
    ## - Adding the data start in row 2 column 1:
    [Int] $rowData = 2
    [Int] $colData = 1
    foreach ($rec in $Table1.Rows)
    foreach ($Coln in $getColumnNames)
    ## - Next line convert cell to be text only:
    $xlsSh.Cells.NumberFormat = "@"
    ## - Populating columns:
    $xlsSh.Cells.Item($rowData, $colData) = $rec.$($Coln.ColumnName).ToString()
    $ColData++
    $rowData++; $ColData = 1
    ## - Adjusting columns in the Excel sheet:
    $xlsRng = $xlsSH.usedRange
    [void] $xlsRng.EntireColumn.AutoFit()
    }#End For loop.
    #Delete unwanted Sheet1.
    $xlsWb.Sheets.Item('Sheet1').Delete()
    #Set Monday to Active Sheet upon opening Workbook.
    $xlsWb.Sheets.Item('Cert').Activate()
    ## ---------- Saving file and Terminating Excel Application ---------- ##
    $xlsFile = "C:\Scripts\Output.xlsx"
    [void] $xlsObj.ActiveWorkbook.SaveAs($xlsFile)
    $xlsObj.Quit()
    ## - End of Script - ##
    start-sleep 2
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xlsRng)) {'cleanup xlsRng'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xlsSh)) {'cleanup xlsSh'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xlsWb)) {'cleanup xlsWb'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xlsObj)) {'cleanup xlsObj'}
    [gc]::collect() | Out-Null
    [gc]::WaitForPendingFinalizers() | Out-Null
    }#End Function
    $queries = @()
    $queries += "Query1"
    $queries += "Query2"
    $sheetnames = @('Cert','Prod')
    Run-Query -queries $queries -sheetnames $sheetnames

    Here's what I ended up with that accomplishes my goal.  I learned it's not possible to create a CSV with two worksheets since Excel will allow this but the CSV cannot be saved with the second worksheet.  Instead, I create two CSV files then merge
    them into one Excel workbook, one CSV per worksheet.  In my case, this happens in 5 seconds.  There is one thing which must be mentioned, I've seen this script fail the first time it is run but will successfully run the second time.
    Also note, after much trial and error, this code correctly cleans up the Excel ComObject!!  -Thanks go to JRV.
    $docs = "D:\Scripts\MonthlyReboots.xlsx"
    IF (Test-Path $docs){Remove-Item $docs}
    $csv1 = "D:\Scripts\Cert.csv"
    IF (Test-Path $csv1){Remove-Item $csv1}
    $csv2 = "D:\Scripts\Prod.csv"
    IF (Test-Path $csv2){Remove-Item $csv2}
    Function Run-Query {
    param([string[]]$queries,[string[]]$sheetnames,[string[]]$filenames)
    Begin{
    $SQLServer = 'ServerName'
    $Database = 'DataBase'
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server = $SQLServer; Database = $Database; Integrated Security = True"
    $Excel = New-Object -ComObject Excel.Application
    $Excel.Visible = 0
    $dest = $Excel.Workbooks.Add(1)
    }#End Begin
    Process{
    For($i = 0; $i -lt $queries.Count; $i++){
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $queries[$i]
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $DataSet.Tables[0] | Export-Csv -NoTypeInformation -Path "D:\Scripts\$($sheetnames[$i]).csv" -Force
    }#end for loop.
    }#End Process
    End{
    $SqlConnection.Close()
    #Excel magic test!
    For($i = 0; $i -lt $queries.Count; $i++){
    $loopy = (Resolve-Path -Path $filenames[$i]).ProviderPath
    $Book = $Excel.Workbooks.Open($loopy)
    $next = $Excel.workbooks.Open($loopy)
    $next.ActiveSheet.Move($dest.ActiveSheet)
    $xlsRng = $dest.ActiveSheet.UsedRange
    $xlsRng.EntireColumn.AutoFit() | Out-Null
    $dest.sheets.item('Sheet1').Delete()
    $xlsFile = "D:\Scripts\MonthlyReboots.xlsx"
    [void] $Excel.ActiveWorkbook.SaveAs($xlsFile)
    $Excel.Quit()
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($xlsRng)) {'cleanup xlsRng'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($next)) {'cleanup xlsSh'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($Book)) {'cleanup xlsWb'}
    While ([System.Runtime.Interopservices.Marshal]::ReleaseComObject($Excel)) {'cleanup xlsObj'}
    [gc]::collect() | Out-Null
    [gc]::WaitForPendingFinalizers() | Out-Null
    }#End end block.
    }#End function run-query.
    $queries = @()
    $queries += @'
    Select * from table1
    $queries += @'
    Select * from table2
    $sheetnames = @("Cert","Prod")
    $filenames = @("D:\Scripts\Prod.csv","D:\Scripts\Cert.csv")
    Run-Query -queries $queries -sheetnames $sheetnames -filenames $filenames
    Start-Sleep -Milliseconds 50
    Invoke-Item D:\Scripts\MonthlyReboots.xlsx

  • Retrieving BEx Query Results Area for use in Excel formulas

    Hello,
    I run BEx queries in workbooks and then use Excel formulas ( mostly VLOOKUP(LookupValue, ResultsArea, ColumnReturned,) ) to retrieve certain information from the query ResultsArea.
    ****Problem:
    Depending on the query parameters, the query "Results Area" is larger or smaller.
    ****Non-optimal solution:
    One way to define the  ever changing Excel range occupied by the Results Area is to create an Excel name as:
    QueryRange = OFFSET(QueryFirstCell,,,COUNTA(OFFSET(Sheet1!$A:$A,,COLUMN(QueryFirstCell)-1,,)),COUNTA(OFFSET(Sheet1!$1:$1,ROW(QueryFirstCell)-1,,,)))
    Then, the only input required is the top-left cell of the Results Area, which stays the same (unless the query definition changes).
    ****Question
    What is the best way to refer to an ever-changing query Results Area in an Excel formula?
    Thank you!
    Louis

    It is actually much easier than that.
    Use a VBA statement like the following:
    Set RptRng = ActiveCell.CurrentRegion
    This will retrieve the data in the Results Area, no matter what the size is.
    Hope this helps...
    Bob

  • Get query result in E-mail

    Hi Everyone,
    I am trying to get SQL Query Result in e-mail with proper format.
    I tired DB mail but result is not in proper format . It's hard to read from attachment. 
    From Below Query HTML format showing first 3 columns good after that all getting mixed up. 
    Select Ticktsno,customer_Id,Phone,Open date-time,OpenedBy,Assign_to,Category,Support_level,Incident_type,Description from dbo.query_result. 
    HTML Code: 
     if @@ROWCOUNT > 0
    begin
    declare @emailSubject varchar(100),
      @columnHeaders varchar(1000),
      @tableHTML nvarchar(max)
    select @emailSubject = 'My Results Email',
          -- Subject of Email
      @columnHeaders = 'tickets</th><th>Customer</th><th>Phone</th><th>Open Date/Time</th><th>OpenedBy</th><th>Assign_To</th><th>Category</th><th>Support_Level</th><th>Incident_Type</th><th>Status</th><th>DEscription'
       -- Column headers (must put </th><th> between each header)
    set @tableHTML =
      '<div><b>My Email Header</b></div><br>' + -- This is the bold text at the top of your email
      '<table border="1" cellpadding="5"><font face="Calibri" size=2>' +
      '<tr><th>' + @columnHeaders + '</th></tr>' +
      convert(nvarchar(max),
       SELECT td =  Tickets,       '',
                        td =  Customer, '',
                        td =  Phone, '',
                        td = [Open Date/Time], '',
                        td = OpenedBy, '',
                        td = Assign_To,
                        td = Category,
                        td =  Support_Level,
                        td = Incident_Type ,
    td = [Description]         
                         from master.dbo.QueryResult_2000
       for xml path('tr'), type))
      +'</font></table>'
    EXEC msdb.dbo.sp_send_dbmail @recipients='[email protected]',
        @subject = 'Query Result',
        @body = @tableHTML,
        @body_format = 'HTML' ;
    end
    What changes should make in HTML code to get report in proper HTML  format
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

    Thanks Uri for kind reply..I was able to edit that script. Script is running fine from SSMS and sending e-mail notification. But When I am running from SQK agent job getting successful but not getting e-mail notification.
    I enabled the profile from SQL job properties also. 
    Any thoughts on this?
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah
    Hi Logicinisde,
    According to your description, if you run the scripts in the SSMS, it can send an email with HTML format to your mailbox. When you run this scripts by using SQL Server Agent job, it can show running successfully but you could not get any email. We need to
    verify if you select the correct Mail profile. After configuring the alert system, restart the SQL Server Agent service. If you experience any problems sending e-mail notifications through the SQL Server Agent, check the service account that the agent is running.
    If the SQL Server Agent is running with one of the built-in accounts like the Local System account, resources outside the SQL Server machine will be unavailable. This includes SMTP mail servers that are on other machines. If this is the case, change the service
    account for the SQL Server Agent to a domain account to resolve this issue.
    For more information about using Database Mail in SQL Server and using Database Mail with SQL Server Agent, you can review the following articles.
    http://www.idevelopment.info/data/SQLServer/DBA_tips/Database_Administration/DBA_22.shtml
    http://technet.microsoft.com/en-us/library/ms190606(v=sql.105).aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Http 404 error exporting query result into Excel.

    Hello. I'm getting an Http 404 The webpage cannot be found" error when trying to export any APEX application's query results into Excel (Application Express 3.2.1.00.10). This was working fine before. Nothing changed with our APEX application. I've been always using I.E. Version 7.0.5730.11 with no problems. I've reset the I.E. defaults and still the problem exists. I've downloaded Mozilla Firefox and the problem does not happen. However, I would like to know why my I.E. still gets this error? Any feedback or suggestions would greatly be appreciated. Thanks for your time.

    My EI settings are as follows:
    Tools -> Internet Options -> Security
    All Three: Internet, Local Intrarnet, and Trusted Sites ... at Custom Level have the following settings:
    Downloads:
    Automatic prompting for file downloads = Enable
    File download = Enable
    Font download = Enable
    Problem still exists.
    Thanks for the help.... any additional feedback or suggestions would greatly be appreciated. Thanks for your time.

  • How to change font/ font color etc in a graphic object using JCombobox?

    Hello
    My program im writing recently is a small tiny application which can change fonts, font sizes, font colors and background color of the graphics object containing some strings. Im planning to use Jcomboboxes for all those 4 ideas in implementing those functions. Somehow it doesnt work! Any help would be grateful.
    So currently what ive done so far is that: Im using two classes to implement the whole program. One class is the main class which contains the GUI with its components (Jcomboboxes etc..) and the other class is a class extending JPanel which does all the drawing. Therefore it contains a graphics object in that class which draws the string. However what i want it to do is using jcombobox which should contain alit of all fonts available/ font sizes/ colors etc. When i scroll through the lists and click the one item i want - the graphics object properties (font sizes/ color etc) should change as a result.
    What ive gt so far is implemented the jcomboboxes in place. Problem is i cant get the font to change once selecting an item form it.
    Another problem is that to set the color of font - i need to use it with a graphics object in the paintcomponent method. In this case i dnt want to create several diff paint.. method with different property settings (font/ size/ color)
    Below is my code; perhaps you'll understand more looking at code.
    public class main...
    Color[] Colors = {Color.BLUE, Color.RED, Color.GREEN};
            ColorList = new JComboBox(Colors);
    ColorList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ev) {
                     JComboBox cb = (JComboBox)ev.getSource();
                    Color colorType = (Color)cb.getSelectedItem();
                    drawingBoard.setBackground(colorType);
              });;1) providing the GUI is correctly implemented with components
    2) Combobox stores the colors in an array
    3) ActionListener should do following job: (but cant get it right - that is where my problem is)
    - once selected the item (color/ font size etc... as i would have similar methods for each) i want, it should pass the item into the drawingboard class (JPanel) and then this class should do the job.
    public class DrawingBoard extends JPanel {
           private String message;
           public DrawingBoard() {
                  setBackground(Color.white);
                  Font font = new Font("Serif", Font.PLAIN, fontSize);
                  setFont(font);
                  message = "";
           public void setMessage(String m) {
                message = m;
                repaint();
           public void paintComponent(Graphics g) {
                  super.paintComponent(g);
                  //setBackground(Color.RED);
                  Graphics2D g2 = (Graphics2D) g;
                  g2.setRenderingHint             
                  g2.drawString(message, 50, 50);
           public void settingFont(String font) {
                //not sure how to implement this?                          //Jcombobox should pass an item to this
                                   //it should match against all known fonts in system then set that font to the graphics
          private void settingFontSize(Graphics g, int f) {
                         //same probelm with above..              
          public void setBackgroundColor(Color c) {
               setBackground(c);
               repaint(); // still not sure if this done corretly.
          public void setFontColor(Color c) {
                    //not sure how to do this part aswell.
                   //i know a method " g.setColor(c)" exist but i need to use a graphics object - and to do that i need to pass it in (then it will cause some confusion in the main class (previous code)
           My problems have been highlighted in the comments of code above.
    Any help will be much appreciated thanks!!!

    It is the completely correct code
    I hope that's what you need
    Just put DrawingBoard into JFrame and run
    Good luck!
    public class DrawingBoard extends JPanel implements ActionListener{
         private String message = "message";
         private Font font = new Font("Serif", Font.PLAIN, 10);
         private Color color = Color.RED;
         private Color bg = Color.WHITE;
         private int size = 10;
         public DrawingBoard(){
              JComboBox cbFont = new JComboBox(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
              cbFont.setActionCommand("font");
              JComboBox cbSize = new JComboBox(new Integer[]{new Integer(14), new Integer(13)});
              cbSize.setActionCommand("size");
              JComboBox cbColor = new JComboBox(new Color[]{Color.BLUE, Color.RED, Color.GREEN});
              cbColor.setActionCommand("color");
              JComboBox cbBG = new JComboBox(new Color[]{Color.BLUE, Color.RED, Color.GREEN});
              cbBG.setActionCommand("bg");
              add(cbFont);
              cbFont.addActionListener(this);
              add(cbSize);
              cbSize.addActionListener(this);
              add(cbColor);
              cbColor.addActionListener(this);
              add(cbBG);
              cbBG.addActionListener(this);
         public void setMessage(String m){
              message = m;
              repaint();
         protected void paintComponent(Graphics g){
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D)g;
              g2.setColor(bg);//set background color
              g2.fillRect(0,0, getWidth(), getHeight());          
              g2.setColor(color);//set text color
              FontRenderContext frc = g2.getFontRenderContext();
              TextLayout tl = new TextLayout(message,font,frc);//set font and message
              AffineTransform at = new AffineTransform();
              at.setToTranslation(getWidth()/2-tl.getBounds().getWidth()/2,
                        getWidth()/2 + tl.getBounds().getHeight()/2);//set text at center of panel
              g2.fill(tl.getOutline(at));
         public void actionPerformed(ActionEvent e){
              JComboBox cb = (JComboBox)e.getSource();
              if (e.getActionCommand().equals("font")){
                   font = new Font(cb.getSelectedItem().toString(), Font.PLAIN, size);
              }else if (e.getActionCommand().equals("size")){
                   size = ((Integer)cb.getSelectedItem()).intValue();
              }else if (e.getActionCommand().equals("color")){
                   color = (Color)cb.getSelectedItem();
              }else if (e.getActionCommand().equals("bg")){
                   bg = (Color)cb.getSelectedItem();
              repaint();
    }

  • How to use one query results in another query

    hi,
    in help.sap I have founded that using variable type replacement path I can use one query results in another query. It is wrote there that I have to choose query name results I want to get in variable definition but I do not know where.
    How I can do this?
    Result I want to get is:
    In one query I have material prices in another material quantities. I want to calculate inventory value (price * quantity). Moreover prices are on plant level, quantities on storage type level. Plant is atribute of storage type.
    Can I do this?
    Regards,
    Andrzej

    Hi Andrzej,
    please check out this thread: Set parameters values depending on other parameters
    I had a discussion about query results as input for another query in there.
    For creating a workbook, just click on the save button after you ran your query in the bex.
    Siggi
    Message was edited by: Siegfried Szameitat

Maybe you are looking for

  • I have rented a movie on i tunes but unable to watch

    I HAVE RENTED A MOVIE ON I TUNES  but unable to find it on any of my apple products (i pad, i tv, i phone, mac book pro, i tunes) it shows that i rented it in itunes but cant find it to watch i tv wont let me watch says i need to rent it really not t

  • How to open .Ink files in Mac?

    I have recently copied a slideshow from my friend's laptop (not a Mac) into my pendrive. When I tried to open the slideshow in my Mac, it was unable to because the format has changed to .Ink files. How do I fix this? PS. All of my existing files in m

  • Photoshop freezes when I use quick selection tool

    So every time i use the quick selection tool, on any image in photoshop I get a loading symbol and then I have to force quit the application. This only recently started happening and I have had the application for a few months. Thanks

  • Assigning employee to two positions

    Hello, In my organization the HR department has decided to enable employees to be assigned to two positions at the same time (work percentage of 50% for each). However, the SAP-HR solution was bulit on the assumption that an employee is assigned to o

  • I wonder

    I work on a Mac, System 10.5.2 I use an Epson 1680 Expression scanner and mainly stay within Photoshop CS3. I upgraded from System 10.4. Immediately, I could not use my Silverfast Scanning software vers. 6.5. The scanner would prescan but when I went