cancel
Showing results for 
Search instead for 
Did you mean: 

Is property CSS styling supported in Crystal Reports

Former Member
0 Kudos

Hi,

Please help me with following issue:

I have an ASP.NET project and it contains a lot of reports (.rpt, CrystalReports).

All worked fine untill I updated my CrystalReports to version 13. (were VS2008, .NET 3.5, now VS2010, .NET 4.0, CR13.0 )

All my reports have lost css-styles.

The styles were set according to this msdn link and worked fine:

http://msdn.microsoft.com/en-us/library/aa288418%28v=vs.71%29.aspx

I've investigated this problem and found out the reason:

for now the report itself is rendered inside its inner IFrame and obviously all css-styles specified for parent page are not applied.

But could you tell me is css-styling supposed to work in CR 13?

Or at least whom I should address this question to?

Alexander

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

CSS Stypes are supported in CRVS2010. For more information, download the [SAP Crystal Reports .Net SDK Developer Giude|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip]. Search for:

style sheet

More CRVS2010 resources, including more developer guides can be found here:

http://www.sdn.sap.com/irj/sdn/crystalreports-dotnet

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Thread moved to the NET - SAP Crystal Reports forum

Edited by: Ludek Uher on Nov 11, 2011 9:26 AM

Answers (1)

Answers (1)

former_member188030
Active Contributor
0 Kudos

Hi Alexander,

Take a look at the SAP Note

[1604764 - How to customize the CrystalReportViewer Control with CSS. |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333633303334333733363334%7D.do]

Hope this helps,

Thanks,

Bhushan.

Former Member
0 Kudos

Thank you, guys for your answers.

I've looked at yours references but it doesn't work!

I've tried the suggested approach and it works fine for VS2008 and it doesn't work for VS2010, CR13.

I've already said the reason why it doesn't work. And I can't undestand how it can work.

I can send you very simple example that implements steps from SAP CR.NET SDK Developer guide but doesn't work.

Alexander

former_member183750
Active Contributor
0 Kudos

I think the issue is that we don't understand what you're trying to say - looking at your initial post. I'll break up the post so I can highlight the points:

1) All worked fine untill I updated my CrystalReports to version 13. (were VS2008, .NET 3.5, now VS2010, .NET 4.0, CR13.0 )

2) All my reports have lost css-styles.

3) the report itself is rendered inside its inner IFrame and obviously all css-styles specified for parent page are not applied.

4) But could you tell me is css-styling supposed to work in CR 13?

Thus re. (3) if that is the case, how did it work before you updated to CRVS2010?

Re. (4); yes css-styling works as described in the Developer Help file I pointed to in my inital response - I just tested the steps and it work as advertised. I did not use IFrame since; IFrame and obviously all css-styles specified for parent page are not applied

What am I missing?

- Ludek

Former Member
0 Kudos

Thank you, Ludek, for your answers!

Look at the html that was rendered by CR 10.5, it doesn't contains inner Iframe, but html from CR 13.0 contains inner Iframe, that prevents css styling. I can send you very simple solution that demonstrates the problem.

CR 13.0

div

link href="myStyle.css" rel="stylesheet" type="text/css"/

iframe width="100%" height="100%" id="bobjid_1321340118278_iframe"

Report here:

span class="MyTitle"

...

/iframe

/div

CR 10.5.3700.00

div

link href="myStyle.css" rel="stylesheet" type="text/css"/> --it's here from CrystalReportViewer CssFilename="myStyle.css"

div

Report here:

span class="MyTitle"

...

/div

/div

PS: I've missed angle brackets >< for correct rendering.

Edited by: AlexanderZ on Nov 15, 2011 8:59 AM

Former Member
0 Kudos

Hi, Ludek!

You said that css-styling works as described in the Developer Help file and you retested it.

Could you send me please your test solution?

Alexander

former_member183750
Active Contributor
0 Kudos

sample attached

Note that the viewer property CSSFilename is set to point to:

C:/test/WebApplication9/WebApplication9/bin/cutom.css

If you run the app as is, the left side panel of the viewer will show up "weird" as it is looking at the custom.css file which I have not modified. If you remove the path to the custom.css from the CSSFilename property, the left side viewer panel will show up correctly. E.g.; the viewer is looking at the custom.css file when in path.

- Ludek

Former Member
0 Kudos

Thank you, Ludek!

Could you also provide "formulas.rpt" ?

And could you please check your project, Properties->References->CrystalDecisions.Web,

I see it has version 10.5.

With this version I have no problem.

Edited by: AlexanderZ on Nov 16, 2011 5:36 PM

former_member183750
Active Contributor
0 Kudos

Sorry. That was d u m b..., though any "saved data" report can be substituted. Attached is formulas.rpt.

- Ludek

Former Member
0 Kudos

Hi, Ludek!

I've tested your example, and I see that css styles are not applied:

Could you please check this:

1. Open Formulas.rpt

2. Select any text object, for example top text object with text "Formulas"

3. Go to CssClass property of this object (F4) and set it for any css class from custom.css file, for example "promptHeader"

4. Open page and you can see that the text object lost his styles, and looks as plain text.

According to this

http://msdn.microsoft.com/en-us/library/aa288418%28v=vs.71%29.aspx

it must work. That's what I am speaking about last 2 days!

Edited by: AlexanderZ on Nov 17, 2011 9:27 AM

Edited by: AlexanderZ on Nov 17, 2011 9:31 AM

Former Member
0 Kudos

Could anybody who uses CR 13 check that css styling works as describing here:

http://msdn.microsoft.com/en-us/library/aa288418%28v=vs.71%29.aspx

I see that it doesn't.

Thanks!

former_member183750
Active Contributor
0 Kudos

Alexander, I had another look at it - with CR 2008 and was having problems with it there also. Unfortunately, I will not be able to do anymore work on this until end of next week \ early the week after. If this is a critical issue, please consider creating a phone case here:

http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyV...

I find that CSS are rarely used so I'm dubious as to anyone on these forums being able to jump in with any comment.

- Ludek

Former Member
0 Kudos

Thank you, Ludek!

It is not a very critical issue, but it is important to undestand that there is a problem with css styling in CR 13,

and undestand will it be fixed or not?

Please get back to this question when it will be convenient for you. For now I can use a workaround.

Alexander