Solved

Image in Excel XML file with XSLT transformations

Posted on 2006-06-30
2
998 Views
Last Modified: 2008-02-01
I understand that we can not export image / shapes/ vba, etc. when we save an Excel spreadsheet as XML. I am creating a spreadsheet via a web process (it doesn't matter which). I gather the data and apply an XSLT template to the data and deliver it in the response buffer (after setting the content type too). This all works great - i have found a ton of examples on how to do this ASP, .Net - etc.

But how, there has to be a way, do I insert an image (logo) at the top of the spreadsheet report during this transformation?
0
Comment
Question by:frankirchner
2 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 250 total points
ID: 17026166
Hi frankirchner,
> at the top of the spreadsheet report during this transformation?

Is this spreadsheet report an HTML report or an Excel report
The datamodel for Excell XML does not allow images, so you could use it for the import process either
.net and ASP examples out there use the excell objects directly... this you can't do in XSLT in an easy way
(I would not recommend you to use XSLT for that)

Best option if you really want to do this using XSLT
is using the HTML table format...
that is a simple operation, adding an extra <tr>with a <td> containing an <img>

likely not what you were looking for...

Cheers!
0
 

Author Comment

by:frankirchner
ID: 17042178
Here is the Peice of code taken from MS Knowledge base:
    Private Sub SendResults(ByVal context As HttpContext, ByVal ds As DataSet)
        'Set up the response for Excel.
        context.Response.ContentType = "application/vnd.ms-excel"
        context.Response.Charset = ""

        'Transform the DataSet XML using transform.xslt
        'and return the results to the client in Response.Outputstream.
        Dim tw As XmlTextWriter
        Dim xmlDoc As XmlDataDocument = New XmlDataDocument(ds)
        Dim xslTran As XslTransform = New XslTransform
        xslTran.Load(context.Server.MapPath("transform.xslt"))
        xslTran.Transform(xmlDoc, Nothing, context.Response.OutputStream)
        context.Response.End()
    End Sub

So no - this is not a HTML Spreadsheet and i can not use the Excel Com Object either. I will accept your anwer that it can not be done this way. I was hoping not to have to build an HTML spreadsheet. But the graphic is that important.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now