Question

Our scenario is that we have been given a Word document that needs to be turned into an SSRS report.

So our steps have been:

  1. Open document in Word 2007
  2. Save document as .rdl after getting layout correct (we are using OfficeWriter 8.6.0)
  3. Open .rdl in VS2008 to add queries
  4. Save .rdl and re-open in Word 2007.

The problem is that after saving the .rdl from VS2008, the original XML created by OfficeWriter is changed, and Word doesn't show any formatting.

The original XML from OW is

<Custom Application="Word" VersionEx="8.6.0">data</Custom>

But after opening the .rdl in VS2008 and saving it, the XML becomes

<CustomProperties>
    <CustomProperty>
        <Name>Custom</Name>
        <Value>data</Value>
    </CustomProperty>
</CustomProperties> 

So I guess my question is, should we be attempting to edit an OfficeWriter 8.6 .rdl file in VS2008, or should we be doing everything from Word (using MS Query)?

EDIT

We've found an interesting workaround/hack:

After saving the changes from VS2008, if we manually edit the .rdl to make the XML be in this format

<CustomProperties>
     <CustomProperty>
         <Name>OfficeWriter_Designer_Version</Name>
         <Value>8.6.0</Value>
     </CustomProperty>
     <CustomProperty>
         <Name>Word</Name>
         <Value>data</Value>
     </CustomProperty>
</CustomProperties>

Then the .rdl can be edited in both OfficeWriter and VS2008 without loss of formatting.

BTW, where it says data in the XML snippets, this is just my placeholder for the serialized data that OfficeWriter outputs.

Was it helpful?

Solution

You should be able to edit an RDL created by the OfficeWriter Designer in Visual Studio. However, you should also have started the entire process in Visual Studio, and its not clear from your description that you did so. This tutorial in the documentation explains the workflow of creating a Word report from an RDL created in Visual Studio. The only thing missing from that tutorial is the new feature, introduced in version 8.6.0, that allows you to import an existing Word document into a report. Here are the steps:

  1. Create an RDL file in Visual Studio with all your queries
  2. Open the RDL file in the OfficeWriter Designer toolbar in Word
  3. Import your existing Word document
  4. Insert merge fields and set repeat regions as desired from the Designer
  5. Make any other formatting changes as desired and save the RDL in the Designer (to disk or to the Report Server)

If you need to modify the queries after the initial report has been created with the OfficeWriter Designer, you should be able to edit the RDL in Visual Studio and the OfficeWriter-specific information should be preserved.

Note: I work for SoftArtisans

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top