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

Changing StyleSheets using BW WAD

Hi BW Gurus,

I have different Materials in my report, when user drill downs on paticular material for e.g. My material is Laptop X, It should show me the image of Laptop X and the report should contain different color format for the paticular material (laptop X) . Right now I have only one style sheet, but our requirement is to customize each and every report based on materials.

Is there anyway, i can change the default stylesheet based on the material user selected. If anyone of you done this before please help me. I was thinking to manipulate using Javascript but i have no idea how that will work.

Thanks for anykind of help.

Deepak

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2004 at 08:58 AM

    Hi,

    changing the CSS on runtime by JavaScript is very simple :

    1. Be sure, that your <LINK rel="stylsheet" ...> to your default-stylesheet has any ID, maybe <LINK rel="stylsheet" ... ID="css">

    2. change the stylesheet in a JavaScript-function by :

    document.getElementById("css").href="ThePathToTheStyleSheetYouWant";

    All you have to do now is to determine, what stylesheet do you want to show, so you have to create any JavaScript like :

    function changeCSS(material)

    {

    var CSSName;

    switch(material)

    {

    case MATERIAL_1 :

    CSSName = PathToStyleSheet4Material1;

    break;

    case MATERIAL_2 :

    CSSName = PathToStyleSheet4Material2;

    break;

    ...

    }

    document.getElementById("css").href=CSSName;

    }

    Fill it with your requirements, you can choose you CSS by array or switch-case or function or .....

    But - are you sure, that you have to maintenance a lot of style-sheets, in the worst-case for every material another CSS ?????

    Bye

    Ralf

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ralf,

      Thanks alot you really helped me.

      I think we gonna maintain different stylesheets for every material. As of now we have only 10 main materials where we need to change the stylesheets.

      Thanks,

      Deepak

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.