Returning results to a popup, how to format
Hi, i have a printer script and at the end of the command i return the results for verification in a popup window, but it screws up with the formating. So i am wondering if its possible to format it better? or something better to use instead of a popup window
that also formatting?
$shell = New-Object -ComObject “WScript.Shell”
$printername = "test"
$servers = "g1v"
$printerinfo = $null
foreach ($server in $servers) {
if(([wmi]"\\$server\root\cimv2:Win32_Printer.DeviceID='$printername'").name -eq $printername){
$printerinfo += [wmi]"\\$server\root\cimv2:Win32_Printer.DeviceID='$printername'"|
ft SystemName, Name, PortName, DriverName -a
if($printerinfo){
$Shell.Popup(@"
$($printerinfo | Out-String )
"@, 0, “Info”, 0)
Thanks
Sorry but you cannot control the format of a popup. You would need to build a custom form or use Out-Gridview
$printername='HP LaserJet Professional P 1102w'
$servers='w8test'
$printers=foreach ($server in $servers) {
[wmi]"\\$server\root\cimv2:Win32_Printer.DeviceID='$printername'"
$printers|select SystemName, Name, PortName, DriverName |Out-Gridview
¯\_(ツ)_/¯
Similar Messages
-
How to use stored procedure which returns result set in OBIEE
Hi,
I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
Pls help me in solving this.
ThanksHi Radha,
If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
If you want to use caching, you should enable caching in the nqsconfig.ini file.
Cheers,
Daan Bakboord -
How to format popup info in web reports
Hi Forum,
maybe it's quite easy, but I've no idea if or how I can format the popups
in web-reports, that come up if you hover a graph.
The current output is e.g.:
1/4 Figure-description category value
Is there a way to format the upcomming popup like the formatting you can do for series with $abs and $label?
Thanks in advance for any idea.
Regards,
TobiasThere is no standard way to do it.
You can manually use javascripting to create custom hover boxes.
You will have to understand the way HTML generates (it has flat image and AREA maps which isolate the areas of flag image w/ coordinates). Then enhance the AREA maps to override the standard hover boxes.
If you know javascript very well then you can use even available javascript frameworks to get highly customizable hover boxes. But it will involve considerable effort.
Abhijeet -
How to write a Query a table and the return result is the column name
Hi All
Pls advise how to write a query whereas the return result is the
column name.
I know there is describe <table_name>;
Is there any other ways?
Pls advise
Tj
Edited by: user600866 on Oct 14, 2008 12:13 AMData Dictionary table user_tab_columns has all the column names. You can query that and get what ever you want.
To get the column list of a table just query
select *
from user_tab_columns
where table_name = <your_table>Edited by: Karthick_Arp on Oct 14, 2008 12:18 AM -
How do I get multiple return results from a function
IDBASKET IDSTAGE DTSTAGE
3 1 24-JAN-03
3 5 25-JAN-03
4 1 13-FEB-03
4 5 13-FEB-03
5 3 21-FEB-03
I input is a single IDBASKET number from this table and this function works fine only if it has one IDSTAGE per idbasket. (idbasket#5)
But how do I get it to return a result for an IDBASKET when it has multiple IDSTAGE? (idbasket#3 & 4)
THANKS MUCH,
MAT
SQL> CREATE OR REPLACE FUNCTION status_desc_sf
2 (p_code NUMBER)
3 RETURN VARCHAR2
4 IS
5 lv_output_txt VARCHAR2(30);
6 BEGIN
7 IF p_code = 1 THEN lv_output_txt := 'Order submitted';
8 ELSIF p_code = 2 THEN lv_output_txt := 'Accepted, sent to shipping';
9 ELSIF p_code = 3 THEN lv_output_txt := 'Backordered';
10 ELSIF p_code = 4 THEN lv_output_txt := 'Cancelled';
11 ELSIF p_code = 5 THEN lv_output_txt := 'Shipped';
12 ELSE lv_output_txt := 'No information';
13 END IF;
14 RETURN lv_output_txt;
15 END;
16 /Duplicate thread:
How do I get multiple return results from a function -
How to find your position in a google returned results
Hi
Trying to find on particular key word searches using google
where my site comes in its listing.
At the moment I am instigating searches on key words from my
sites, and then manually trawling through the returned result
listing to see if i am in there.. yawn
Is there n easier way ?
Ta
CarloOops.. I double clicked on submit. now theres 2 copies..
Use this one :( Ta -
Oracle Text column / return results in bold
I have a form that allows oracle searches to be constructed such as this: ("mem% day concert" AND "pbs") OR "mem% day concert" OR "gary sinise" OR "gary sin%" OR ("mem% day concert" AND ("nat% guard" OR "air force" OR pbs OR concert))
It searches against millions of data records using oracle text. How can I configure the page so the results returned show in bold font.
So for this sample result string; I would like to format the words Gary Sinise in bold font
TZ; Gary Sinise: Gary Sinise was with the USO and his Lt Dan Band. V; USO concert.You might have better luck with this question on the Oracle Text forum. I think Oracle Text has a feature to embed HTML markup on the search "hits".
See if http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
is of any help
Refer to http://download-uk.oracle.com/docs/cd/B19306_01/text.102/b14218/cdocpkg.htm#sthref1666 -
How to FORMAT a number field in Formula editor
Dear All,
I have a "QUANTITY" field in database which has to get displayed in the report as " QTY : " that will look like QTY : 54.
Where as now it coming as QTY : 54.00
So, how to format this field in the Formula Editor while concatenation of
"QTY : " + CStr()
If any one has any idea please help me out.
Thanks and regards.Hi friends,
Thanks to all of you that you all have replied my question and given your answers.
Thanks to all of you specially Alpana Phapale, Wallie Chang, Poonam Thorat and Raghavendra Gadhamsetty, the answers given by you is the perfect one may be in different ways and only one can be used by me. But your answers were exactly correct.
Thanks to Asha Lund, your answers is also correct but the result as per my report should be in figures and not in words.
Whatever it may be but for repling thanks to you too.
Please be always with me, I am very new to Crystal Report and just learnt by my own as my Boss ordered me to do this and I have to make about 50 reports within 15 days. I think the day will start from today.
Well friends thanks a lot again for all your effort. -
How to format "My Passport" for Time Machine
I have purchased a 1TB Western Digital My Passport Drive (an external drive connected via USB). How should I format this drive to use it with Time Machine?
I'm running OSX 10.6.8 on an Intel iMac (hardware circa 2005). I have been using Time Machine for several years, rotating through external disks. Thie new disk will replace one of the previous disks which has failed. I have forgotten how I formatted the previous disks. I'm primarily interested in whther to use HFS or whatnot. As to partitioning, the format will just be one partition for the whole disk.
I'm going to see if I can figure this out using Disk Utility, but in the mean time, does anyone have recommendations?
Thanks in advance,
FrankDrive Preparation
1. Open Disk Utility in your Utilities folder.
2. After DU loads select the WD Passport drive (entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
6. Click on the Erase button. The format process can take up to several hours depending upon the drive size. -
How to format 9 or 11 digit number with dashes
Windows Adobe Pro 9.
Someone please be kind and have mercy on me, I've researched this issue for 5 hours now and cannot resolve it on my own.
I have a text field where the user will enter either a 9 digit or 11 digit number separated with dashes. If the number entered is 9 digits, it should appear as
XX-XXXXXXX. If 11 digits, it should appear as XX-XXXXXXX-XX. If only 9 digits are entered, the -XX at the end must be omitted.
I found a javascript that showed how to allow a varying number of digits, and I also found one that showed how to cause the dash to be entered, but I'm not smart enough to know how to combine the two. I've only used one other javascript before (how to format the time 12:00 am, with a gigantic thanks to Mr. George Johnson), so I know that I must put the script in "Advanced > Document Processing > Document JavaScripts." I think then I would go into the text field format and select "custom," and enter a keystroke and format script???
Any help will be greatly appreciated.
thanks
aliceHi Mr. Johnson,
When I copied the first part of the code into the document-level javascript editor box and hit okay, it gives this message:
SyntaxError: return not in function
8: at line 9
and the cursor moves to the empty line after:
// Do nothing if field is blank
if (!s) return;
Is there something missing?
I really appreciate your help.
alice -
How do you format sysdate? I want the results to be in date format, but I only want the date itself without the time added as
6/14/2010
The To_Date function doesn't seem to work as it converts a string to a date and sysdate isn't a string?
Thanks for any help..user12296489 wrote:
Turns out that I can specify to change the format from text to date when I import the data into access. So, after using To_Char to save the data in mm/dd/yy text format, I can import that, changing it to date format upon the import..That sounds like the correct thing to do.
You have to remember, when you talk about "format", you are talking about how something is displayed or output and that means you are talking about strings. Only character based datatypes are strings (VARCHAR2, CLOB) and the other datatypes are internal representations that have to be formatted to strings to be displayed.
For examples, if I look at the string 'FRED'...
SQL> select 'FRED', dump('FRED') as dmp from dual;
'FRE DMP
FRED Typ=96 Len=4: 70,82,69,68You can see that it's stored internally as 4 bytes each of which are the ascii values of the 4 characters in the string. There's no formatting needed as it's already a direct representation of the ASCII characters needed to display it.
However, if I look at sysdate...
SQL> select sysdate, dump(sysdate) as dmp from dual;
SYSDATE DMP
15/06/2010 08:28:04 Typ=13 Len=8: 218,7,6,15,8,28,4,0Whilst it displayes in DD/MM/YYYY HH24:MI:SS format, the internal storage of it is something completely different. It's made up of 8 bytes of data that sort of (but not fully) represent the number parts of the date, but contain non of the formatting that would display it as it appeared to me.
The format for the date comes from my local session settings, which tell it how to format it as a string. I can change this...
SQL> alter session set nls_date_format='DD-MON-YYYY';
Session altered.
SQL> select sysdate, dump(sysdate) as dmp from dual;
SYSDATE DMP
15-JUN-2010 Typ=13 Len=8: 218,7,6,15,8,32,44,0Now the date is displayed differently, but internally it's still represented by 8 bytes, that hasn't changed.
So, if you want to format dates, or numbers, you need to use the TO_CHAR function and specify the format it should be displayed in. You can use the NLS settings, but they are session specific and you would need to be careful using them. It's always better to be explicit about the format you want using TO_CHAR instead. -
Dear All
how to format paragraph string to show content left, Right or middle of pdf document using iTextsharp in visual basic and absolute position on the document.
ThanksHere is one more example that i have modified the GetCell function so that you can use it for adding all the cells to the document. It takes several arguments to specify everything you need to create each cell. It now lets
you specify the Text, the Text Alignment, the Text Font and color, weather the cell shows the Border, the BackColor of the cell, and the Padding values for the Left, Right, Top, and Bottom.
If you study the code you should be able to figure out how it works. From here you can figure out the rest of what you need to do and how to use the
GetCell function.
With one quick google search for "iTextSharp Documentation" the first link to pop up was this link.
iTextSharp Documentation
Imports System.IO
Imports Its = iTextSharp.text
Public Class Form1
Private dt As New DataTable
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
dt.Dispose()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dt.Columns.Add("Name")
dt.Columns.Add("Age")
dt.Columns.Add("Birth Date")
dt.Rows.Add(New Object() {"Johnny", "23", Now.AddYears(-23).ToString})
dt.Rows.Add(New Object() {"Frank", "41", Now.AddYears(-41).ToString})
dt.Rows.Add(New Object() {"Rex", "33", Now.AddYears(-33).ToString})
dt.Rows.Add(New Object() {"Kim", "26", Now.AddYears(-26).ToString})
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyPdfFilePath As String = "C:\TestFolder\MyPdf.pdf"
Dim pSize As New Its.Rectangle(Its.PageSize.A4)
Dim PdfDoc As Its.Document = New Its.Document(pSize, 10, 10, 10, 10)
Dim PdfImage As New Its.Jpeg(New Uri("C:\TestFolder\MyLogo.jpg"))
PdfImage.Alignment = Its.Jpeg.ALIGN_CENTER
Dim pTable As New Its.pdf.PdfPTable(1)
pTable.AddCell(getCell("Name : " & TextBox1.Text, Its.pdf.PdfPCell.ALIGN_CENTER, Its.FontFactory.GetFont("Arial", 15, Its.BaseColor.BLACK), False, Its.BaseColor.WHITE, 10, 0, 0, 0))
pTable.AddCell(getCell("Policy : " & TextBox2.Text, Its.pdf.PdfPCell.ALIGN_CENTER, Its.FontFactory.GetFont("Arial", 20, Its.BaseColor.RED), False, Its.BaseColor.WHITE, 10, 20, 0, 0))
Dim cTable As New Its.pdf.PdfPTable(dt.Columns.Count)
For Each col As DataColumn In dt.Columns
cTable.AddCell(getCell(col.ColumnName, Its.pdf.PdfPCell.ALIGN_CENTER, Its.FontFactory.GetFont("Arial", 12, Its.BaseColor.WHITE), True, Its.BaseColor.BLUE, 3, 5, 0, 0))
Next
Dim tblfont As Its.Font = Its.FontFactory.GetFont("Arial", 10, Its.BaseColor.BLACK)
For Each row As DataRow In dt.Rows
cTable.AddCell(getCell(row.Field(Of String)("Name"), Its.pdf.PdfPCell.ALIGN_LEFT, tblfont, True, Its.BaseColor.WHITE, 3, 4, 3, 0))
cTable.AddCell(getCell(row.Field(Of String)("Age"), Its.pdf.PdfPCell.ALIGN_CENTER, tblfont, True, Its.BaseColor.WHITE, 3, 4, 0, 0))
cTable.AddCell(getCell(row.Field(Of String)("Birth Date"), Its.pdf.PdfPCell.ALIGN_RIGHT, tblfont, True, Its.BaseColor.WHITE, 3, 4, 0, 3))
Next
Using fs As New FileStream(MyPdfFilePath, FileMode.Create, FileAccess.Write, FileShare.None)
Using pdfWrite As Its.pdf.PdfWriter = Its.pdf.PdfWriter.GetInstance(PdfDoc, fs)
PdfDoc.Open()
PdfDoc.Add(PdfImage)
PdfDoc.Add(pTable)
PdfDoc.Add(cTable)
PdfDoc.Close()
End Using
End Using
PdfDoc.Dispose()
End Sub
''' <summary>Creates a new cell for the table.</summary>
''' <param name="text">The text string for the cell.</param>
''' <param name="alignment">Alighnment for the text string.</param>
''' <param name="textfont">The font used for the text string.</param>
''' <param name="border">True to show the cell border. False to hide the cell border.</param>
''' <param name="backcolor">The background color of the cell.</param>
''' <param name="padtop">The amount of padding on the top of the text string.</param>
''' <param name="padbottom">The amount of padding on the bottom of the text string.</param>
''' <param name="padleft">The amount of padding on the left of the text string.</param>
''' <param name="padright">The amount of padding on the right of the text string.</param>
Public Function getCell(ByVal text As String, ByVal alignment As Integer, ByVal textfont As Its.Font, ByVal border As Boolean, ByVal backcolor As Its.BaseColor, ByVal padtop As Single, ByVal padbottom As Single, ByVal padleft As Single, ByVal padright As Single) As Its.pdf.PdfPCell
Dim cell As New Its.pdf.PdfPCell(New Its.Phrase(text, textfont))
cell.BackgroundColor = backcolor
cell.PaddingLeft = padleft
cell.PaddingRight = padright
cell.PaddingTop = padtop
cell.PaddingBottom = padbottom
cell.HorizontalAlignment = alignment
If Not border Then cell.Border = Its.pdf.PdfPCell.NO_BORDER
Return cell
End Function
End Class
If you say it can`t be done then i`ll try it -
Hi Experts,
Wondering if someone can help me out with this. I have a generic DAO class which looks like this;
package data;
import org.hibernate.SessionFactory;
import org.hibernate.Session;
public abstract class GenericDao {
protected Class persistedClass;
protected Session session;
public GenericDao(Class persistedClass) {
SessionFactory factory = HibernateUtil.getSessionFactory();
this.session = factory.getCurrentSession();
this.persistedClass = persistedClass;
public Object findById(int id) {
Object object = (Object) session.get(persistedClass, id);
return object;
public void save(Object object) {
try {
session.beginTransaction();
session.save(object);
session.getTransaction().commit();
} catch (Throwable e) {
if (session.getTransaction().isActive()) {
session.getTransaction().rollback();
System.out.println(e.getMessage());
}and also a UserDAO class which looks like this;
package data;
import data.entities.User;
import org.hibernate.Query;
public class UserDao extends GenericDao {
public UserDao() {
super(User.class);
public User Select(String alias) {
Query query = session.createQuery("from User where alias= ? ");
query.setString(0, alias);
return (User) query.uniqueResult();
}I am trying to do something like this;
class Controller{
UserDao con = new UserDao ();
con.Select("Test_ALIAS");
}to basically return the result fetched matching the parameter TEST_ALIAS, in which i can select other values like Name and address which is part of the values return. But unfurtunately i dont know how get these values from the return results.
Can someone help me?
Psuedocode will be helpful.
Ta!
Edited by: bidox on Apr 16, 2009 3:58 AMThanks york!
Something just strike me again and kind off stuck at the moment.
im my GenericDao i have this method;
public void save(Object object) {
try {
session.beginTransaction();
session.save(object);
session.getTransaction().commit();
} catch (Throwable e) {
if (session.getTransaction().isActive()) {
session.getTransaction().rollback();
System.out.println(e.getMessage());
}Do you know how i can go about implement this method by passing the relevant data values to comit to save? -
Forcing the ReadAllQuery to return results from DB instead of cache
How can I programmatically setup a ReadAllQuery to always return results from DB instead of cache. I dont want to use session.refreshObject - as this will result in 2 lookups - first for the actual search from cache or db and then a second search on each object on the DB. I am using Toplink 11.1.1
You can use,
query.refreshIdentityMapResult()
or,
query.setShouldRefreshIdentityMapResult(true)
James : http://www.eclipselink.org -
Rookie...can't return results from JDBC query?
I am trying to get my web service to return results to the client from my JDBC query. They "try/catch statements sem to be in the way. I can't return anything within them or outside of them. Can someone tell me how I could get my results to return to where I want them to?
At present, all this does is return the value "Dummy" to my client. Shouldn't the value be reset by the results of the query coming in?
package hello;
import java.sql.*;
public class HelloImpl implements HelloIF {
String s2 = "Dummy";
public String sayHello(String s) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
catch( Exception e ) {
System.out.println("Failed to load driver.");
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:liggy11/fisher@dligman:1521:dligman");
Statement stmt = conn.createStatement();
String query = "SELECT end_phrase FROM rap_lines WHERE start_phrase = '" + s + "'";
ResultSet rs = stmt.executeQuery(query) ;
while (rs.next()) {
s2 = rs.getString("end_phrase");
System.out.println("Got another row. s2 is now [" + s2 + "]");
catch( Exception e ) {
e.printStackTrace();
return new String(s2);liggy11,
I believe the smart-ass forum is the most appropriate
place for replies such as yours. Excuse me while I
get with some honeys....
Peace in the middle east,
mrcheeks.
I'm Sorry Miss Jackson!
Maybe you are looking for
-
I tried to download itunes to my phone.First it wanted it to download the new itunes.We also updated our Windows xp.I kept coming up can't complete because there was an error when setting up.One time is was error 9 and they tried to help me.I have a
-
Why am I getting failures with converting Word docs with Acr 9.3.0
Since an upgrade occurred in Version 9 (9.3.0) I cannot make a pdf conversion of a word file I use every 2 weeks. What has happened
-
How do i extract pages from within a pdf document?
how do i extract pages from within a pdf document?
-
So far I have found problem on page 73 where the image is over text making it undreadable and same problem on page 87 - is there a corrected version available
-
Changing Withholding tax base amount- 1099 invoice
Hi Friends, Need your help again. Using T. Code FB09, i can change WHT base as long as the invoice is not cleared. However, how to change WHT base where a particular invoice has been cleared? I have actually made some cchanges to configuration where