This is a migrated thread and some comments may be shown as answers.

Style sheet lost after serialization

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Björn
Top achievements
Rank 2
Björn asked on 21 Apr 2011, 08:27 AM
Dear Support Team

Our software system generate reports on a business server.
A web server shows the reports (within a report book) on a web page.
The generated reports are serialized/deserialized and transferred from the business to the web server by a WCF streaming contract.

Problem:
The style sheets are not applied if the report is opened in the html viewer, the same after exporting to PDF or RTF.

I made a simple test by opening the same report locally on the web server without serialization and it shows the styled elements correctly.

Here is the code that deserializes the report document on the web server:
IReportDocument document = null;
using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(dataFile))
{
    System.Xml.Serialization.XmlSerializer xmlSerializer =
        new System.Xml.Serialization.XmlSerializer(typeof(Telerik.Reporting.ReportBook));
    document = (Telerik.Reporting.ReportBook)xmlSerializer.Deserialize(xmlReader);
}

The serialized xml document 'dataFile' (that the web server gets from the business server) from the code above includes the style sheet correctly.
<StyleSheet>
  <StyleRule>
    <Style BackgroundColor="Transparent" Color="Black" VerticalAlign="Middle">
      <BorderStyle Bottom="Solid" />
      <BorderColor Default="DimGray" />
      <BorderWidth Default="1px" />
      <Font Size="11pt" Style="Bold" />
      <Padding Left="0cm" />
    </Style>
    <Selectors>
      <StyleSelector>
        <Type>ReportItemBase</Type>
        <StyleName>Test</StyleName>
      </StyleSelector>
    </Selectors>
  </StyleRule>
</StyleSheet>

I compared the serialized file on the business server and the transferred one on the web server and they are identical.

Because of that it seems to be a problem on the report viewer or my de-serialization code (that I copied from the reporting online help).

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 26 Apr 2011, 06:03 PM
Hello Björn,

We have double checked that the xml serialization/deserialization of the style sheet works properly and is applied correctly when displaying the report in the viewer. In order to investigate the issue, please try to reproduce the problem in a standalone solution and send it to us in a support ticket.

To check whether the problem is caused by the xml deserialization or by the report viewer, you can try to export the report into a file (e.g. pdf) right after the deserialization and before setting it to the Report property of the viewer. Another thing you can try is to create the same report programmatically on the web server and see what will happen. Let us know the results after the experiment.

Hope this helps.

All the best,
Chavdar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Björn
Top achievements
Rank 2
Answers by
Chavdar
Telerik team
Share this question
or