Skip to Content
author's profile photo Former Member
Former Member

Print view of multiple tables (WAD)

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2007 at 01:09 PM

    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>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 08:09 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 08:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 09:01 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 11:01 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.