on 2007 Jan 05 11:02 AM
Hi gurus,
Im currently working on a web template including two tables "TABLE_1" and "TABLE_2". These are based on two different data providers/queries.
A print function is set up for the report, spawning a printer-friendly version of the report. The following code is used for this purpose, where 'land' stands for landscape mode and 'port' stands for portrait mode:
<script>
//This function prints the query.
function printing(ty){
url=SAP_BW_URL_Get();
if( ty == "land" )
{ window.alert("This report runs best on landscape. Make sure to change you printer orientation.");
wnd=window.open(url+"&cmd=PROCESS_HELP_WINDOW&help_service=ZPRINTING&item=TABLE_1&P_DATA_AREA_PADDING_TOP=0&P_STYLESHEET=/sap/bw/Mime/BEx/StyleSheets/BWReports_smallfont_print.css &P_PAGE_WIDTH=25.5&P_PAGE_HEIGHT=17&P_DATA_AREA_ROWS=27&P_DATA_AREA_COLUMNS=6&P_DATA_AREA_INDENT_RIGHT=-1&P_PREVIEW_MODE="); wnd.print(); }
if( ty == "port" )
{ wnd=window.open(url+"&cmd=PROCESS_HELP_WINDOW&help_service=ZPRINTING&item=TABLE_1&P_DATA_AREA_PADDING_TOP=0&P_STYLESHEET=/sap/bw/Mime/BEx/StyleSheets/BWReports_smallfont_print.css &P_PAGE_WIDTH=17&P_PAGE_HEIGHT=25.5&P_DATA_AREA_ROWS=45&P_DATA_AREA_COLUMNS=3&P_DATA_AREA_INDENT_RIGHT=-1&P_PREVIEW_MODE= "); wnd.print(); }
}</script>
As you can see, the function is currently set to only include TABLE_1, however i wish to include TABLE_2 as well. How is this table included in the above code?
Thanks in advance,
BR
Morten
Morten,
Check out...
/people/ignacio.hernndez/blog/2006/12/22/open-innovation-call
this has a link for an open source project on BW web Printing - here they use the print service class as well as resize the current window to make it printable .. worth a try..
The code is available at
http://bwwebprinter.sourceforge.net/
Arun
Assign points if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Thx for the answer. This is unfortunately what i expected, only i hoped that there would be some way of i.e. declaring a joined object in the code, thus joining the two tables for the print view.
BR
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Morten,
The functions in WAD are specific to a dataprovider and hence you would be able to see the print view of only one table / web item - another option is to see if you can reduce the query sizes to fit into one page and then do a print from the browser instead..
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MK,
Thanks for the reply. The code you provided only seems to be returning one table (as is my problem with my own code as well).
BR
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Morten,
You should have the code below:
<td nowrap span class="SAPBEXBtnStd" ><A title="Printer Friendly Version" href="<SAP_BW_URL CMD='RELEASE_DATA_PROVIDER' DATA_PROVIDER_1='DATAPROVIDER_1' TEMPLATE_ID="ZMKT_BP_ACTFCST_WBTMP2">" target =_blank>
Print Preview</A>
And then define the table for printing friendly version:
<TD align="left" width="334" bgColor="#9dbbd7" colSpan="2"
><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TABLE_2"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="CAPTION" value="Give Caption here "/>
<param name="HIDDEN" value="X"/>
<param name="WIDTH" value="692"/>
<param name="HELP_SERVICE" value="ZPRINTING"/>
<param name="HELP_SERVICE_CLASS" value="Z_PRINT_HELP_SERVICE"/>
ITEM: TABLE_2
</object></TD></TR>
</P>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.