Adding formatting to output a report to HTML format

I'm in a respect which sends the output to HTML (thanks to LucD thereby).  I'm hoping to make three improvements:

1 to see if it is possible to add two characters of the space between the columns so you can tell where one ends and the other begins

2. add borders around each of the elements in the table

3. in addition to sending the report as part of the actual body of the email, include an html file as an attachment to the email so

Is this possible?  At the moment only the csv file is attached to the report.

Thank you!

$report = Get-VM | select name, numcpu, vmhost, memorygb, folder, guest

$reportHtml = $report | ConvertTo-Html | Out-String
$report | Export-Csv report.csv NoTypeInformation - -UseCulture

Send-MailMessage -In mymail@mycompany.com -subject report '
-SmtpServer smtp.mycompany.com -of [email protected]'
-BodyAsHtml -body $reportHtml -Accessories report.csv

Hello, TheVMinator-

As LucD says (of course), ConvertTo-Html allows such things.  I was away by making an example of this when Luc replied, but I went to a finish to the top to provide such example.  Something like:

$report = Get-VM | select name, numcpu, vmhost, memorygb, folder, guest

## define some style for the HTML$strHtmlHead = "My Report"## use the style in the ConvertTo-Html call$reportHtml = $report | ConvertTo-Html -Head $strHtmlHead## write out the CSV$report | Export-Csv report.csv -NoTypeInformation -UseCulture## write out the HTML$reportHtml | Out-File -Encoding ASCII -FilePath myreport.htm

## send the mail message, with HTML body and a couple of attachmentsSend-MailMessage -To [email protected] -Subject Report `  -SmtpServer smtp.mycompany.com -From [email protected]`  -BodyAsHtml -Body $reportHtml -Attachments report.csv,myreport.htm

This makes some minor CSS in the HEAD of HTML to manage points 1 and 2 for you.  And, by adding a call Out-File name of the file that results in the table of values for the - Send-MailMessage setting accessories, the HTML file must also be attached to the e-mail message.  What to do for you?

Tags: VMware

