on 02-19-2008 3:46 PM
Hello All,
Is there a way that I could print the content of my WD view using a button inside, instead of using the print option of my browser. In order to print only the table or the form instead of printing the wholw portal.
Regards,
Orlando Covault
Hi Orlando,
What I had to do was build a string called "content" that was an html page with all the data from the WD page. This would be a popup page when the button view printer friendly page was pressed.
Here is the code to display the popup page:
byte[] printContent = content.getBytes();
try
{
IWDWindow win = wdThis.wdGetAPI().getComponent().getWindowManager().createExternalWindow
(WDWebResource.getWebResource(printContent, WDWebResourceType.HTML).getURL(),"Print Content",false);
//win.setWindowSize(100,100);
//win.setWindowPosition(WDWindowPos.CENTER);
win.open();
}
catch (WDURLException e)
{
wdComponentAPI.getMessageManager().reportWarning("Cannot generate printable content.");
}
-Clint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just created a string and added the html to it and the variables with the data. You can create as detailed as an html page as you need. Similiar to this:
String content = "<html><head><title>Printer Friendly Page</title>" +
"</head><body>Details<table border=\"1\"><th align=\"left\">Ad #</th> " +
"<th align=\"left\">name</th> <th align=\"left\">Ad#</th> " +
"<th align=\"left\">Total Price</th></tr><tr><td>" + strNum +
"</td><td>" + str + "</td><td>" +
"<th align=\"left\">word</th> <th align=\"left\">Status</th> </tr><tr><td>" + strRun + "</td>" +
"<td>" + strword + "</td><td>" + strStatus + "</td></td></tr>";
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.