Click here to Skip to main content
15,867,704 members
Articles / Productivity Apps and Services / Microsoft Office

XML/XSLT Word Report Generator

Rate me:
Please Sign up or sign in to vote.
3.80/5 (6 votes)
11 Jan 2009CPOL4 min read 123K   2.6K   84  
The tool is based on XML/XSLT, and allows a user to create a Word report from scratch, namely: construct SQL query, construct a WordML template, generate a document.
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace WordReportGenerator
{
    /// <summary>
    /// ��������� �������� IP ������ ��� PropertyGrid
    /// </summary>
    public class TextEditor : UITypeEditor
    {
        /// <summary>
        /// ���������� ������ ��������������
        /// </summary>
        public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
        {
            if ((context != null) && (provider != null))
            {
                IWindowsFormsEditorService svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (svc != null)
                {
                    using (TextEditorForm frm = new TextEditorForm((string)value))
                    {
                        if (svc.ShowDialog(frm) == DialogResult.OK)
                            value = frm.text;
                    }
                }
            }
            return base.EditValue(context, provider, value);
        }

        /// <summary>
        /// ���������� ����� ��������� - ��������� ����
        /// </summary>
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            if (context != null)
                return UITypeEditorEditStyle.Modal;
            else
                return base.GetEditStyle(context);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Russian Federation Russian Federation
I have Master degree in Particle Physics. During my last several years I work as software developer.

Primary Interests
- c#, c++, php, java.
- scientific programming

Comments and Discussions