Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use user-defined css name as a report parameter?
4robert
Hi All,
I have designed a report using birt-rcp-report-designer-2.3.2
I want to design a report which will take css name as a parameter and generate the report according to that css. For that reason I have designed a report and two different css. I have seen a Report which use the same technique and pass css a name as a report parameter with pre-defined css class name. But in my case it is not working as I have designed user-defined css to design the report and link every element of my report individually to the class name of that css. So, what is wrong with me. Is it possible to design the report according to user-defined css and then pass this css name as a parameter? And how to link that user-defined(custom css) css class name to report element?
Can anyone tell me how to solve this problem?
It is really urgent. Please Help me.
Thanks in Advance!
Robert
Find more posts tagged with
Comments
CBR
Hi,
can you describe a bit more? I m not sure if i really understood the problem.
As far as i understand you have two css files which define the same css classes but implement it in a different way. Let's say you have a class called text-element. In CSS file one text-element is defined as font color blue. In CSS file two text-element is defined as font color red.
You now want the user to select one of the css files (as a report parameter). If the user chooses CSS file 1 all report elements having style text-element have font color blue. If user chooses CSS file 2 all report elements having style text-element have font color red.
4robert
Hi All,
Thanx for your reply.
Here are some details.
Actually my requirement is that different user want to see reports in their different format. For example, user1 uses red as table header text color while user2 wants to use blue. For this requirement we can write our own css and then link that table header label to that particular css class name by selcting that element individually. Now, I can design two different report -Report1 and Report2 for user1 and user2 and also two different css- css1 for user1 and css2 for user2. In this way i can design reports according to their format without changing my bas report( just color change is done). And yoy are right both in css1 and css2 class name are same and difference is only with color. But in that case if n number user are there then i have to design n number reports. So I want to use css and only then want to pass that css name as report parameter to make it dynamic. In that case user can select different css to see report in different format.
So, how to pass that ?
Note: I write the user defined css which includes class name as per my choice, for example:
In css1:
.mainheadingtext1 {
my own class name for example
font-family : Arial;
font-size : 12 pt;
font-weight : bold;
text-align : left;
color : #FFFFFF;
}
.mainheadingtext2 {
my own class name for example
font-family : Arial;
font-size : 10 pt;
font-weight : bold;
text-align: left;
color : #000000;
}
.tableheader1 {
my own class name for example
background : #B8D0ED;
font-family : Arial;
font-size : 12 pt;
font-weight : bold;
color : #FF0000;
}
.tableheader2 {
my own class name for example
background : #D5E2F0;
font-family : Arial;
font-size : 11 pt;
font-weight : bold;
color : #003399;
}
And css2 with the same structure just the color is different.
So, please help me to solve this problem. It is really urgent!
Thanks in Advance!
Robert
4robert
Hi All,
Still no reply from anybody!
I really want the solution. If I need to elaborate more then let me know.
Please help me. Its really urgent.
Thanks in Advance!
Robert
4robert
Hi All,
Anyone facing same problem?
Anyone with some solutions?
Anyone for response?
It looks like nobody is interested to reply or there is no solution.
If it is not supported in the current feature of BIRT reports then let me know.
I am really hungry for solutions.
Any suggestions are welcome.
Thanks in Advance!
Robert
4robert
Hi All,
I am still searching for solutions.
Can anyone help me to solve this problem?
Thanks in Advance!
Robert
Virgil Dodson
Hi Robert,<br />
<br />
Enclosed is an example that swaps out a CSS file at runtime based on a report parameter. This example was created in BIRT 2.3.0 and uses a script in the initialize method of the report design to set the CSS file like below:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
dh = reportContext.getDesignHandle();
cssh = dh.openCssStyleSheet(params["cssParam"].value);
dh.addCss(cssh);
</pre>
4robert
Hi Virgil,
Thanx for your reply.
I had already looked at this report example earlier. Actually this report does not meet my criteria fully as it is designed for using only pre-defined css. Please have a look at any of the css, for example green.css used in this reports. Here all the user defined classes (like table-header, table-detail, table-footer ) are used in this report but none of 1>groupSection1 2>groupSection2 or 3>groupSection3 are used in this report, atleast I did not find any relation with this reports.
Am I missing something?
Actually in my first two post of this thread I elaborate this problem briefly.
The main problem are as follows:
a> How to use custom css and link this classes with this reports?
b> Main problem is that linking each element with custom css classes is possible in static report. But is there anyway to do this dynamically? Something like overriding , if possible.
Please give me some solution and take me out of this puzzled state.
One more question, how to use "Alternate background color" in predefined css as CSS Property like "background : #93BE95;" when I am writing a css file in notepad i.e how can I set that property in .css file for BIRT style? Actually I want to set the alternate row background color in .css file rather than doing so with the help of BIRT designer.
Thanks in Advance!
Robert