Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report printing from PowerPlay Web using java & custom buttons 2

Status
Not open for further replies.

drlex

Technical User
Jul 3, 2002
3,295
GB
My less-able Cognos web users are complaining of the steps required to print all rows and columns of a PowerPlay Web report.
I have cobbled together some java in the ppcustom.js file so that clicking on one of the custom buttons will print the data frame, but the output is identical that one gets when clicking on the normal 'print' button
Code:
{function framePrint(whichFrame)
	{
	parent[whichFrame].focus();
	parent[whichFrame].print();
	}
framePrint('Data'); 
}

Is there an easy way to access all the data in the report to print it or should I put in for either an intensive Java course or 20" monitors for all users?


soi la, soi carre
 
I have exactly the same problem as you have.
I changed the Export to PDF , to export it into a new window , so they can print it without stopping slicing and dicing, or without waiting for the report.
But I would like to have it printable the same way as it was.
There is also a tips, to create a custom button which open the report in the Dynamic view, so they can print it from there. But the Dynamic view is not supported with 7.3, so if you still have 7.1 it will be ok for a while , but you'll face the same problem later
 
Thanks, Draoued,
Given your nice script to save graphs, I reckon that if you haven't solved it, there's little point in me tinkering further (and taking upfront up and down to reactivate ppcustom.js after each amendment).
Perhaps I can dupe the users - do you know which file I need to amend to access the 'Export to CSV' text in the
pop-up menu on the Toolbar 'File' button? (I can't see it in the .js files)

soi la, soi carre
 
You don't have to stop and restart upfront after amending the ppcustom.js. At least for me I just press F5 in Internet Explorer to reload the newest version. If it doesn't work, but it should, then stop/start PPES not Upfront.
You have the export to CSV in PPWBTOOLBAR.JS and in TOOLBAR.JS.
But it s just :
Code:
if( as == RA_CSV ) {
			fh.action += "?MIME=.CSV";
so I don't know what you can do with that.

Please let us know your findings.
 
Draoued,
You thought as I did; look for 'Export' in cer3.
If you add to ppwbcustom.js
Code:
function custom2() {
	var fh = topparent.getXtabFrame().document.fhidden;
	topparent.getXtabFrame()._fhchanged = true;
		topparent.getXtabFrame()._fhtarget = fh.target;
		topparent.getXtabFrame()._fhaction = fh.action;
		topparent.getXtabFrame()._fhRA = fh.RA.value;
	{
		FTok = false;
		fh.RA.value = 1;		
		var targetWindow = topparent;
		if( ! targetWindow.name || targetWindow.length == 0 )
			targetWindow.name = "PPESTarget";
		fh.target = targetWindow.name;

		fh.action += "?MIME=.CSV";
		
		fh.submit();
	} 
}
it works as if you chose file>Export CSV.
Now to create a nice .gif for the users in place of the '2' box!

soi la, soi carre
 
Drlex,

if you have some spare time , maybe you could investigate the following:
in ppwb folder : style.css
Search for
Code:
 /* frame containing the crosstab */	
#innerNice1_tab0 
{
	overflow: auto;
if you change the value of the Auto overflow, to "scroll" , or "visible" , can not recall which one .
Then you can print in Internet Explorer the full cross-tab.

I was thinking of a custom button , which would "Prepare bookmark" , overwrite ( if possible not sure) the overflow value so users would be able to print.

When you are changing the overflow value, you will see that the scroll bar are disappearing so it s not possible to see the total of the cross tab, so can not be implemented as such in PPES, as some users are not always printing the cross-tab.
 
Draoued,
Again, good pointer, but my limited knowledge of javascript is the problem. I note also that changing the overflow function to 'scroll' will allow printing of just the maximum number of rows and columns set in the display options (currently the default 50 x 20).

So a sequence of events to be coded would have to be:

1) set display options to a maximum value to incorporate all data. Possibly just put in 500 to save paper!
2) change overflow to visible
3) call print
4) revert overflow
5) revert display options

Although I've had a stab at 2 using 'document.getElementById()' and other similar methods, I get no success. Since I can only do 3) at present, I'll pass it back as being beyond my capabilities.

thanks for the dialogue, though.

soi la, soi carre
 
Just testing 7.3 PPES and I find that export XLS is now a file option, resulting in just a couple of extra lines in the javascript in ppwbcustom.js.

Coupled with the ability to rank (and thereby exclude the less important components), I think that will satisfy the majority of users.

soi la, soi carre
 
good.
I have just implemented the tips ,which load in a new window the same cross-tab , in "Generic layout" which still exit in the 7.3. From there users can print the full cross-tab , as before.
 
here is the code , I found it somewhere in Cognos.
It s not mine.

Code:
var fh = topparent.getXtabFrame().document.fhidden; // defines parent form 
fh.UI.value="0"; // changes UI to Generic
fh.target="_blank"; // opens in a new browser window 
fh.RA.value="7"; // runs report as a 'bookmark' view 
fh.submit();

fh.UI.value="0"; //Changes UI to generic
fh.UI.value="1"; //Changes UI to dynamic

 
No quotes requred around the 7 for fh.RA.value.
I'm getting rows and columns still limited to the display settings, so not a fix for me in 7.1


soi la, soi carre
 
try this one.

Code:
var fh = topparent.getXtabFrame().document.fhidden; 
fh.UI.value="0"; 
fh.target="_blank"; 
fh.RA.value= 7 ;
Amountrows = fh.G.value ;
AmountCols = fh.H.value;
fh.G.value = "65535";
fh.H.value = "65535";
fh.submit();
fh.G.value = Amountrows ;
fh.H.value = AmountCols ;

The fh.G.value is the number of Rows displayed , and H for the columns
it accepts only the autorized numbers defined in Cognos otherwise it takes the smaller one.
65535 is the value for All.

You need to reset the value , after the submit otherwise they are changing also in the enhanced layout ( Meaning source window )

I guess we finaly did it.
 
Boy, that generic/dynamic format of ver6 really grates after the more relaxed style of ver7!
I popped the focus() and print() commands into your latest code to remove another step. Now, all a user has to do is confirm a printer and then close the extra window.

Now I need to get back to the problem of drag and drop functionality being impaired after the latest MS bodge, sorry, patch.

soi la, soi carre
 
Drlex
Could you share your entire javascript , I ll like to test the focus() and print(), but I did not managed to add it , it s somehow not printing the proper page .
Did you manage to select only the selected frame , meaning the cross-tab only ??
 
Draoued

The frame required is called data. The code is a subset of something I found on the 'net. Naturally you could rewrite it as a direct call rather than a function definition and call.

Code:
{function framePrint(whichFrame)
	{
	parent[whichFrame].focus();
	parent[whichFrame].print();
	}
framePrint('Data'); // This should just print the cross tab
}

soi la, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top