Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
setting column width dynamically as per the dynamic date for excel report
Ronak
Hii,
Currently I am generating an report. I t goes good, but I have one problem. What I want is the set the size of columns dynamically. since data is dynamic the report column should be sized dynamic, instead of small or big. If it has to be done with script then how to do that. I dont know that script. Tell me how to do that.
If there is any alternate way then also inform me.
Thanks,
Ronak
Find more posts tagged with
Comments
Ronak
Hi,
I generated the report...Its working fine..but I have one question. I have a entire Master page width as 806 pixels and Now my report with dynamic width column has width size 906 pixels.
Now what actually happening is the data being displayed only upto the extent of 806 pixel only...the rest of data is ignored...means either cut of or not visible.
So my question is how to set the master page width to increase automatically as per the data...so that entire data can be fitted in it easily.
Thanks,
Ronak
mwilliams
If you have an average width that your columns usually come out with figured up, you could do something like this in your beforeRender method:
mpSize = params["numColumns"] * avgPixelWidth;
reportContext.getDesignHandle().getMasterPages().get(0).setStringProperty("width",mpSize.toString()+"px");
Unfortunately, it's too early to have access to your variables you set in your onFetch at this point. I figured we could get to those, but it doesn't seem so. You'll have to kinda guess on the needed width it looks like. Let me know.
Ronak
Hi Michael,
Now I need something new in report..Now suppose I created a table in database named font with 5 columns.
I inserted the data as different fonts name like ARIAL,MAGNETO etc...
Now what I want is that the data which are displayed in report...each column should have specific font in the report as per the table. i.e column 1 should have respective font of column 1 in the font table and so on.
Thanks,
Ronak
mwilliams
You can grab the font values in the onFetch for the font dataSet. You'll just need to include the hidden text box for this dataSet so it runs. Then, in the onCreate for your table you want to set the fonts in, you can find several options for font in:
this.getColumn(col#).getStyle().font%%%%%
There is fontFamily, fontWeight, fontSize, etc.
mwilliams
Here is the report I sent you on yahoo. I am posting for any others who have this same question.
Ronak
Hi Michael,
Thanks for the report. It works exactly as per the current requirement. Very happy with it
Thanks & Regards,
Ronak
Megha Nidhi Dahal
Hi Ronak,
Can you give it a try by setting your columns width to 100%? I have noticed that it will help maintaining a liquid design, i.e. The width will be as per the size of data.
Is that what you are looking for? Also set the table width to 100%
But the masterpage width has to be static.
Regards
Arpan
mwilliams
Arpan,
His issue with the 100% was that it left too much white space, I believe. I think that's why we went this route.