Similar Questions

  • Email burst send the report in HTML format in the body of the email

    Hello
    I have Oracle BI Publisher 10.1.3.4.1 (build # 1101) version installed as part of Oracle Business Intelligence.
    I have questions about the email of breaking. Simple observation, I created and I'm bursting it by e-mail. But I want to send the report to HTML format within the body of the email and not as an attachment. I read that it is possible in other versions of the TONE (of BSE) with the help of the burst configuration file. But I can't use this file with my version of BEEP, I can configure bursting life alone SQL query.

    Is there a solution?

    Thank you

    It is a known issue with Outlook Client. Try to open the email with the other guests.

  • Generation of reports using HTML template

    Hi all

    I want to generate the report using the HTML template.

    Can someone help me know how I can do it.

    Note: I use LabVIEW version 2014.

    Thanks in advance...

    If you do not want to use Microsoft Office Word / Excel you can generate the HTML report.

    -To generate HTML reports you don't have to plug whatever it is at the entrance of model and let in a vacuum.

    - And select the type of report in HTML format. Please find the attached example you will find in examples: http://www.ni.com/white-paper/13926/en/

  • My report in HTML conversion

    I'm trying to do my report by e-mail in html file looks nice.  I am familiar with the basics of ConvertTo-html, and I used it with instant short reports.  My problem is that now I want to take a long report that contains a lot of PSObjects, and I am running into a problem.  I looked online for help, and my basic idea is that I need the help of the ConvertTo-HTML cmdlet with the parameter - Fragment, because I'm having different objects inside.  Here's a sample of what I tried.  I enclose also 2 files, htmlsample and htm3 which is the result of each section.  Sorry if it's very long.  Here's the first thing that I tried, it is a part of the script, if I can get 1 piece of work, I should be able to handle the rest:

    $custom = ' < style >

    BODY {background-color: #999966 ;}}

    TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse ;}}

    TH {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    TD {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    < / style > '

    $AllDataCenter = get-data center | Select the name of ExpandProperty-

    $AllCluster = get-Cluster | Sorting

    $AllESXiHost = get-VMHost

    $AllTemplate = get-model

    #Creating a new object of Powershell to store information (for ESXi hosts)

    $ESXiInfo = new-Object - TypeName PSObject

    $vVersions = $AllESXiHost | Group version | SELECT name, County

    $HWModel = $AllESXiHost | Model group | SELECT name, County

    $ESXiInfo | Add-Member - MemberType NoteProperty-Name 'Total ESXi hosts' - .count value ($AllESXiHost)

    $vVersions | Foreach {Add-Member - InputObject $ESXiInfo - MemberType NoteProperty-Name ' Version of vSphere: $($_.) '} Name)"- value of $_. County}

    $HWModel | Foreach {Add-Member - InputObject $ESXiInfo - MemberType NoteProperty-Name ' model HW: $($_.) '} Name)"- value of $_. County}

    $ESXiInfo | ConvertTo-Html-Fragment

    #Creating a new object of Powershell to store information (for data center)

    $vDataCenter = new-Object - TypeName PSObject

    $vDataCenter | Add-Member - MemberType NoteProperty-Name "vSphere Datacenter (s)" - value ([string]: join (",", $ALLDataCenter))

    $vDataCenter | ConvertTo-Html-Fragment

    ConvertTo-Html-body '$ESXiInfo $vDatacenter' - head $custom | Out-file c:\Scripts\htmlsample.htm

    See htmlsample.png

    I tried a shorter version where I used the $ESXiInfo variable, I only wrote my screen and it looks like this, that's the look I'm going to do:

    ESXi hosts total: 29

    VSphere version: 5.0.0: 27

    vSphere Version: 4.1.0: 2

    Model HW: ProLiant BL460c G6: 4

    Model HW: ProLiant BL490c G6: 9

    Model HW: ProLiant BL460c Gen8: 3

    Model HW: ProLiant BL460c G1: 9

    Model HW: ProLiant BL460c G7: 2

    Model HW: ProLiant DL160 G6: 2

    If I try this, the end HTML is OK, but it's only 1 item, and I want the data in a list.  See htm2.png

    $custom = ' < style >

    BODY {background-color: #999966 ;}}

    TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse ;}}

    TH {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    TD {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    < / style > '

    $ESXiInfo |  ConvertTo-Html-head $custom | Out-file c:\Scripts\htm2.htm

    Even if I try this, data formats not, but I guess that's because I'm converted to HTML

    $custom = ' < style >

    BODY {background-color: #999966 ;}}

    TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse ;}}

    TH {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    TD {border-width: 1px; padding: 0px; border-style: solid; border-color: black ;}}

    < / style > '

    $ESXiInfo | ConvertTo-Html-head $custom | FL | Out-file c:\Scripts\htm4.htm No. Attachment, that looks like the same thing as htm2.png

    I use 4 Powershell and PowerCLI 5.5.

    The basics of what I want is to put data into each line, a little similar to the htm2.png, but set shaped like a list, and then I need to combine several PSObjects in one html file.  Thanks for any help.

    The main question here is in the way that you formatted your dataset.  In other words, your headers set for each piece of data when you need to do is to define two headers 'Info, Count '.

    For each of your unique values, you should be charging Info and County, as follows:

    $ESXiInfo = @)

    $vVersions = $AllESXiHost | Group version | SELECT name, County

    $HWModel = $AllESXiHost | Model group | SELECT name, County

    $DataPoint = New-Object system. Object

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Info' - value 'Total ESXi hosts.

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Count' - .count value ($AllESXiHost)

    $ESXiInfo += $DataPoint

    $vVersions | {Foreach}

    $DataPoint = New-Object - TypeName system. Object

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Info' - value ' Version of vSphere: $($_.). (Name) ".

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Count' - value of $_. County

    $ESXiInfo += $DataPoint

    }

    $HWModel | {Foreach}

    $DataPoint = New-Object - TypeName system. Object

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Info' - value "Model HW: $($_.). (Name) ".

    $DataPoint | Add-Member - MemberType NoteProperty-Name 'Count' - value of $_. County

    $ESXiInfo += $DataPoint

    }

    In this case, let's define $ESXiInfo as the main hash table and fill w / new datapoint objects.

  • How to generate an output PDF report when the layout template is an Excel file in the editor of BI 11.1.1.7

    That's what I did...

    1. create the new report

    2 create a report using an existing data model (browse and choose a data model)

    3. How do you create your report? (click used report editor)

    4. click on finished (and then saved the report)

    5. then he asked me to create the page layout (I chose to download or generate a layout and then traveled to a downloaded my model with XDO_ * the columns of the excel data model mappings)

    Template file = model Excel, locale = English (United States)

    5. click on Upload

    6. then click view the report top-right, which has opened my file name of "my_report_layoutname.xls" with sheet report 1 (OPE all mapped very well) and a sheet of xdo_metadata.

    I just wanted to step 6 is a sheet 1 pdf report.    How do I do that?  Could not find the place where I can clarify that.

    Mr. Jamal

    Layouts Excel generate only one exit Excel. (CSV takes no account of the provision is therefore an option for any layout.)

    You use RTF or PDF or page Template Builder (XPT) layouts to generate PDFS.

    The LOV to find output formats by modifying the report and selecting a list.

    The table has a column to the output formats, it is controlled by the format of the presentation that you have built.

    Kevin

  • No output for report of XML editor using CASE/DECODE in a Where Clause

    Hello

    I have a requirement of the company to modify an existing report that has two input parameters,
    -> p_statcode (closed status) which may have values "Y" or "n".
    -> p_overdue (flag late), which can have values of "Y" or "n".

    The flag late is a column evaluated with O/N values and it is evaluated as follows,
    ONTF_MOD_VAL(NVL (
                                         (TRUNC (SYSDATE)
                                          - (TO_DATE (oe_order_lines.attribute18,
                                                      'DD-MON-RRRR')
                                             + TO_NUMBER (fnd_lookup_values.meaning))),
                                         0
                                      ))
                            overdue_flag
    The requirement of user now is that they must be a third option for setting called p_overdue ALL,
    which by the way the output should include records with
    p_statcode is p_statcode ELSE is N AND Y OR p_overdue p_overdue is N

    In other words records with raising the Y and N for flag late must be returned regardless of the value given to the closed state.

    Original where clause contained in the data definition file is as follows,
    WHERE Closed_Status = nvl(:p_statcode,Closed_Status)
                       AND overdue_flag = nvl(:p_overdue,overdue_flag)
    My modified code is the following,
    WHERE   Closed_Status = NVL (:p_statcode, Closed_Status)
             AND overdue_flag = (CASE
             WHEN :p_overdue = 'Y' THEN 'Y'
             WHEN :p_overdue = 'N' THEN 'N'
             ELSE overdue_flag
             END)
    OR
    WHERE   Closed_Status = NVL (:p_statcode, Closed_Status)
             AND overdue_flag = DECODE (:p_overdue, 'Y', 'Y', 'N', 'N',overdue_flag)
    Both approaches have the same problem.
    The output is in EXCEL format. The modified query works very well for p_overdue as Y or N but when p_overdue is passed as ALL he returned a blank EXCEL sheet with just exit report column headings.
    Any help regarding, why is this the case? What's not in my approach?

    Kind regards
    Vishal

    unclear on p_overdue = ALL
    P_overdue = ALL on what necessary values?

    try sth like

    WHERE   Closed_Status = NVL (:p_statcode, Closed_Status)
    AND (
       overdue_flag = DECODE (:p_overdue, 'Y', 'Y', 'N', 'N',overdue_flag) and :p_overdue != 'ALL'
       or
      :p_overdue = 'ALL' and (overdue_flag = 'Y' or overdue_flag = 'N')
    )
    

    for overdue_flag, which has more then 'Y' values of "n".
    If overdue_flag that in ('Y', ' don't) then

    WHERE   Closed_Status = NVL (:p_statcode, Closed_Status)
    AND (
       overdue_flag = DECODE (:p_overdue, 'Y', 'Y', 'N', 'N',overdue_flag) and :p_overdue != 'ALL'
       or
      :p_overdue = 'ALL'
    )
    
  • text and table in excel is not by adding using the generation of reports

    I want the file to write to the attached format. pls help, I m trying for the last 3 days...

    Thanks in advance.

    I did purchase table to write to report.vi. but not able to add it to other excel files.

    Thanks ben,

    your program is working well for version 11. I'm working on version 8. After much trying, I found that, in this document, add table adds in excel unlike in version 11 to give the coordinates (microsoft office settings) to locate the table.

    Thank you for your response.

    dg7318

  • How to set the police Chinese in the output PDF report 12 c

    Hi all

    Form 12 c can call report 12 c, but Chinese display font can't correctly, someone has config guide how set the font Chinese in the PDF report 12 c output. Thank you!

    After installation of Patch for Bug: 22224336, can display Chinese fonts properly.

  • HTML tags displayed in a report template HTML Std

    Hi all

    I have the SQL embedded with HTML tags used inorder to get the result set in the form.

    I have used this before and it worked fine. But now, even the simple query displays the HTML tags; I have even compared him with the SQL to work... but could not find the problem... I hope you could help.

    The used simple SQL query is: select ' < table > < tr > < td > Job Description: ' | job_descp | ' < table > < /tr > < / table > ' xyz.
    Region - reports
    Model - default: HTML Standard

    Thank you!

    In the attributes of reports tab change column, and change column attributes display under... in column Standard report

    Kind regards

  • What region in the report column HTML link?

    Dear gurus of the Apex,
    OK, I'll go straight to my question. I have a page to download file with region (conditional) report that comes after the file download process. According to the report that I have a column to remove the file downloaded (column has an image link, the target application, the name of the option: P2_DELETE_ID value: #DOC_ID #). Basically the report picks up just downloaded file ID and allows me to delete the file by having Hiden point Page (P2_DELETE_ID) and before the process of header:
    BEGIN
    REMOVE FROM EBA_ASSET_ORDER_TEMP_DOCS
    WHERE annual =: P2_DELETE_ID;
    END;
    condition: Expression 1 value is not Null, and the value of the Expression 1:
    P2_DELETE_ID
    I and another conditional region (which is HTML) he comes after the file download process as well. The Source region is:
    & lt; div id = "FinalMessage" > & lt; / div >
    & lt; br / >
    & lt; div > & lt; a href = "javascript:confirmFileDelete(htmldb_delete_message,'f?p=&APP_ID.:2:&SESSION.:REMOVE_ID:::P2_DELETE_ID:#DOC_ID#')"; > & lt; "img > src="/i/delete.gif "style =" position: relative; " Top: 1px; ' / > delete the downloaded file & lt; /a >
    & lt; / div >
    where id = "FinalMessage" - is the JS success/error message
    and... href = "javascript:confirmFileDelete--is my real question. So I try to hide my region to report and show only my region HTML where I will be able to this (... href...) link delete file from my table. I am able to dele file using report link colum but my... href... link dosnt want to delete my file, doen't even want to pick up the ID of file. Is there a way where I can link my... href... link to pull the report column?

    Thank you

    NP - now access, so I will have a look

    Andy

  • Adding an item to a report

    Hello

    I have a report that is editable on a table that has the salary column, I find the sum of all salaries in the report and display them at the bottom of the salary column. Y at - it none to add a textfiled at the bottom of a report to be updated.

    Thank you
    Shri

    Shri salvation,

    You can easily add the sum of a column at the bottom of the report. To do this, go to the report attributes and check the option sum in column salary.

    Total of type in the section to break the format.

    Hope this helps,

    Kind regards

    Pascal M

    Web: http://tajuddin.whitepagesbd.com

  • Form of parameter in OAS and Web, output paper report

    Hello

    In the Report Builder 10g, I have this form of parameter. It begins before a paperreport is generated (with the accessories, LOV and etc..)
    If I put my rdf in the OracleAS I can call the pit of the browser report, but there is no parameter window. How can I change the settings after
    call report?

    Another question:
    How can I tell the OAS it must generate a pdf of my rdf?

    Thank you
    Paul

    PS: If you are referring to the documentation please give the pagenumber ore sth.

    Published by: pbecker on October 8, 2008 02:00
    do rdf on pdf...

    Hello

    If you wish to view the PDF in your browser, use the settings:

    DESTYPE = CACHE and DESFORMAT = PDF in the URL:

    Example:
    http://myserver.mycompany.com/reports/rwservlet?Server=myrepserver&report=MyReport&destype=cache&desformat=PDF&userid=Scott/Tiger@mydb

    If you use a different value for DESTYPE, (DESTYPE = FILE for example), the message:

    "Oracle reports job properly run.

    will be returned and the output stored in the file name specified by DESNAME.

    You can get the PDF file using the showjobs page:

    http://myserver.mycompany.com/reports/rwservlet/showjobs?Server=myrepserver

    Concerning

  • Highlighted value in table reports using html changes column width

    I use basic highlighting using raw html SQL to select a column. However, I noticed that the column width becomes very large compared to the displayed value, maybe there also took html into consideration for length? Not sure if there is a problem with the grid itself.

    for example this piece of code, see the difference in width of columns status and status_1... Ideally I would like to see the two columns of the same size as status_1.

    select case when BP.STATUS = 'LOCKED' then '<html><body><strong><font color="blue">' || BP.STATUS || '</font></string></body></html>' 
    when bp.status = 'COMPLETED' then '<html><body><strong><font color="green">' || bp.status || '</font></string></body></html>'
    when BP.STATUS = 'PROCESSING' then '<html><body><strong><font color="orange">' || BP.STATUS || '</font></string></body></html>' end STATUS
    ,BP.STATUS STATUS
    from (select 'COMPLETED' status from dual union all select 'PROCESSING' from dual union all  select 'LOCKED' from dual) bp ;
    

    Developer SQL 4.1.1

    It's an unfortunate side effect

    We could / should have code in there to set the width based on the vs html rendering the actual html source code

    but it's a development request

  • Captivate quiz - adding an additional field to report on the LMS

    I have a Captivate 100 question quiz to report to an LMS.  We can get all the information with a report of interactions between all.  The contractor giving the test wants to be able to refer to the section of a manual which the questions come from. The only way I was able to do this so far is to put the mention of the issue at the end of the issue, and then change the font to white color.  And then it appears on the report of the LMS.  Is it possible to add another field or something that will also be visible on the report of the LMS, but is not visible to the person who takes the quiz?

    There is currently a bug in Captivate 7 (maybe even in 6) which causes this problem where an interaction also ID change the slide following, as well. If all goes well, that will be corrected in version 8.  But in the meantime, you just go down the list of the IDS of Interaction and make sure they are all unique, that otherwise you will get error messages.  I use the function of Interaction ID prefix in Quiz settings do to precede rights holders Captivate unique number to each question in the quiz.  The prefix that I use is a code which clearly indicates which module this quiz question comes.  But you can go further and indicate what the question is about whether you want.

  • Formatting of HTML reports

    Hello

    I use LabVIEW to generate reports using HTML file. These reports contain plots, images, tables and text blocks. Ideally, I would like all in LabVIEW format so I can't do any post processing of the document. I would like to make some parts bold, underline and vary the size of the font. I can align parts such as headers at the top of the page and footers, but it's her. I would like to have more control on alignment of words, titles, images and paragraphs in the report. However, I was not able to understand this. I feel that I need 'Add user in HTML format in Report VI', but I was not able to use this good apparently.

    Any ideas?

    Thank you

    Try adjusting the text input HTML to add the user as HTML on Report.vi

    [text to write here.]

    Which should right align text in your report.

    There is no move to learn some CSS. The previous link I gave would be very useful.

Maybe you are looking for